aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-05-11 20:39:20 +0000
committerdos-reis <gdr@axiomatics.org>2012-05-11 20:39:20 +0000
commit90e40ff963ffdca1272e393e2458d04040976096 (patch)
tree3e7614a99dbee9d384e082957ae75a44a1ce109f
parent0efd5f26be8d38a5eda78f9aa264c06015ee9e83 (diff)
downloadopen-axiom-90e40ff963ffdca1272e393e2458d04040976096.tar.gz
* interp/preparse.lisp (PARSEPRINT): Move to spad-parser.boot.
Rename as parsePrint.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/preparse.lisp6
-rw-r--r--src/interp/spad-parser.boot11
-rw-r--r--src/lisp/core.lisp.in9
4 files changed, 23 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e06fbc32..475ee3d0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2012-05-11 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/preparse.lisp (PARSEPRINT): Move to spad-parser.boot.
+ Rename as parsePrint.
+
+2012-05-11 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/preparse.lisp (ADD-PARENS-AND-SEMIS-TO-LINE): Move to
spad-parser.boot Rename as addParensAndSemisToLine.
(PARSEPILES): Move spad-parser.boot. Rename as parsePiles.
diff --git a/src/interp/preparse.lisp b/src/interp/preparse.lisp
index 5909ff5b..90083fcb 100644
--- a/src/interp/preparse.lisp
+++ b/src/interp/preparse.lisp
@@ -170,9 +170,3 @@
(|parsePiles| (|reverse!| LOCS) (|reverse!| LINES)))))
(GO READLOOP)))
-
-(defun PARSEPRINT (L)
- (if L
- (progn (format t "~&~% *** PREPARSE ***~%~%")
- (dolist (X L) (format t "~5d. ~a~%" (car x) (cdr x)))
- (format t "~%"))))
diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot
index 3ff71b04..54c6fa82 100644
--- a/src/interp/spad-parser.boot
+++ b/src/interp/spad-parser.boot
@@ -200,6 +200,14 @@ parsePiles(locs,lines) ==
addParensAndSemisToLine(x,y)
lines
+parsePrint l ==
+ $preparseReportIfTrue and l ~= nil =>
+ formatToStdout '"~&~% *** PREPARSE ***~%~%"
+ for x in l repeat
+ formatToStdout('"~5d. ~a~%",first x,rest x)
+ formatToStdout '"~%"
+ nil
+
preparse st ==
$COMBLOCKLIST := nil
$SKIPME := false
@@ -211,8 +219,7 @@ preparse st ==
$INDEX := $INDEX - #stack
u := preparse1 stack
$SKIPME => preparse st
- if $preparseReportIfTrue then
- PARSEPRINT u
+ parsePrint u
$headerDocumentation := nil
$docList := nil
$maxSignatureLineNumber := 0
diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in
index ac989be8..d793da9a 100644
--- a/src/lisp/core.lisp.in
+++ b/src/lisp/core.lisp.in
@@ -97,6 +97,8 @@
"deref"
;; IO
+ "$stdin"
+ "$stdout"
"$InputStream"
"$OutputStream"
"$ErrorStream"
@@ -114,6 +116,7 @@
"readIntegerIfCan"
"formatToString"
"formatToStream"
+ "formatToStdout"
;; compiler data structures
"%Mode"
@@ -526,6 +529,9 @@
;; -*- File IO -*-
+(defconstant |$stdout| *standard-output*)
+(defconstant |$stdin| *standard-input*)
+
(defparameter |$InputStream| (make-synonym-stream '*standard-input*))
(defparameter |$OutputStream| (make-synonym-stream '*standard-output*))
(defparameter |$ErrorStream| (make-synonym-stream '*standard-output*))
@@ -592,6 +598,9 @@
(defmacro |formatToStream| (&rest x)
`(format ,@x))
+(defmacro |formatToStdout| (&rest args)
+ `(format |$stdout| ,@args))
+
;;
;; -*- OpenAxiom filesystem -*-
;;