expr-repeat #19
|
@ -811,9 +811,9 @@
|
||||||
times (if (= :word (:type times-expr))
|
times (if (= :word (:type times-expr))
|
||||||
(resolve-word times-expr ctx)
|
(resolve-word times-expr ctx)
|
||||||
(-> times-expr :data first))
|
(-> 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)) {})))
|
(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))
|
(defn- interpret-literal [ast] (-> ast :data first))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user