diff options
-rw-r--r-- | argot.lisp | 8 | ||||
-rw-r--r-- | examples/calc.lisp | 10 |
2 files changed, 9 insertions, 9 deletions
@@ -76,19 +76,19 @@ and it returns VAR in that case." (and (nonterminal? lhs) (pattern? pattern))) (list lhs pattern (collect-vars pattern) nil nil)) - ((guard (list lhs :-> pattern :?? check) + ((guard (list lhs :-> pattern :if check) (and (nonterminal? lhs) (pattern? pattern))) (list lhs pattern (collect-vars pattern) check nil)) - ((guard (list lhs :-> pattern :=> action) + ((guard (list lhs :-> pattern :then action) (and (nonterminal? lhs) (pattern? pattern))) (list lhs pattern (collect-vars pattern) nil action)) - ((guard (list lhs :-> pattern :=> action :?? check) + ((guard (list lhs :-> pattern :then action :if check) (and (nonterminal? lhs) (pattern? pattern))) (list lhs pattern (collect-vars pattern) check action)) - ((guard (list lhs :-> pattern :?? check :=> action) + ((guard (list lhs :-> pattern :if check :then action) (and (nonterminal? lhs) (pattern? pattern))) (list lhs pattern (collect-vars pattern) check action))) (trivia::match-error () diff --git a/examples/calc.lisp b/examples/calc.lisp index 87993e8..7b2f9ef 100644 --- a/examples/calc.lisp +++ b/examples/calc.lisp @@ -11,15 +11,15 @@ (:seq <value> (:eof)) (:seq <unop> (:eof)) (:seq <binop> (:eof))) - :=> car) + :then car) (<expr> :-> (:or <subexpr> <value> <unop> <binop>)) (<subexpr> :-> (:item) - :?? listp - :=> (argot:parse calc <subexpr> )) - (<value> :-> (:item) :?? numberp) + :if listp + :then (argot:parse calc <subexpr>)) + (<value> :-> (:item) :if numberp) (<binop> :-> (:seq (:@ lhs <expr>) (:@ rhs (:+ (:seq (:or= + - / * ^ %) <expr>)))) - :=> (expand-binop lhs rhs)) + :then (expand-binop lhs rhs)) (<unop> :-> (:seq (:or= sin cos tan -) <expr>))) |