diff --git a/src/ludus/grammar.cljc b/src/ludus/grammar.cljc index 47e0978..334c491 100644 --- a/src/ludus/grammar.cljc +++ b/src/ludus/grammar.cljc @@ -229,7 +229,7 @@ (defp loop-expr group order-1 [(quiet :loop) tuple (quiet :with) (flat (choice :loop-body [fn-clause compound-loop]))]) -(defp repeat-expr group order-1 [(quiet :repeat) (choice :times [:word :number]) block]) +(defp repeat-expr group order-1 [(quiet :repeat) (choice :times [:word :number]) non-binding]) (defp collection flat choice [;struct-literal dict list-literal set-literal tuple]) diff --git a/src/ludus/interpreter.cljc b/src/ludus/interpreter.cljc index ae73192..bac3602 100644 --- a/src/ludus/interpreter.cljc +++ b/src/ludus/interpreter.cljc @@ -811,9 +811,9 @@ times (if (= :word (:type times-expr)) (resolve-word times-expr ctx) (-> times-expr :data first)) - block (second data)] + expr (second data)] (if (not (number? times)) (throw (ex-info (str "Repeat needs a number, not a " (base/get-type times)) {}))) - (dotimes [_ times] (interpret-ast block ctx)))) + (dotimes [_ times] (interpret-ast expr ctx)))) (defn- interpret-literal [ast] (-> ast :data first)) diff --git a/src/ludus/node.cljc b/src/ludus/node.cljc index 3817216..f03d441 100644 --- a/src/ludus/node.cljc +++ b/src/ludus/node.cljc @@ -67,11 +67,7 @@ (do (def source " - test \"foo\" false - test \"bar\" true - test \"baz\" { - let quux = florp - } + ") (-> source run :test println)