aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-07-29 10:22:44 -0700
committercolin <colin@cicadas.surf>2023-07-29 10:22:44 -0700
commit9289f299cffe96f87483064e71c60fb7da0cb0ad (patch)
tree1fc0e672207f587bf4fb5a74d8fa052d3718f056 /examples
parente8dfcee463d771c21c513dea4af30c5c51a2525e (diff)
Add better grammar parsing for subexpressions
Diffstat (limited to 'examples')
-rw-r--r--examples/calc.lisp6
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/calc.lisp b/examples/calc.lisp
index 4d8766a..d3140ee 100644
--- a/examples/calc.lisp
+++ b/examples/calc.lisp
@@ -6,7 +6,7 @@
(in-package #:argot.examples.calc)
(deflanguage calc (:documentation "A calculator language")
- (<calc>
+ (<start>
:match (:or
(:seq <subexpr> (:eof))
(:seq <value> (:eof))
@@ -16,9 +16,7 @@
(<expr>
:match (:or <subexpr> <value> <unop> <binop>))
(<subexpr>
- :match (:item)
- :if listp
- :then (argot:parse calc <subexpr>))
+ :match (:{} calc))
(<value>
:match (:item)
:if numberp)