diff options
author | dos-reis <gdr@axiomatics.org> | 2012-06-10 22:40:43 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-06-10 22:40:43 +0000 |
commit | c38d92615d504612f6bfb15f75a2c9ff78ee9c71 (patch) | |
tree | 2323ef9553a1e85cbc1963a5634818ed4e7ab3fc /src/interp/spad-parser.boot | |
parent | d2331901fb45bb0e5c81776c02c8c1e0689827d4 (diff) | |
download | open-axiom-c38d92615d504612f6bfb15f75a2c9ff78ee9c71.tar.gz |
* interp/io.boot (%SourceLine): New.
(%LoadUnit): Likewise.
(readLoadUnitSource): Likewise.
(%Reader): Remove input stream field. Include load unit and next
lines fields. Adjust users.
Diffstat (limited to 'src/interp/spad-parser.boot')
-rw-r--r-- | src/interp/spad-parser.boot | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot index 71f2d60a..92fe77f7 100644 --- a/src/interp/spad-parser.boot +++ b/src/interp/spad-parser.boot @@ -61,7 +61,7 @@ $preparseReportIfTrue := false INITIALIZE_-PREPARSE rd == readerLineNumber(rd) := 0 - $preparseLastLine := readLine readerInput rd + $preparseLastLine := readerReadLine rd --% @@ -147,7 +147,7 @@ preparseReadLine1 rs == line := first lines readerPendingLines(rs) := rest lines else - line := expandLeadingTabs readLine readerInput rs + line := expandLeadingTabs readerReadLine rs $preparseLastLine := line not string? line => [readerLineNumber rs] readerLineNumber(rs) := readerLineNumber rs + 1 @@ -1063,7 +1063,6 @@ translateSpad x == ++ ??? finally use the new parser everwhere. parseSpadFile sourceFile == $SPAD: local := true -- we are parsing Spad, - _*EOF_*: local := false -- end of current input? FILE_-CLOSED : local := false -- current stream closed? try -- noise to standard output @@ -1074,18 +1073,13 @@ parseSpadFile sourceFile == $InteractiveMode: local := false -- we need to restore the global input stream state after we -- finished messing with it. - IN_-STREAM: local := MAKE_-INSTREAM sourceFile - rd := makeReader(IN_-STREAM,$OutputStream) + rd := makeReader(sourceFile,$OutputStream) INIT_-BOOT_/SPAD_-READER rd - - -- If soureFile cannot be processed for whatever reasons - -- get out of here instead of being stuck later. - readerInput rd = nil => systemError '"cannot open input source file" INITIALIZE_-PREPARSE rd -- gather parse trees for all toplevel expressions in sourceFile. asts := [] - while not eof? readerInput rd repeat + while not readerEoi? rd repeat $lineStack: local := preparse rd $lineStack = nil => leave nil -- explicit end of input LINE: local := CDAR $lineStack @@ -1095,7 +1089,6 @@ parseSpadFile sourceFile == reverse! asts finally -- clean up the mess, and get out of here ioClear! rd - SHUT readerInput rd --% |