From ea3197aaffba00318920ed5e1e33ca5f2a5e6c5c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 30 Oct 2018 23:42:04 -0700 Subject: Fully working version of (action [foo]: baz) -> ((foo) means: baz) refactor and misc other changes. --- core/coroutines.nom | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/coroutines.nom') diff --git a/core/coroutines.nom b/core/coroutines.nom index e7ec41e..246a2ef 100644 --- a/core/coroutines.nom +++ b/core/coroutines.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.8.8.6 +#!/usr/bin/env nomsu -V4.8.10 # This file defines the code that creates and manipulates coroutines @@ -14,15 +14,15 @@ test: for % in coroutine %co: %nums::add % assume (%nums == [4, 5, 6, 6, 6]) or barf "Coroutine iteration failed" -compile [coroutine %body, generator %body] to (..) +[coroutine %body, generator %body] all compile 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 (..) +(->) compiles to (Lua value "coroutine.yield(true)") +(-> %) compiles to (Lua value "coroutine.yield(true, \(% as lua expr))") +(for % in coroutine %co %body) compiles to (..) Lua "\ ..for junk,\(% as lua expr) in coroutine.wrap(\(%co as lua expr)) do \(%body as lua statements) -- cgit v1.2.3