aboutsummaryrefslogtreecommitdiff
path: root/core/metaprogramming.nom
diff options
context:
space:
mode:
Diffstat (limited to 'core/metaprogramming.nom')
-rw-r--r--core/metaprogramming.nom6
1 files changed, 4 insertions, 2 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"