syntax/parse docs: use trusted sandbox config
closes PR 12546
This commit is contained in:
parent
679b2d3872
commit
ed1ba3a442
|
@ -19,25 +19,27 @@
|
||||||
(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]
|
||||||
(list #f
|
[sandbox-propagate-breaks #f]
|
||||||
(lambda (thunk)
|
[sandbox-eval-handlers
|
||||||
(with-handlers ([exn:fail:syntax?
|
(list #f
|
||||||
(lambda (e) (raise (fixup e)))])
|
(lambda (thunk)
|
||||||
(thunk))))))
|
(with-handlers ([exn:fail:syntax?
|
||||||
(make-evaluator 'racket/base
|
(lambda (e) (raise (fixup e)))])
|
||||||
#:requires (let ([mods '(syntax/parse
|
(thunk))))])
|
||||||
syntax/parse/debug
|
(make-evaluator 'racket/base
|
||||||
syntax/parse/experimental/splicing
|
#:requires (let ([mods '(syntax/parse
|
||||||
syntax/parse/experimental/contract
|
syntax/parse/debug
|
||||||
syntax/parse/experimental/reflect
|
syntax/parse/experimental/splicing
|
||||||
syntax/parse/experimental/specialize
|
syntax/parse/experimental/contract
|
||||||
syntax/parse/experimental/eh)])
|
syntax/parse/experimental/reflect
|
||||||
`((for-syntax racket/base ,@mods)
|
syntax/parse/experimental/specialize
|
||||||
,@mods)))))
|
syntax/parse/experimental/eh)])
|
||||||
|
`((for-syntax racket/base ,@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 ...)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user