From 325656530833a925ea1cc907966a35acf5dedba9 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Mon, 22 May 2023 00:16:01 -0400 Subject: [PATCH] Add separate recur node --- src/ludus/grammar.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ludus/grammar.clj b/src/ludus/grammar.clj index 735497a..5d6193f 100644 --- a/src/ludus/grammar.clj +++ b/src/ludus/grammar.clj @@ -157,7 +157,9 @@ (zero+ arg-entry) (quiet :rparen)]))) -(def synth-root (flat (choice :synth-root [:keyword :word :recur]))) +(def recurr (group (order-1 :recur [(quiet :recur) tuple]))) + +(def synth-root (flat (choice :synth-root [:keyword :word]))) (def synth-term (flat (choice :synth-term [args :keyword]))) @@ -190,13 +192,12 @@ (one+ block-line) (quiet :rbrace)]))) -(def pipeline (order-0 :pipeline [nls? :pipeline])) +(def pipeline (quiet (order-0 :pipeline [nls? :pipeline]))) -(def do-entry (order-0 :do-entry [pipeline expression])) +(def do-entry (order-1 :do-entry [pipeline expression])) (def doo (group (order-1 :do [(quiet :do) expression - ;; should this be zero+? (one+ do-entry) ]))) @@ -230,6 +231,7 @@ spawn receive synthetic + recurr block doo reff