From fa3f598fc3b91d92665fda293460944f75c95b67 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 9 Nov 2018 17:02:39 -0800 Subject: Fixing the upgrade pipeline, plus some misc. fixes. --- core/metaprogramming.nom | 6 ++++-- core/text.nom | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'core') 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 -- cgit v1.2.3