diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-04 13:49:09 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-04 13:49:20 -0700 |
| commit | 126f51f955351a4ce85f3f1e6da6e9219ec7e23a (patch) | |
| tree | a5189914f3dfe94e465518b60dadc4f0422be971 /core | |
| parent | a5bbce315dd9e6861d426bb16a3d792e2a3c0dfc (diff) | |
Removing varargs from free var functions.
Diffstat (limited to 'core')
| -rw-r--r-- | core/metaprogramming.nom | 16 | ||||
| -rw-r--r-- | core/operators.nom | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index d4ae624..6d2f764 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -28,7 +28,7 @@ immediately end local body_lua = \%lua:as_lua(nomsu); body_lua:convert_to_statements("return "); - body_lua:remove_free_vars(unpack(args)); + body_lua:remove_free_vars(args); body_lua:declare_locals(); lua:append(")\n ", body_lua, "\nend);"); return lua; @@ -60,7 +60,7 @@ immediately end local body_lua = \%body:as_lua(nomsu); body_lua:convert_to_statements("return "); - body_lua:remove_free_vars(unpack(args)); + body_lua:remove_free_vars(args); body_lua:declare_locals(); lua:append(")\n ", body_lua, "\nend);") return lua; @@ -127,14 +127,14 @@ immediately lua:convert_to_statements(); return lua; - compile [declare locals in %tree] to - Lua "\(%tree as lua expr):declare_locals();" + compile [declare locals in %code] to + Lua value "\(%code as lua expr):declare_locals()" - compile [declare locals %locals in %tree] to - Lua "\(%tree as lua expr):declare_locals(\(%locals as lua expr));" + compile [declare locals %locals in %code] to + Lua value "\(%code as lua expr):declare_locals(\(%locals as lua expr))" - compile [remove free vars %vars from %tree] to - Lua "\(%tree as lua expr):remove_free_vars(unpack(\(%vars as lua expr)));" + compile [remove free vars %vars from %code] to + Lua "\(%code as lua expr):remove_free_vars(\(%vars as lua expr));" action [%tree as value] =lua "nomsu:tree_to_value(\%tree)" diff --git a/core/operators.nom b/core/operators.nom index 6ec6909..88b0374 100644 --- a/core/operators.nom +++ b/core/operators.nom @@ -54,7 +54,7 @@ immediately lua> ".." local lua = Lua(tree.source, \%var_lua, ' = ', \%value_lua, ';'); if \%var.type == 'Var' then - lua:add_free_vars(\%var); + lua:add_free_vars({\%var}); end return lua; @@ -72,7 +72,7 @@ immediately local value_lua = value:as_lua(nomsu); if not value_lua.is_value then error("Invalid value for assignment: "..value:get_src()); end if target.type == "Var" then - lhs:add_free_vars(target); + lhs:add_free_vars({target}); end if i > 1 then lhs:append(", "); @@ -93,7 +93,7 @@ immediately compile [exporting %exported %body] to %body_lua <- (%body as lua statements) - lua> "\%body_lua:remove_free_vars(unpack(\(%exported.value)));" + lua> "\%body_lua:remove_free_vars(\(%exported.value));" return %body_lua compile [with %assignments %body] to @@ -112,7 +112,7 @@ immediately error("Invalid value for assignment: "..tostring(value.source:get_text())); end if target.type == "Var" then - lhs:add_free_vars(target); + lhs:add_free_vars({target}); end if i > 1 then lhs:append(", "); |
