From fbfa64ec69870d424d3f94bd87380efe565b64b5 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 29 Jul 2023 08:52:37 -0700 Subject: change language for rule def --- argot.lisp | 8 ++++---- examples/calc.lisp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/argot.lisp b/argot.lisp index e82ef95..99da9bd 100644 --- a/argot.lisp +++ b/argot.lisp @@ -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 (:eof)) (:seq (:eof)) (:seq (:eof))) - :=> car) + :then car) ( :-> (:or )) ( :-> (:item) - :?? listp - :=> (argot:parse calc )) - ( :-> (:item) :?? numberp) + :if listp + :then (argot:parse calc )) + ( :-> (:item) :if numberp) ( :-> (:seq (:@ lhs ) (:@ rhs (:+ (:seq (:or= + - / * ^ %) )))) - :=> (expand-binop lhs rhs)) + :then (expand-binop lhs rhs)) ( :-> (:seq (:or= sin cos tan -) ))) -- cgit v1.2.3