From d03a3c6cb297be5f5b7726c2f346075d41faad1d Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 7 Jun 2012 04:02:54 +0000 Subject: * interp/lexing.boot: Move %Line to io.boot. * interp/debug.lisp (SPAD_LONG_ERROR): Take a reader parameter. Tidy. --- src/interp/debug.lisp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/interp/debug.lisp') diff --git a/src/interp/debug.lisp b/src/interp/debug.lisp index e0231e65..2b3205ab 100644 --- a/src/interp/debug.lisp +++ b/src/interp/debug.lisp @@ -1130,19 +1130,36 @@ EXAMINE (SETQ RECNO (NOTE |$InputStream|)) "Print syntax error indication, underline character, scrub line." (BUMPERRORCOUNT '|syntax|) (COND ((AND (EQ DEBUGMODE 'YES) (NOT(CONSOLEINPUTP IN-STREAM))) - (SPAD_LONG_ERROR)) - ((SPAD_SHORT_ERROR))) + (SPAD_LONG_ERROR rd)) + ((SPAD_SHORT_ERROR rd))) (|ioClear!| rd) (throw |$SpadReaderTag| nil)) -(defun SPAD_LONG_ERROR () +(defun SPAD_LONG_ERROR (rd) (SPAD_ERROR_LOC SPADERRORSTREAM) - (iostat) + (|readerPrintCurrentLine| rd) + (and |$lineStack| (format t "Currently preparsed lines are:~%~%")) + (mapcar #'(lambda (line) + (format t "~&~5D> ~A~%" (car line) (cdr Line))) + |$lineStack|) + (if (= |$validTokens| 0) + (format t "~%There are no valid tokens.~%") + (format t "~%The number of valid tokens is ~S.~%" |$validTokens|)) + (if (> |$validTokens| 0) + (progn (format t "The current token is~%") + (describe |$currentToken|))) + (if (> |$validTokens| 1) + (progn (format t "The next token is~%") + (describe |$nextToken|))) + (if (|tokenType| |$priorToken|) + (progn (format t "The prior token was~%") + (describe |$priorToken|))) (unless (EQUAL OUT-STREAM SPADERRORSTREAM) (SPAD_ERROR_LOC OUT-STREAM) (TERPRI OUT-STREAM))) -(defun SPAD_SHORT_ERROR () (current-line-show)) +(defun SPAD_SHORT_ERROR (rd) + (|readerPrintCurrentLine| rd)) (defun SPAD_ERROR_LOC (STR) (format str "******** Spad Syntax Error detected ********")) -- cgit v1.2.3