scribble/eval: change string or byte-string expression handling

Use `datum->syntax' instead of `begin' to protect the string or byte
string. Danny Yoo suggested this change.
This commit is contained in:
Matthew Flatt 2012-05-01 14:47:44 -06:00
parent e04b74f22a
commit 23296615ec

View File

@ -372,8 +372,10 @@
(syntax-case s (module)
[(module . _rest) (syntax->datum s)]
[_else s])]
[(bytes? s) `(begin ,s)]
[(string? s) `(begin ,s)]
;; a sandbox treats strings and byte strings as code
;; streams, so protect them as syntax objects:
[(string? s) (datum->syntax #f s)]
[(bytes? s) (datum->syntax #f s)]
[else s]))))
list)))