diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/metaprogramming.nom | 6 | ||||
| -rw-r--r-- | core/text.nom | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index fc81e15..b27147d 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -365,8 +365,10 @@ test: # Return statement is wrapped in a do..end block because Lua is unhappy if you put code after a return statement, unless you wrap it in a block. -(return) compiles to "do return; end" -(return %return_value) compiles to "do return \(%return_value as lua expr) end" +(return %return_value) compiles to "\ + ..do return \(..) + =lua "\%return_value and \(%return_value as lua expr) or ''" + .. end" # Literals (yes) compiles to "true" diff --git a/core/text.nom b/core/text.nom index d4cd227..28944dd 100644 --- a/core/text.nom +++ b/core/text.nom @@ -36,7 +36,7 @@ test: return (..) Lua "\ ..(function() - local \(mangle "comprehension") = _List{} + local \(mangle "comprehension") = List{} for \(%match as lua expr) in (\(%text as lua expr)):gmatch(\(..) %patt as lua expr ..) do |
