aboutsummaryrefslogtreecommitdiff
path: root/argot.lisp
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-08-08 07:23:02 -0700
committercolin <colin@cicadas.surf>2023-08-08 07:23:02 -0700
commit911e5868ab281a1fdb82b84b63aa35411933ceae (patch)
treeab6495673f1efdeaa597b78cfd74b946b2402c02 /argot.lisp
parent0f42ae0e6d61e344e10604bc9b82f033fcdb91c9 (diff)
changed :doc to :note in rule specs
Diffstat (limited to 'argot.lisp')
-rw-r--r--argot.lisp19
1 files changed, 9 insertions, 10 deletions
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)