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:
parent
f7042d063a
commit
eff876671d
|
@ -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)]
|
||||||
|
|
|
@ -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)))))
|
||||||
|
|
|
@ -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")
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user