diff options
author | dos-reis <gdr@axiomatics.org> | 2012-06-03 17:03:18 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-06-03 17:03:18 +0000 |
commit | 3e906e4a73ec71b8d48f00104c38cb8778b9e176 (patch) | |
tree | 40d6555b4d7bfcb2bab5e3e3c8237751f7978b2e /src/interp/preparse.lisp | |
parent | d7eceebe0eb9cd7840f183dcaf294c85794b0db5 (diff) | |
download | open-axiom-3e906e4a73ec71b8d48f00104c38cb8778b9e176.tar.gz |
* interp/io.boot (%Reader): New data structure.
* interp/preparse.lisp (INITIALIZE-PREPARSE): Parameter is now a
reader.
(preparse1): Likewise. Tidy.
* interp/spad-parser.boot (preparseReadLine): Likewise.
(preparseReadLine1): Likewise.
(preparse): Likewise.
(parseSpadFile): Likewise.
* interp/spad.lisp (SPAD): Make it a unary function. Simplify.
(INITIALIZE): Remove.
Diffstat (limited to 'src/interp/preparse.lisp')
-rw-r--r-- | src/interp/preparse.lisp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/interp/preparse.lisp b/src/interp/preparse.lisp index f0edee7c..175a3f7c 100644 --- a/src/interp/preparse.lisp +++ b/src/interp/preparse.lisp @@ -73,20 +73,20 @@ (DEFPARAMETER TOK NIL) (DEFPARAMETER DEFINITION_NAME NIL) -(defun Initialize-Preparse (strm) +(defun Initialize-Preparse (rd) (setq $INDEX 0 |$LineList| nil |$EchoLineStack| nil) - (setq |$preparseLastLine| (|readLine| strm))) + (setq |$preparseLastLine| (|readLine| (|readerInput| rd)))) (defvar $skipme) -(defun |preparse1| (LineList) - (PROG ((|$LineList| LineList) |$EchoLineStack| NUM A I L PSLOC +(defun |preparse1| (rd) + (PROG ((|$LineList| (|readerLines| rd)) |$EchoLineStack| NUM A I L PSLOC INSTRING PCOUNT COMSYM STRSYM OPARSYM CPARSYM N NCOMSYM (SLOC -1) (CONTINUE NIL) (PARENLEV 0) (NCOMBLOCK ()) (LINES ()) (LOCS ()) (NUMS ()) functor ) - READLOOP (DCQ (NUM . A) (|preparseReadLine| LineList)) + READLOOP (DCQ (NUM . A) (|preparseReadLine| rd)) (cond ((|atEndOfUnit?| A) - (|preparseEcho| LineList) + (|preparseEcho| (|readerLines| rd)) (COND ((NULL LINES) (RETURN NIL)) (NCOMBLOCK (|findCommentBlock| NIL NUMS LOCS NCOMBLOCK NIL))) @@ -94,7 +94,7 @@ (|parsePiles| (|reverse!| LOCS) (|reverse!| LINES)))))) (cond ((and (NULL LINES) (> (LENGTH A) 0) (EQ (CHAR A 0) #\) )) ; this is a command line, don't parse it - (|preparseEcho| LineList) + (|preparseEcho| (|readerLines| rd)) (setq |$preparseLastLine| nil) ;don't reread this line (SETQ LINE a) (CATCH 'SPAD_READER (|doSystemCommand| (subseq LINE 1))) @@ -125,7 +125,7 @@ (COND ((= SLOC N) (COND ((AND NCOMBLOCK (NOT (= N (CAR NCOMBLOCK)))) - (|findCommentBlock| NUM NUMS LOCS NCOMBLOCK linelist) + (|findCommentBlock| NUM NUMS LOCS NCOMBLOCK (|readerLines| rd)) (SETQ NCOMBLOCK NIL))) (SETQ NCOMBLOCK (CONS N (CONS A (IFCDR NCOMBLOCK)))) (SETQ A "")) @@ -157,8 +157,8 @@ (setq $skipme nil)))) (when (and LINES (EQL SLOC 0)) (IF (AND NCOMBLOCK (NOT (ZEROP (CAR NCOMBLOCK)))) - (|findCommentBlock| NUM NUMS LOCS NCOMBLOCK linelist)) - (IF (NOT (|ioTerminal?| in-stream)) + (|findCommentBlock| NUM NUMS LOCS NCOMBLOCK (|readerLines| rd))) + (IF (NOT (|ioTerminal?| (|readerInput| rd))) (setq |$preparseLastLine| (|reverse!| |$EchoLineStack|))) (RETURN (|pairList| (|reverse!| NUMS) @@ -168,14 +168,14 @@ (setq SLOC PSLOC) (GO REREAD))) (COND (NCOMBLOCK - (|findCommentBlock| NUM NUMS LOCS NCOMBLOCK linelist) + (|findCommentBlock| NUM NUMS LOCS NCOMBLOCK (|readerLines| rd)) (setq NCOMBLOCK ()))) (PUSH SLOC LOCS) - REREAD (|preparseEcho| LineList) + REREAD (|preparseEcho| (|readerLines| rd)) (PUSH A LINES) (PUSH NUM NUMS) (setq PARENLEV (+ PARENLEV PCOUNT)) - (when (and (|ioTerminal?| in-stream) (not continue)) + (when (and (|ioTerminal?| (|readerInput| rd)) (not continue)) (setq |$preparseLastLine| nil) (RETURN (|pairList| (|reverse!| NUMS) (|parsePiles| (|reverse!| LOCS) (|reverse!| LINES))))) |