From e665d9725c4bb02f4c18d16527367f424cb880fa Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 20 Mar 2019 15:55:57 -0700 Subject: Auto-updated to 7.0.0 syntax and removed some shims. --- lib/core/coroutines.nom | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'lib/core/coroutines.nom') diff --git a/lib/core/coroutines.nom b/lib/core/coroutines.nom index b151a4b..a11d6ee 100644 --- a/lib/core/coroutines.nom +++ b/lib/core/coroutines.nom @@ -1,5 +1,6 @@ -#!/usr/bin/env nomsu -V6.15.13.8 -# +#!/usr/bin/env nomsu -V7.0.0 + +### This file defines the code that creates and manipulates coroutines use "core/metaprogramming" @@ -16,11 +17,8 @@ test: repeat 3 times: yield 6 $nums = [] - for $ in (coroutine from $fn): - $nums, add $ - + for $ in (coroutine from $fn): $nums, add $ assume ($nums == [4, 5, 6, 6, 6]) - $d = {.x = 0} $co = coroutine: @@ -35,7 +33,6 @@ test: [$ok, $val] = (co) assume ($ok == (yes)) assume ($val == 5) - $t = [] $i = 1 for $ in @@ -47,8 +44,7 @@ test: ..: $t.$i = $ $i += 1 - assume ($t == [4,5,nil,6]) - + assume ($t == [4, 5, nil, 6]) $t = [] for ($k = $) in coroutine: @@ -58,11 +54,11 @@ test: yield 6 ..: $t, add {.key = $k, .value = $} + assume $t == [ {.key = 1, .value = 4}, {.key = 2, .value = 5}, {.key = 3}, {.key = 4, .value = 6} ] - -(coroutine $body) parses as (coroutine from (-> $body)) +(coroutine $body) parses as (coroutine from ->$body) external: ($ is a dead coroutine) means - ((lua type of $) == "thread") and ((coroutine status of $) == "dead") + ((lua type of $) == "thread") and ((coroutine status of $) == "dead") \ No newline at end of file -- cgit v1.2.3