diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-17 23:08:13 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-17 23:08:24 -0700 |
| commit | ba639f2bd05f47e08c12198b7b20cd4cf371b25f (patch) | |
| tree | 656fcb15a27e642f891fba24046e01b4f139ab52 /core/coroutines.nom | |
| parent | 854b2a652ff473c9d2eaa3222008d4baed36ae63 (diff) | |
Upgraded core code to latest Nomsu verison.
Diffstat (limited to 'core/coroutines.nom')
| -rw-r--r-- | core/coroutines.nom | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/coroutines.nom b/core/coroutines.nom index 8a1f8c9..c14042c 100644 --- a/core/coroutines.nom +++ b/core/coroutines.nom @@ -1,18 +1,15 @@ -#!/usr/bin/env nomsu -V1 +#!/usr/bin/env nomsu -V2.2.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)" -compile [coroutine %body, generator %body] to - 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))" -compile [for % in coroutine %co %body] to +compile [->] to (Lua value "coroutine.yield(true)") +compile [-> %] to (Lua value "coroutine.yield(true, \(% as lua expr))") +compile [for % in coroutine %co %body] to (..) Lua ".." for junk,\(% as lua expr) in coroutine.wrap(\(%co as lua expr)) do \(%body as lua statements) - end + end
\ No newline at end of file |
