]> git.lizzy.rs Git - metalua.git/blobdiff - src/samples/h_test.mlua
Merge branch 'master' of ssh://git.eclipse.org/gitroot/koneki/org.eclipse.koneki...
[metalua.git] / src / samples / h_test.mlua
diff --git a/src/samples/h_test.mlua b/src/samples/h_test.mlua
deleted file mode 100644 (file)
index b8cdb53..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
--{ extension 'log' }
--{ extension  'H'  }
-
-require 'metalua.compiler'
-
-TEST_CASES = { 
-
-   {  "everything should be renamed",
-      +{ block: 
-         local x = 3
-         print(x) },
-      { } }, 
-
-  {  "don't get confused between global and local x",
-     +{ block: 
-        print(x)
-        local x = 3
-        print(x) },
-     { alpha = { } } },
-
-  {  "don't rename keepme",
-     +{ block:
-        keepme()
-        dont_keep_me() },
-     { keep = 'keepme' , alpha = `Local{ { }, { } } } },
-  {  "print shouldn't be renamed the 2nd and 3rd time",
-     +{ block:
-        print(i)
-        -{!`Call{`Id 'print', `String 'hi' } } 
-        -{!+{print 'hi'}} },
-     { } },
-  {  "print shouldn't be renamed at all",
-     +{ block: 
-        print(i)
-        -{`Call{`Id 'print', `String 'hi' } }
-        -{+{print 'hi'}} },
-     { keep = 'print' } },
-  {  "Rename print with a pre-specified name, rename x freely, not y",
-     +{ block: 
-        print (x, y) },
-     {  alpha = +{stat: local RENAMED_PRINT = print}, 
-        keep  = {y = true} } } } 
-
-for case in ivalues(TEST_CASES) do
-   local comment, ast, cfg = unpack(case)
-   print ('\n'..'-':rep(70))
-   print (comment)
-   local H = H:new(cfg)
-   print ("\nBEFORE PARSING:")
-   $log (ast, H, 50)
-   H(ast)
-   print ("\nAFTER PARSING:")
-   $log (ast, H, 50)
-end
-
-print ('\n'..'=':rep(70))
-$log(TEST_CASES,40)
\ No newline at end of file