From 178ae738887b64814aad3d13a2719926c3d83a71 Mon Sep 17 00:00:00 2001 From: schinz Date: Fri, 5 Dec 2003 09:32:56 +0000 Subject: - added a "fast" switch (not completely impleme... - added a "fast" switch (not completely implemented yet), - use "verbatim" for programs' output, instead of "lstlisting" (which is wrong) --- support/latex/scalatex.scm | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'support/latex') diff --git a/support/latex/scalatex.scm b/support/latex/scalatex.scm index b64e03bde8..7ba9aadbc5 100755 --- a/support/latex/scalatex.scm +++ b/support/latex/scalatex.scm @@ -25,6 +25,8 @@ ;; Diagnostics ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(define fast? #f) + (define verbose? #t) (define (message str . args) @@ -77,7 +79,7 @@ (open-output-file (scala-file-name name))) (define (close-scala-program name port) - (compile-scala-program name) + (unless fast? (compile-scala-program name)) (close-output-port port)) ;; Compiling and running Scala programs @@ -100,8 +102,13 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (begin-scala-code port) - (format port "\\begin{verbatim}\n")) + (format port "\\begin{lstlisting}\n")) (define (end-scala-code port) + (format port "\\end{lstlisting}\n")) + +(define (begin-program-output port) + (format port "\\begin{verbatim}\n")) +(define (end-program-output port) (format port "\\end{verbatim}\n")) (define (scala-rx contents) @@ -159,9 +166,11 @@ line) => (lambda (match) (let ((prog-name (match:substring match 1))) - (begin-scala-code out-port) - (append-scala-program-output prog-name out-port) - (end-scala-code out-port)) + (begin-program-output out-port) + (if fast? + (format out-port "!!! NO OUTPUT !!!") + (append-scala-program-output prog-name out-port)) + (end-program-output out-port)) (values prog-name prog-port #f in-fragment? copy?))) ;; Visible code fragment. @@ -194,12 +203,12 @@ copy?)))))) (define (display-usage-and-exit prog) - (format #t "Usage: ~a \n" prog)) + (format #t "Usage: ~a [--no-compile] \n" prog)) (define (main cmd-line) (let ((prog (car cmd-line)) (args (cdr cmd-line))) - (if (= 2 (length args)) + (if (>= 2 (length args)) (call-with-input-file (first args) (lambda (in-port) (call-with-output-file (second args) -- cgit v1.2.3