diff --git a/books/bookvol9.pamphlet b/books/bookvol9.pamphlet index 5aadbca..ad6b13e 100644 --- a/books/bookvol9.pamphlet +++ b/books/bookvol9.pamphlet @@ -1209,6 +1209,71 @@ REREAD @ +\defun{preparseReadLine}{preparseReadLine} +\calls{preparseReadLine}{dcq} +\calls{preparseReadLine}{preparseReadLine1} +\calls{preparseReadLine}{initial-substring} +\calls{preparseReadLine}{string2BootTree} +\calls{preparseReadLine}{storeblanks} +\calls{preparseReadLine}{skip-to-endif} +\calls{preparseReadLine}{preparseReadLine} +<>= +(defun preparseReadLine (x) + (let (line ind) + (dcq (ind . line) (preparseReadLine1 x)) + (cond + ((not (stringp line)) (cons ind line)) + ((zerop (size line)) (cons ind line)) + ((char= (elt line 0) #\) ) + (cond + ((initial-substring ")if" line) + (if (eval (|string2BootTree| (storeblanks line 3))) + (preparseReadLine X) + (skip-ifblock x))) + ((initial-substring ")elseif" line) (skip-to-endif x)) + ((initial-substring ")else" line) (skip-to-endif x)) + ((initial-substring ")endif" line) (preparseReadLine x)) + ((initial-substring ")fin" line) + (setq *eof* t) + (cons ind nil)))) + (t (cons ind line))))) + +@ + +\defun{preparseReadLine1}{preparseReadLine1} +\calls{preparseReadLine1}{get-a-line} +\calls{preparseReadLine1}{expand-tabs} +\calls{preparseReadLine1}{droptrailingblanks} +\calls{preparseReadLine1}{maxindex} +\calls{preparseReadLine1}{strconc} +\calls{preparseReadLine1}{preparseReadLine1} +\usesdollar{preparseReadLine1}{linelist} +\usesdollar{preparseReadLine1}{preparse-last-line} +\usesdollar{preparseReadLine1}{index} +\usesdollar{preparseReadLine1}{EchoLineStack} +<>= +(defun preparseReadLine1 (x) + (let (line ind) + (declare (special $linelist $preparse-last-line $index $EchoLineStack)) + (setq line + (if $linelist + (pop $linelist) + (expand-tabs (get-a-line in-stream)))) + (setq $preparse-last-line line) + (if (stringp line) + (progn + (incf $index) + (setq line (droptrailingblanks line)) + (push (copy-seq line) $EchoLineStack) + (cons $index + (if (and (> (setq ind (maxindex line)) -1) (char= (elt line ind) #\_)) + (setq $preparse-last-line + (strconc (substring line 0 ind) (cdr (preparseReadLine1 x)))) + line))) + (cons $index line)))) + +@ + \chapter{The Compiler} \section{Compiling EQ.spad} @@ -4321,6 +4386,8 @@ if \verb|$InteractiveMode| then use a null outputstream <> <> +<> +<> <> <> diff --git a/changelog b/changelog index 12f813e..2406dc5 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20101001 tpd src/axiom-website/patches.html 20101001.02.tpd.patch +20101001 tpd src/interp/parsing.lisp treeshake compiler +20101001 tpd books/bookvol9 treeshake compiler 20101001 tpd src/axiom-website/patches.html 20101001.01.tpd.patch 20101001 tpd src/interp/parsing.lisp cleanup and reformat 20100930 tpd src/axiom-website/patches.html 20100930.02.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 7c2e4ed..70211a3 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -3174,5 +3174,7 @@ books/bookvolbib add Jenks [Jen69]
books/bookvol9.pamphlet treeshake compiler
20101001.01.tpd.patch src/interp/parsing.lisp cleanup and reformat
+20101001.02.tpd.patch +books/bookvol9 treeshake compiler
diff --git a/src/interp/parsing.lisp.pamphlet b/src/interp/parsing.lisp.pamphlet index 687d322..6b1d2ff 100644 --- a/src/interp/parsing.lisp.pamphlet +++ b/src/interp/parsing.lisp.pamphlet @@ -3346,28 +3346,6 @@ preparse ( 'T LINE ) ))) ) ) -;;(defun preparseReadLine (X) -;; (declare (special $LINELIST $echoLineStack)) -;; (PROG (LINE IND) -;; (setq LINE -;; (if $LINELIST -;; (pop $LINELIST) -;; (get-a-line in-stream))) -;; (setq $preparse-last-line LINE) -;; (and (stringp line) (incf $INDEX)) -;; (if (NOT (STRINGP LINE)) (RETURN (CONS $INDEX LINE))) -;; (setq LINE (DROPTRAILINGBLANKS LINE)) -;; (if Echo-Meta (PUSH (COPY-SEQ LINE) $EchoLineStack)) -;; ; next line must evaluate $INDEX before recursive call -;; (RETURN -;; (CONS $INDEX -;; (if (and (> (setq IND (MAXINDEX LINE)) -1) -;; (EQ (ELT LINE IND) #\_)) -;; (setq $preparse-last-line -;; (STRCONC (SUBSEQ LINE 0 IND) -;; (CDR (preparseReadLine X)))) -;; LINE))))) - (defun PREPARSE-ECHO (linelist) (if Echo-Meta (REPEAT (IN X (REVERSE $EchoLineStack)) (format out-stream "~&;~A~%" X)))