diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-09 14:48:23 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-09 14:48:40 -0800 |
| commit | a2f07415c5284bf94c146cea6eed4a15f171b9ab (patch) | |
| tree | 925ab30d70cac56c24e007f7daa0b89b9f371f3c /core/metaprogramming.nom | |
| parent | 7d2b7199d87930096b7fd799709fe0105d51eccb (diff) | |
Deprecating (% as lua statements) and (% as lua return)
Diffstat (limited to 'core/metaprogramming.nom')
| -rw-r--r-- | core/metaprogramming.nom | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index 2ae8b1b..1f787c2 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -233,17 +233,10 @@ test: [%action parses as %body] all parse as ([%action] all parse as %body) (%tree as lua expr) compiles to "\ - ..compile(\(=lua "compile(\%tree, nil, true)"), nil, true)" + ..compile(\(=lua "compile(\%tree, true)"), true)" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -(%tree as lua) compiles to "compile(\(%tree as lua expr))" -(%tree as lua statements) compiles to "\ - ..compile(\(%tree as lua expr)):as_statements()" - -(%tree as lua return) compiles to "\ - ..compile(\(%tree as lua expr)):as_statements('return ')" - externally [%var as lua identifier, %var as lua id] all mean: lua> "\ ..if lua_type_of(\%var) == 'string' then return \%var:as_lua_id() @@ -265,7 +258,7 @@ externally (% is %kind syntax tree) means (..) (%tree with %t -> %replacement) compiles to "\ ..\(%tree as lua expr):map(function(\(%t as lua expr)) - \(%replacement as lua return) + \((%replacement as lua) if (%replacement.type == "Block") else ("return \(%replacement as lua expr)")) end)" externally (%tree with vars %replacements) means (..) @@ -393,7 +386,7 @@ test: --local compile = _1_forked(compile) local old_action = compile.action compile.action = _1_forked(old_action) - \(%body as lua statements) + \(%body as lua) compile.action = old_action end" |
