diff options
Diffstat (limited to 'lib/moonscript.nom')
| -rw-r--r-- | lib/moonscript.nom | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/moonscript.nom b/lib/moonscript.nom index 89f5ffb..89468c6 100644 --- a/lib/moonscript.nom +++ b/lib/moonscript.nom @@ -6,13 +6,13 @@ parse [moonscript do> %moonscript_code] as: |local parse, compile = require('moonscript.parse'), require('moonscript.compile'); |local moon_code = nomsu:tree_to_value(vars.moonscript_code, vars); |local tree, err = parse.string(moon_code); - |if not tree then; + |if not tree then | nomsu:error("Failed to parse moonscript: "..err); - |end; + |end |local lua_code, err, pos = compile.tree(tree); - |if not lua_code then; + |if not lua_code then | nomsu:error(compile.format_error(err, pos, moon_code)); - |end; + |end |return "do\\n"..lua_code.."\\nend"; parse [moonscript> %moonscript_code] as: @@ -20,11 +20,11 @@ parse [moonscript> %moonscript_code] as: |local parse, compile = require('moonscript.parse'), require('moonscript.compile'); |local moon_code = nomsu:tree_to_value(vars.moonscript_code, vars); |local tree, err = parse.string(moon_code); - |if not tree then; + |if not tree then | nomsu:error("Failed to parse moonscript: "..err); - |end; + |end |local lua_code, err, pos = compile.tree(tree); - |if not lua_code then; + |if not lua_code then | nomsu:error(compile.format_error(err, pos, moon_code)); - |end; + |end |return "(function(nomsu, vars)\\n"..lua_code.."\\nend)(nomsu, vars)"; |
