syntax/parse docs: use trusted sandbox config

closes PR 12546
This commit is contained in:
Ryan Culpepper 2012-02-07 13:39:10 -07:00
parent 679b2d3872
commit ed1ba3a442

View File

@ -19,15 +19,17 @@
(exn:fail:syntax-exprs exn)) (exn:fail:syntax-exprs exn))
exn))) exn)))
(define the-eval (define the-eval
(parameterize ((sandbox-output 'string) (call-with-trusted-sandbox-configuration
(sandbox-error-output 'string) (lambda ()
(sandbox-make-code-inspector current-code-inspector) (parameterize ([sandbox-output 'string]
(sandbox-eval-handlers [sandbox-error-output 'string]
[sandbox-propagate-breaks #f]
[sandbox-eval-handlers
(list #f (list #f
(lambda (thunk) (lambda (thunk)
(with-handlers ([exn:fail:syntax? (with-handlers ([exn:fail:syntax?
(lambda (e) (raise (fixup e)))]) (lambda (e) (raise (fixup e)))])
(thunk)))))) (thunk))))])
(make-evaluator 'racket/base (make-evaluator 'racket/base
#:requires (let ([mods '(syntax/parse #:requires (let ([mods '(syntax/parse
syntax/parse/debug syntax/parse/debug
@ -37,7 +39,7 @@
syntax/parse/experimental/specialize syntax/parse/experimental/specialize
syntax/parse/experimental/eh)]) syntax/parse/experimental/eh)])
`((for-syntax racket/base ,@mods) `((for-syntax racket/base ,@mods)
,@mods))))) ,@mods)))))))
(the-eval '(error-print-source-location #f)) (the-eval '(error-print-source-location #f))
(define-syntax-rule (myexamples e ...) (define-syntax-rule (myexamples e ...)