aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-06-03 18:25:55 +0000
committerdos-reis <gdr@axiomatics.org>2012-06-03 18:25:55 +0000
commit3e1313d951e807417a344c5fda677b98dcb462c8 (patch)
tree1502cb035b5238858cebba0628553d64388e9abd /src
parent3e906e4a73ec71b8d48f00104c38cb8778b9e176 (diff)
downloadopen-axiom-3e1313d951e807417a344c5fda677b98dcb462c8.tar.gz
* interp/preparse.lisp ($LineList): Remove.
(INITIALIZE-PREPARSE): Do not set it. (preparse1): Do not reference it. Do not test for ioTerminal? and the input is always a disk file. * interp/spad-parser.boot (findCommentBlock): Do not reference $EchoLineStack. (preparseReadLine1): Do not reference $LineList.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/algebra/acplot.spad.pamphlet1
-rw-r--r--src/algebra/float.spad.pamphlet2
-rw-r--r--src/interp/preparse.lisp27
-rw-r--r--src/interp/spad-parser.boot11
5 files changed, 23 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bf2d7984..2b0225f3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
2012-06-03 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/preparse.lisp ($LineList): Remove.
+ (INITIALIZE-PREPARSE): Do not set it.
+ (preparse1): Do not reference it. Do not test for ioTerminal? and
+ the input is always a disk file.
+ * interp/spad-parser.boot (findCommentBlock): Do not reference
+ $EchoLineStack.
+ (preparseReadLine1): Do not reference $LineList.
+
+2012-06-03 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/io.boot (%Reader): New data structure.
* interp/preparse.lisp (INITIALIZE-PREPARSE): Parameter is now a
reader.
diff --git a/src/algebra/acplot.spad.pamphlet b/src/algebra/acplot.spad.pamphlet
index 9a33330a..c79f6798 100644
--- a/src/algebra/acplot.spad.pamphlet
+++ b/src/algebra/acplot.spad.pamphlet
@@ -83,7 +83,6 @@ import UnivariatePolynomial
import SparseUnivariatePolynomial
import Point
import List
---% PlaneAlgebraicCurvePlot
++ Plot a NON-SINGULAR plane algebraic curve p(x,y) = 0.
++ Author: Clifton J. Williamson
++ Date Created: Fall 1988
diff --git a/src/algebra/float.spad.pamphlet b/src/algebra/float.spad.pamphlet
index 7c5a74ae..1721a02d 100644
--- a/src/algebra/float.spad.pamphlet
+++ b/src/algebra/float.spad.pamphlet
@@ -116,8 +116,6 @@ N ==> NonNegativeInteger
++ \spad{*}, \spad{/}, \spad{sqrt}, \spad{pi}, \spad{exp1}, \spad{log2}, \spad{log10}: \spad{ O( n**2 )}
++ \spad{exp}, \spad{log}, \spad{sin}, \spad{atan}: \spad{ O( sqrt(n) n**2 )}
++ The other elementary functions are coded in terms of the ones above.
-
-
Float():
Join(FloatingPointSystem, DifferentialRing, ConvertibleTo String,_
CoercibleTo DoubleFloat, TranscendentalFunctionCategory, _
diff --git a/src/interp/preparse.lisp b/src/interp/preparse.lisp
index 175a3f7c..16eace23 100644
--- a/src/interp/preparse.lisp
+++ b/src/interp/preparse.lisp
@@ -66,21 +66,19 @@
(defparameter $INDEX 0 "File line number of most recently read line.")
(defparameter |$preparseLastLine| () "Most recently read line.")
(defparameter |$preparseReportIfTrue| NIL "Should we print listings?")
-(defparameter |$LineList| nil "Stack of preparsed lines.")
-(defparameter |$EchoLineStack| nil "Stack of lines to list.")
(defparameter $IOIndex 0 "Number of latest terminal input line.")
(DEFPARAMETER TOK NIL)
(DEFPARAMETER DEFINITION_NAME NIL)
(defun Initialize-Preparse (rd)
- (setq $INDEX 0 |$LineList| nil |$EchoLineStack| nil)
+ (setq $INDEX 0)
(setq |$preparseLastLine| (|readLine| (|readerInput| rd))))
(defvar $skipme)
(defun |preparse1| (rd)
- (PROG ((|$LineList| (|readerLines| rd)) |$EchoLineStack| NUM A I L PSLOC
+ (PROG (NUM A I L PSLOC
INSTRING PCOUNT COMSYM STRSYM OPARSYM CPARSYM N NCOMSYM
(SLOC -1) (CONTINUE NIL) (PARENLEV 0) (NCOMBLOCK ())
(LINES ()) (LOCS ()) (NUMS ()) functor )
@@ -97,7 +95,7 @@
(|preparseEcho| (|readerLines| rd))
(setq |$preparseLastLine| nil) ;don't reread this line
(SETQ LINE a)
- (CATCH 'SPAD_READER (|doSystemCommand| (subseq LINE 1)))
+ (CATCH |$SpadReaderTag| (|doSystemCommand| (subseq LINE 1)))
(GO READLOOP)))
(setq L (LENGTH A))
(if (EQ L 0)
@@ -129,10 +127,13 @@
(SETQ NCOMBLOCK NIL)))
(SETQ NCOMBLOCK (CONS N (CONS A (IFCDR NCOMBLOCK))))
(SETQ A ""))
- ('T (PUSH (STRCONC (|makeString| N #\Space)
- (SUBSTRING A N ())) |$LineList|)
- (SETQ $INDEX (1- $INDEX))
- (SETQ A (SUBSEQ A 0 N))))
+ ('T
+ (SETF (|readerLines| rd)
+ (CONS (STRCONC (|makeString| N #\Space)
+ (SUBSTRING A N ()))
+ (|readerLines| rd)))
+ (SETQ $INDEX (1- $INDEX))
+ (SETQ A (SUBSEQ A 0 N))))
(GO NOCOMS))
((= N OPARSYM) (setq PCOUNT (1+ PCOUNT)))
((= N CPARSYM) (setq PCOUNT (1- PCOUNT))))
@@ -158,9 +159,6 @@
(when (and LINES (EQL SLOC 0))
(IF (AND NCOMBLOCK (NOT (ZEROP (CAR NCOMBLOCK))))
(|findCommentBlock| NUM NUMS LOCS NCOMBLOCK (|readerLines| rd)))
- (IF (NOT (|ioTerminal?| (|readerInput| rd)))
- (setq |$preparseLastLine|
- (|reverse!| |$EchoLineStack|)))
(RETURN (|pairList| (|reverse!| NUMS)
(|parsePiles| (|reverse!| LOCS) (|reverse!| LINES)))))
(cond ((> PARENLEV 0)
@@ -175,9 +173,4 @@
(PUSH A LINES)
(PUSH NUM NUMS)
(setq PARENLEV (+ PARENLEV PCOUNT))
- (when (and (|ioTerminal?| (|readerInput| rd)) (not continue))
- (setq |$preparseLastLine| nil)
- (RETURN (|pairList| (|reverse!| NUMS)
- (|parsePiles| (|reverse!| LOCS) (|reverse!| LINES)))))
-
(GO READLOOP)))
diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot
index 56815de0..506affd9 100644
--- a/src/interp/spad-parser.boot
+++ b/src/interp/spad-parser.boot
@@ -110,10 +110,6 @@ findCommentBlock(n,oldnums,oldlocs,ncblock,lines) ==
x :=
[nc,:block] := ncblock
nc = 0 => [n - 1,:reverse block]
- if $EchoLineStack then
- [n,:$EchoLineStack] := $EchoLineStack
- preparseEcho lines
- $EchoLineStack := [n]
[or/[n for n in oldnums for l in oldlocs | integer? l and l <= nc],
:reverse block]
$COMBLOCKLIST := [x,:$COMBLOCKLIST]
@@ -133,15 +129,15 @@ preparseReadLine rs ==
z
preparseReadLine1 rs ==
- if $LineList then
- [line,:$LineList] := $LineList
+ if lines := readerLines rs then
+ line := first lines
+ readerLines(rs) := rest lines
else
line := expandLeadingTabs readLine readerInput rs
$preparseLastLine := line
not string? line => [$INDEX]
$INDEX := $INDEX + 1
line := trimTrailingBlank line
- $EchoLineStack := [copyString line,:$EchoLineStack]
n := $INDEX
if #line > 0 and line.maxIndex(line) = char "__" then
line := strconc(subString(line,0,maxIndex line),rest preparseReadLine1 rs)
@@ -152,7 +148,6 @@ preparseEcho lines ==
if $Echo then
for x in reverse lines repeat
formatToStream(OUT_-STREAM,'"~&;~A~%",x)
- $EchoLineStack := nil
++ The line to be worked on is the first in `lines.
++ It's indentation is the first in `locs'.