From 911e5868ab281a1fdb82b84b63aa35411933ceae Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 8 Aug 2023 07:23:02 -0700 Subject: changed :doc to :note in rule specs --- argot.lisp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'argot.lisp') diff --git a/argot.lisp b/argot.lisp index b52052e..e95fe3f 100644 --- a/argot.lisp +++ b/argot.lisp @@ -68,10 +68,10 @@ and it returns VAR in that case." (let ((pattern (getf options :match)) (check (getf options :if)) (action (getf options :then)) - (doc (getf options :doc))) + (note (getf options :note))) (unless (and (nonterminal? lhs) (pattern? pattern)) (error 'invalid-rule-def :rule ruledef)) - (list lhs pattern (collect-vars pattern) check action doc)))) + (list lhs pattern (collect-vars pattern) check action note)))) (defun function-form-p (s) @@ -104,13 +104,13 @@ and it returns VAR in that case." (let ,bindings (declare (ignorable ,lhs ,@vars)) ,action)))))) - (rule-includer (name lhs pattern &optional check action bindings vars doc) + (rule-includer (name lhs pattern &optional check action bindings vars note) `(include-rule (get ',name 'argot::grammar-property) (make-rule :lhs ',lhs :pattern ',pattern - :doc ,doc + :note ,note ,@(expand-functional-argument :check lhs bindings check vars) ,@(expand-functional-argument :action lhs bindings action vars))))) (let* ((parsed-rules @@ -118,9 +118,9 @@ and it returns VAR in that case." :collect (handler-case (parse-rule-def ruledef) (invalid-rule-def (e) (invoke-debugger e))))) (rule-adder-forms - (loop :for (lhs pattern vars check action doc) :in parsed-rules + (loop :for (lhs pattern vars check action note) :in parsed-rules :for bindings := (collect-let-bindings lhs vars) - :collect (rule-includer name lhs pattern check action bindings vars doc))) + :collect (rule-includer name lhs pattern check action bindings vars note))) (docstring (with-output-to-string (*standard-output*) (princ documentation) @@ -133,13 +133,12 @@ and it returns VAR in that case." (terpri) (princ "ADDITIONAL NOTES:") (terpri) - (loop :for (lhs _p _v _c _a doc) :in parsed-rules + (loop :for (lhs _p _v _c _a note) :in parsed-rules ;:for lhs-name := (symbol-name lhs) - :when doc + :when note :do (format *standard-output* "~15a ~a~%" lhs - ;(subseq lhs-name 1 (1- (length lhs-name))) - doc)) + note)) (princ "------------------------------------------") (terpri) (princ "KEY: ") (terpri) -- cgit v1.2.3