From 10bd72e858a8ffaacafa296dbbc429dc73b0111c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 18 Jan 2019 14:22:17 -0800 Subject: Added `tree` back as a parameter to compile actions, which helps with better error reporting, e.g. for (fail) (no arguments). Overall better error reporting now. Also added shorthand ("Action" tree with ...) for (SyntaxTree {.type = "Action", .1 = ...}). --- nomsu_compiler.moon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nomsu_compiler.moon') diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon index 0bb020c..e17d5e2 100644 --- a/nomsu_compiler.moon +++ b/nomsu_compiler.moon @@ -65,7 +65,7 @@ compile = (tree)=> args = [arg for arg in *tree when type(arg) != "string"] -- Force Lua to avoid tail call optimization for debugging purposes -- TODO: use tail call? - ret = compile_action(@, unpack(args)) + ret = compile_action(@, tree, unpack(args)) if ret == nil info = debug.getinfo(compile_action, "S") filename = Source\from_string(info.source).filename -- cgit v1.2.3