Closes FB case 173 Fix arrows in hyper-literate. I Used a module-like scope when nesting the whole module body to allow overriding build-ins, as DrRacket doesn't draw the arrows properly when a (make-syntax-introducer) is used.

This commit is contained in:
Georges Dupéron 2017-01-20 13:45:30 +01:00
parent 40068c6410
commit 835e565e0e
2 changed files with 17 additions and 10 deletions

View File

@ -11,7 +11,8 @@
"scribble-enhanced"
"sexp-diff"
"tr-immutable"
"typed-map-lib"))
"typed-map-lib"
"debug-scopes"))
(define build-deps '("scribble-lib"
"racket-doc"
"rackunit-doc"

View File

@ -9,7 +9,8 @@
syntax/strip-context
syntax/srcloc
racket/struct
syntax/srcloc))
syntax/srcloc
debug-scopes/named-scopes/exptime))
(begin-for-syntax
(define first-id #f)
@ -151,18 +152,23 @@
(define-syntax (continue stx)
(syntax-case stx ()
[(_self lang-module-begin . body)
(let ([expanded (local-expand
(datum->syntax stx
`(,#'lang-module-begin . ,#'body)
stx
stx)
'module-begin
(list))])
(let ()
(define expanded (local-expand
(datum->syntax stx
`(,#'lang-module-begin . ,#'body)
stx
stx)
'module-begin
(list)))
(define meta-language-nesting
;; Use a module-like scope here, instead of (make-syntax-introducer),
;; otherwise DrRacket stops drawing some arrows (why?).
(make-module-like-named-scope 'meta-language-nesting))
(syntax-case expanded (#%plain-module-begin)
[(#%plain-module-begin . expanded-body)
#`(begin
.
#,((make-syntax-introducer) #'expanded-body))]))]))
#,(meta-language-nesting #'expanded-body))]))]))
(define-for-syntax ((make-module-begin submod?) stx)
(syntax-parse stx