aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-02 17:27:49 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-02 17:43:17 +0000
commitf58dc0c7f72fa036adab1c8ca2de6ec968989ea1 (patch)
tree50be346d8683312d116efa54522eccc55d9c4321
parentdynamic scoping (diff)
downloadalive-f58dc0c7f72fa036adab1c8ca2de6ec968989ea1.tar.gz
alive-f58dc0c7f72fa036adab1c8ca2de6ec968989ea1.zip
only :tick after :setup if dirty
-rw-r--r--core/invoke.moon11
-rw-r--r--core/parsing.moon2
2 files changed, 11 insertions, 2 deletions
diff --git a/core/invoke.moon b/core/invoke.moon
index 1fac7b8..ba19cc5 100644
--- a/core/invoke.moon
+++ b/core/invoke.moon
@@ -16,7 +16,16 @@ class op_invoke extends Action
eval: (scope, tail) =>
children = L\push -> [L\push expr\eval, scope for expr in *tail]
@op\setup [result for result in *children]
- @op\tick true
+
+ any_dirty = false
+ for input in @op\all_inputs!
+ if input\dirty!
+ any_dirty = true
+ break
+
+ if any_dirty
+ @op\tick true
+
for input in @op\all_inputs!
input\finish_setup!
diff --git a/core/parsing.moon b/core/parsing.moon
index e919c41..8a99d89 100644
--- a/core/parsing.moon
+++ b/core/parsing.moon
@@ -29,7 +29,7 @@ num = ((P '-')^-1 * (float + int)) / Value\parse 'num'
atom = num + sym + str
expr = (V 'cell') + atom
-explist = Ct mspace * (V 'expr') * (space * (V 'expr'))^0 * mspace
+explist = Ct mspace * ((V 'expr') * (space * (V 'expr'))^0 * mspace)^-1
tag = (P '[') * (digit^1 / Tag\parse) * (P ']')
cell = (P '(') * tag^-1 * (V 'explist') * (P ')') / Cell\parse