summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-11 03:32:24 -0400
committerbd <bdunahu@operationnull.com>2025-04-11 03:32:24 -0400
commit1904e4e800dcf37becb3bba17c3a3aaca3c7a47c (patch)
treed639d0d37216071462c008345d361358db24b171 /src
parent1161354f5dbb9648f90edb3ffb16dc9daad7d966 (diff)
Add a few new test files
Diffstat (limited to 'src')
-rw-r--r--src/main.lisp2
-rw-r--r--src/parse.lisp10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/main.lisp b/src/main.lisp
index 517d395..f1f3021 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -65,7 +65,7 @@ _/_/ _/_/ "
(let ((words (emit:emit ast)))
(if write?
(postprocess words file)
- (format t "Emission successfull, got: ~%~a~%" words)))
+ (format t "Emission successful, got: ~%~a~%" words)))
(format t "Parse successful, got:~%~a~%" (emit:ast->str ast))))
(error "The file does not exist, or it could not be opened.~%")))))))
diff --git a/src/parse.lisp b/src/parse.lisp
index 2e1cf55..f435c0a 100644
--- a/src/parse.lisp
+++ b/src/parse.lisp
@@ -51,14 +51,14 @@
(esrap:defrule variable alphanumeric
(:lambda (e) (list 'emit::var e)))
-(esrap:defrule dereference (and integer #\( register #\))
- (:destructure (i1 w1 r w2)
- (declare (ignore w1 w2))
- (list r (list 'emit::imm i1))))
-
(esrap:defrule immediate (or integer variable)
(:lambda (e) (list 'emit::imm e)))
+(esrap:defrule dereference (and immediate #\( register #\))
+ (:destructure (i1 w1 r w2)
+ (declare (ignore w1 w2))
+ (list r i1)))
+
;;; defines rules to parse labels
(esrap:defrule label alphanumeric