forgot to change mztext to use a plain namespace too; made evaluations use read-syntax for general karma

svn: r8816
This commit is contained in:
Eli Barzilay 2008-02-27 14:31:14 +00:00
parent f7042d063a
commit eff876671d
5 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@
#:multi #:multi
[("-E" "--eval") expr "evaluates <expr> before processing starts" [("-E" "--eval") expr "evaluates <expr> before processing starts"
(parameterize ([read-case-sensitive #t]) (parameterize ([read-case-sensitive #t])
(add-eval (read (open-input-string expr))))] (add-eval (read-syntax 'command-line (open-input-string expr))))]
#:once-each #:once-each
[("--debug") "show preprocessed Scheme code (for debugging)" [("--debug") "show preprocessed Scheme code (for debugging)"
(debug? #t)] (debug? #t)]

View File

@ -124,7 +124,7 @@
(define (pp-repl) (define (pp-repl)
(let loop () (let loop ()
(let ([x (read)]) (let ([x (read-syntax)])
(unless (eof-object? x) (unless (eof-object? x)
(call-with-values (lambda () (eval x)) show) (call-with-values (lambda () (eval x)) show)
(loop))))) (loop)))))

View File

@ -15,7 +15,7 @@
#:multi #:multi
[("-E" "--eval") expr "evaluates <expr> before processing starts" [("-E" "--eval") expr "evaluates <expr> before processing starts"
(parameterize ([read-case-sensitive #t]) (parameterize ([read-case-sensitive #t])
(add-eval (read (open-input-string expr))))] (add-eval (read-syntax 'command-line (open-input-string expr) )))]
#:handlers #:handlers
(lambda (_ . files) (run preprocess run-cmd output files)) (lambda (_ . files) (run preprocess run-cmd output files))
'("input-file") '("input-file")

View File

@ -187,7 +187,7 @@
(value->cont vs cont)))))) (value->cont vs cont))))))
(cond [(regexp-try-match (command-marker-here-re) (stdin)) (cond [(regexp-try-match (command-marker-here-re) (stdin))
=> (lambda (here) (display (car here)) (cont))] => (lambda (here) (display (car here)) (cont))]
[else (let ((r (read))) (do-thunk (lambda () (eval r))))])) [else (let ((r (read-syntax))) (do-thunk (lambda () (eval r))))]))
(provide paren-pairs) (provide paren-pairs)
(define paren-pairs (define paren-pairs
@ -305,12 +305,11 @@
;;============================================================================= ;;=============================================================================
;; Invocation ;; Invocation
(define-namespace-anchor nsa)
(define (initialize) (define (initialize)
(read-case-sensitive #t) (read-case-sensitive #t)
(unless (command-marker) (command-marker "@")) (unless (command-marker) (command-marker "@"))
(current-namespace (namespace-anchor->namespace nsa)) (namespace-require 'scheme/base)
(namespace-require 'preprocessor/mztext)
(do-evals)) (do-evals))
(define (run) (define (run)

View File

@ -49,7 +49,8 @@
(delete-file file) (delete-file file)
(rename-file-or-directory temp file))))] (rename-file-or-directory temp file))))]
[output [output
(with-output-to-file output (lambda () (apply preprocess files)) #:exists 'replace) (with-output-to-file output #:exists 'replace
(lambda () (apply preprocess files)))
(when run-cmd (do-run-subst output))] (when run-cmd (do-run-subst output))]
[else (apply preprocess files)]) [else (apply preprocess files)])
(exit exit-code))) (exit exit-code)))