From 5f010ed3f98ffb82fe94c1a31f3338485dd3fbb7 Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 20 Mar 2025 13:55:28 -0400 Subject: Edit logic in main to error if passed file could not be opened. --- src/main.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.lisp b/src/main.lisp index 1f0afdd..98176ec 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -43,9 +43,11 @@ _/_/ _/_/ " ;; complain about num arguments ((/= (length args) 1) (error "Wrong number of arguments.")) ((not (util:asm-extension? file)) - (error "The file is not an asm source code file, or it could not be opened.")) + (error "The file is not an asm source code file.")) (t (let ((tokens (lex:file->tokens file))) - (format t "~a" tokens) + (if tokens + (format t "~a" tokens) + (error "The file does not exist, or it could not be opened.")) (format t "Nitimur in Vetitum~%")))))) -- cgit v1.2.3