aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/calc.lisp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/calc.lisp b/examples/calc.lisp
index 14b03e5..87993e8 100644
--- a/examples/calc.lisp
+++ b/examples/calc.lisp
@@ -7,11 +7,15 @@
(deflanguage calc (:documentation "A calculator language")
(<calc> :-> (:or
+ (:seq <subexpr> (:eof))
(:seq <value> (:eof))
(:seq <unop> (:eof))
(:seq <binop> (:eof)))
:=> car)
- (<expr> :-> (:or <value> <unop> <binop>))
+ (<expr> :-> (:or <subexpr> <value> <unop> <binop>))
+ (<subexpr> :-> (:item)
+ :?? listp
+ :=> (argot:parse calc <subexpr> ))
(<value> :-> (:item) :?? numberp)
(<binop> :-> (:seq (:@ lhs <expr>)
(:@ rhs (:+ (:seq (:or= + - / * ^ %) <expr>))))