From e50d44464db7eb8e1c20755c862466ac8f7419b0 Mon Sep 17 00:00:00 2001 From: bd Date: Wed, 9 Apr 2025 23:45:16 -0400 Subject: Properly maintain a hashmap of labels, lots of minor code cleanups --- src/main.lisp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main.lisp') diff --git a/src/main.lisp b/src/main.lisp index 9180d57..be9f69a 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -1,6 +1,6 @@ (in-package #:rva) -(defparameter *banner* +(defvar *banner* " _/_/ _/_/ _/ _/ _/ _/ _/_/ _/ _/ _/_/_/ _/ @@ -30,7 +30,7 @@ _/_/ _/_/ " (print-splash) (let* ((args (clingon:command-arguments cmd)) (file (car args)) - (emit? (not (clingon:getopt cmd :parse)))) + (emit? (not (clingon:getopt cmd :parse)))) (cond ;; complain about num arguments ((/= (length args) 1) (error "Wrong number of arguments.~%")) @@ -38,8 +38,9 @@ _/_/ _/_/ " (error "The file is not an asm source code file.~%")) (t (let ((str (uiop:read-file-string file))) (if str - (progn (pprint (esrap:parse 'parse:text (string-upcase str))) + (progn (pprint (esrap:parse 'parse:text (string-upcase str))) (terpri) + (maphash #'(lambda (k v) (format t "~A => ~A~%" k v)) util:label-table) (format t "---~%")) (error "The file does not exist, or it could not be opened.~%")) (format t "Nitimur in Vetitum~%")))))) -- cgit v1.2.3