aboutsummaryrefslogtreecommitdiff
path: root/core/coroutines.nom
diff options
context:
space:
mode:
Diffstat (limited to 'core/coroutines.nom')
-rw-r--r--core/coroutines.nom8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/coroutines.nom b/core/coroutines.nom
index bff115d..52467c1 100644
--- a/core/coroutines.nom
+++ b/core/coroutines.nom
@@ -1,10 +1,14 @@
-#!/usr/bin/env nomsu -V2.4.4.3
+#!/usr/bin/env nomsu -V2.5.4.3
#
This file defines the code that creates and manipulates coroutines
use "core/metaprogramming.nom"
+
compile [coroutine %body, generator %body] to (..)
- Lua value "(function()\n \(%body as lua statements)\nend)"
+ Lua value ".."
+ (function()
+ \(%body as lua statements)
+ end)
compile [->] to (Lua value "coroutine.yield(true)")
compile [-> %] to (Lua value "coroutine.yield(true, \(% as lua expr))")