diff options
Diffstat (limited to 'Tools/LuaMacro/tests/mod.m.lua')
-rw-r--r-- | Tools/LuaMacro/tests/mod.m.lua | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Tools/LuaMacro/tests/mod.m.lua b/Tools/LuaMacro/tests/mod.m.lua new file mode 100644 index 0000000..50151e6 --- /dev/null +++ b/Tools/LuaMacro/tests/mod.m.lua @@ -0,0 +1,48 @@ +require_ 'module' + +local function dump(text) + print (text) +end + +function one () + return two() +end + +class Fred + + function _init(self,x) + @set(x or 1) + end + + function set(self,x) + @x = x + end + + function get(self) + return @x + end + + function set2(self) + @set(0) + end + +end + +class Alice : Fred + function __tostring(self) + return "Alice "..tostring(@x) + end + + function set2(self) + @set(1) + end +end + + +function two () + return 42 +end + + + + |