aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-07-19 06:58:45 -0700
committercolin <colin@cicadas.surf>2023-07-19 06:58:45 -0700
commit726468c883e75b883a440216e2fd0742f357615a (patch)
treebc81993c855868c0fa2f48c7758110face57df3a
parentfbe7ae96e394e87e0dfa890e7419064ef3525cfc (diff)
Change: adding whole rule match to bindings for action application
-rw-r--r--argot.lisp3
1 files changed, 2 insertions, 1 deletions
diff --git a/argot.lisp b/argot.lisp
index 2d72866..f86ce22 100644
--- a/argot.lisp
+++ b/argot.lisp
@@ -225,7 +225,8 @@ any pattern fails the whole parse fails."
(let ((*bindings* nil))
(try-parse (result) (parse-pattern (rule-pattern rule))
(if (rule-action rule)
- (succeed (funcall (rule-action rule) *bindings*))
+ (succeed (funcall (rule-action rule)
+ (acons nonterminal result *bindings*)))
(succeed result))))
(fail)))