summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-11 00:22:57 -0400
committerbd <bdunahu@operationnull.com>2025-04-11 00:22:57 -0400
commit23d2ccc3e1b05a1ca0ff72317cc6da0773a0a9d1 (patch)
tree671782eeb8bb6b9fac661905ad80d8c53993c343
parent57bf0a940b3d1fdbe13684f545f0ce8707cdcd35 (diff)
Simplify newline rules
-rw-r--r--src/parse.lisp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/parse.lisp b/src/parse.lisp
index 8eca782..a3c9cbd 100644
--- a/src/parse.lisp
+++ b/src/parse.lisp
@@ -15,12 +15,6 @@
(esrap:defrule nl (+ eol)
(:constant nil))
-(esrap:defrule nl-inc (+ eol)
- (:lambda (n)
- (declare (ignore n))
- (incf line-number)
- nil))
-
(esrap:defrule sign (or #\+ #\-))
(esrap:defrule alpha (+ (alphanumericp character))
@@ -142,8 +136,9 @@ DESTRUCTURE-PATTERN is the list of non-terminals on the right side of the gramma
;;; defines rules to parse the .text segment
-(esrap:defrule instr-clean (and (esrap:? space) instr nl-inc)
- (:function cadr))
+(esrap:defrule instr-clean (and (esrap:? space) instr nl)
+ (:function cadr)
+ (:lambda (i) (incf line-number) i))
(esrap:defrule label-clean (and label-decl nl)
(:function car))