mirror of
https://github.com/penpot/penpot.git
synced 2025-07-28 05:07:24 +02:00
Merge branch 'main' into develop
This commit is contained in:
commit
7a97c94f2b
16 changed files with 273 additions and 175 deletions
|
@ -28,9 +28,8 @@
|
|||
(let [token (first tree)
|
||||
args (rest tree)]
|
||||
(case token
|
||||
|
||||
:opt-expr
|
||||
(if (empty? args) 0 (interpret (first args) init-value))
|
||||
(if (empty? args) nil (interpret (first args) init-value))
|
||||
|
||||
:expr
|
||||
(if (index-of "+-*/" (first args))
|
||||
|
@ -87,8 +86,9 @@
|
|||
(defn expr-eval
|
||||
[expr init-value]
|
||||
(s/assert string? expr)
|
||||
(s/assert number? init-value)
|
||||
(let [result (parser expr)]
|
||||
(let [result (parser expr)
|
||||
init-value (or init-value 0)]
|
||||
(s/assert number? init-value)
|
||||
(if-not (insta/failure? result)
|
||||
(interpret result init-value)
|
||||
(let [text (:text result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue