diff options
author | dos-reis <gdr@axiomatics.org> | 2012-08-20 10:46:46 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-08-20 10:46:46 +0000 |
commit | fc5f21dee871bb57e18ecd0818333a11eba76ed9 (patch) | |
tree | a4f51416dc111c71e31e8fce4a8df0722984b428 /src | |
parent | 49b79b4c722ebedc70c2a34b517649208e962447 (diff) | |
download | open-axiom-fc5f21dee871bb57e18ecd0818333a11eba76ed9.tar.gz |
* interp/spad.lisp (SPAD): Remove obfuscated binding of OUT-STREAM.
* interp/spad-parser.boot (paarseEcho): Use $OutputStream in lieu
of OUT-STREAM.
* interp/server.boot (serverReadLine): Do not bind IN-STEEAM and
*EOF*. Tidy.
* interp/lexing.boot (IN-TREAM): Remove definition.
(OUT-STREAM): Likewise.
* interp/int-top.boot (runspad): Do not bind IN-STREAM and *EOF*.
(SpadInterpretStream): Remove $shoeReadLineFunction binding.
* interp/debug.lisp: Replace IN-STREAM with $InputStream and
OUT-STREAM with $OutputStream.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 14 | ||||
-rw-r--r-- | src/interp/debug.lisp | 8 | ||||
-rw-r--r-- | src/interp/int-top.boot | 3 | ||||
-rw-r--r-- | src/interp/lexing.boot | 10 | ||||
-rw-r--r-- | src/interp/server.boot | 6 | ||||
-rw-r--r-- | src/interp/spad-parser.boot | 2 | ||||
-rw-r--r-- | src/interp/spad.lisp | 8 |
7 files changed, 26 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 43486cc5..02f1cfb1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,19 @@ 2012-08-20 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/spad.lisp (SPAD): Remove obfuscated binding of OUT-STREAM. + * interp/spad-parser.boot (paarseEcho): Use $OutputStream in lieu + of OUT-STREAM. + * interp/server.boot (serverReadLine): Do not bind IN-STEEAM and + *EOF*. Tidy. + * interp/lexing.boot (IN-TREAM): Remove definition. + (OUT-STREAM): Likewise. + * interp/int-top.boot (runspad): Do not bind IN-STREAM and *EOF*. + (SpadInterpretStream): Remove $shoeReadLineFunction binding. + * interp/debug.lisp: Replace IN-STREAM with $InputStream and + OUT-STREAM with $OutputStream. + +2012-08-20 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/Makefile.in: Simplify. 2012-08-20 Gabriel Dos Reis <gdr@cs.tamu.edu> diff --git a/src/interp/debug.lisp b/src/interp/debug.lisp index 2b3205ab..bb7351e9 100644 --- a/src/interp/debug.lisp +++ b/src/interp/debug.lisp @@ -1129,7 +1129,7 @@ EXAMINE (SETQ RECNO (NOTE |$InputStream|)) (defun SPAD_SYNTAX_ERROR (rd) "Print syntax error indication, underline character, scrub line." (BUMPERRORCOUNT '|syntax|) - (COND ((AND (EQ DEBUGMODE 'YES) (NOT(CONSOLEINPUTP IN-STREAM))) + (COND ((AND (EQ DEBUGMODE 'YES) (NOT(CONSOLEINPUTP |$InputStream|))) (SPAD_LONG_ERROR rd)) ((SPAD_SHORT_ERROR rd))) (|ioClear!| rd) @@ -1154,9 +1154,9 @@ EXAMINE (SETQ RECNO (NOTE |$InputStream|)) (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))) + (unless (EQUAL |$OutputStream| SPADERRORSTREAM) + (SPAD_ERROR_LOC |$OutputStream|) + (TERPRI |$OutputStream|))) (defun SPAD_SHORT_ERROR (rd) (|readerPrintCurrentLine| rd)) diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot index 407e26b1..df17fb36 100644 --- a/src/interp/int-top.boot +++ b/src/interp/int-top.boot @@ -85,8 +85,6 @@ runspad() == ncTopLevel() == -- Top-level read-parse-eval-print loop for the interpreter. Uses -- the Bill Burge's parser. - IN_-STREAM: local := $InputStream - _*EOF_*: local := nil $InteractiveMode: local := true $NEWSPAD: local := true $SPAD: local := true @@ -133,7 +131,6 @@ SpadInterpretStream(str, source, interactive?) == $ncMsgList : local := nil $systemCommandFunction : local := function InterpExecuteSpadSystemCommand - $shoeReadLineFunction : local := function serverReadLine $promptMsg : local := 'S2CTP023 interactive? => diff --git a/src/interp/lexing.boot b/src/interp/lexing.boot index d5917620..8652b96b 100644 --- a/src/interp/lexing.boot +++ b/src/interp/lexing.boot @@ -56,13 +56,7 @@ nextLine rd == nextLinesClear!() == $lineStack := nil -++ Current input stream. -IN_-STREAM := 'T - -++ Current output stream -OUT_-STREAM := 'T - -++ Advances IN-STREAM, invoking Next Line if necessary +++ Advances `rd', invoking nextLine if necessary advanceChar! rd == repeat not lineAtEnd? readerSourceLine rd => @@ -374,7 +368,7 @@ ungetTokens rd == coreError '"How many tokens do you think you have?" -++ Returns length of X if X matches initial segment of IN-STREAM. +++ Returns length of X if X matches initial segment of `rd'. ++ Otherwise, return nil. matchString(rd,x) == ungetTokens rd diff --git a/src/interp/server.boot b/src/interp/server.boot index 91bd59e3..6206169e 100644 --- a/src/interp/server.boot +++ b/src/interp/server.boot @@ -53,10 +53,8 @@ serverReadLine(stream) == line := readLine stream line ~= %nothing => line nil - IN_-STREAM: local := stream - _*EOF_*: local := nil line := - while not $EndServerSession and not _*EOF_* repeat + while not $EndServerSession and line ~= %nothing repeat if $NeedToSignalSessionManager then sockSendInt($SessionManager, $EndOfOutput) $NeedToSignalSessionManager := false @@ -64,7 +62,7 @@ serverReadLine(stream) == action = $CallInterp => l := readLine stream $NeedToSignalSessionManager := true - return l + leave l action = $CreateFrame => frameName := gensym('"frame") addNewInterpreterFrame(frameName) diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot index 92fe77f7..7ce0fb01 100644 --- a/src/interp/spad-parser.boot +++ b/src/interp/spad-parser.boot @@ -161,7 +161,7 @@ preparseReadLine1 rs == preparseEcho lines == if $Echo then for x in reverse lines repeat - formatToStream(OUT_-STREAM,'"~&;~A~%",x) + formatToStream($OutputStream,'"~&;~A~%",x) ++ The line to be worked on is the first in `lines. ++ It's indentation is the first in `locs'. diff --git a/src/interp/spad.lisp b/src/interp/spad.lisp index af99796c..d3c0bd3c 100644 --- a/src/interp/spad.lisp +++ b/src/interp/spad.lisp @@ -71,7 +71,7 @@ ($SPAD T) (OPTIONLIST nil) (|$editFile| ifile) - rd out-stream) + rd) (declare (special |$Echo| |$editFile| *comp370-apply*)) (setq |$InteractiveMode| nil) ;; only rebind |$InteractiveFrame| if compiling @@ -86,7 +86,6 @@ (setq rd (|makeReader| ifile |$OutputStream|)) (init-boot/spad-reader rd) (initialize-preparse rd) - (setq out-stream |$OutputStream|) (loop (if (|readerEoi?| rd) (return nil)) (catch |$SpadReaderTag| @@ -100,9 +99,8 @@ (|parseNewExpr| rd) (let ((parseout (|popStack1|)) ) (when parseout - (let ((|$OutputStream| out-stream)) - (|translateSpad| parseout)) - (format out-stream "~&"))) + (|translateSpad| parseout) + (format |$OutputStream| "~&"))) )))) (|ioClear!| rd))) T)) |