]> git.lizzy.rs Git - metalua.git/blobdiff - src/samples/walk_id_test.mlua
Merge branch 'master' of ssh://git.eclipse.org/gitroot/koneki/org.eclipse.koneki...
[metalua.git] / src / samples / walk_id_test.mlua
diff --git a/src/samples/walk_id_test.mlua b/src/samples/walk_id_test.mlua
deleted file mode 100644 (file)
index f8f01a0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
--{ extension 'match' }
-
-require 'metalua.walk.id'
-
-ast = +{ block:
-         y = type(1)
-         function foo(x)
-            local type = 'number'
-            assert(x==type or not x)
-         end
-         foo(x) }
-
-disp = |msg,ast| printf("\n%s:\n%s", msg, table.tostring(ast, 80, 'nohash'))
-disp('initial term', ast)
-
-do -- Make globals explicit:
-   local ast = table.deep_copy(ast)
-   local cfg = { id = { } }
-   function cfg.id.free(i) 
-      i <- `Index{ `Id '_G', `String{i[1]} } 
-      return 'break'
-   end   
-   walk_id.block(cfg, ast)
-   disp('Globals made explicit', ast)
-end
-