fix stop points of module-begin expansion (for contracts) in HtDP langauges
svn: r7736
This commit is contained in:
parent
8ff3e1383a
commit
1adc9702e8
|
@ -122,8 +122,8 @@
|
||||||
[_ (raise-syntax-error 'contract "internal error.5")])))
|
[_ (raise-syntax-error 'contract "internal error.5")])))
|
||||||
|
|
||||||
(define local-expand-stop-list
|
(define local-expand-stop-list
|
||||||
(list 'contract 'define-values 'define-syntaxes 'require 'require-for-syntax
|
(list 'contract 'define-values 'define-syntaxes '#%require
|
||||||
'provide 'define-data '#%app '#%datum 'define-struct 'begin 'begin0))
|
'#%provide 'define-data '#%app '#%datum 'define-struct 'begin 'begin0))
|
||||||
|
|
||||||
;; parse-contract-expressions
|
;; parse-contract-expressions
|
||||||
;; takes in a list of top level expressions and a list of contracts, and outputs the correct transformation.
|
;; takes in a list of top level expressions and a list of contracts, and outputs the correct transformation.
|
||||||
|
@ -221,8 +221,8 @@
|
||||||
(let ([e2 (local-expand #'e2 'module local-expand-stop-list)])
|
(let ([e2 (local-expand #'e2 'module local-expand-stop-list)])
|
||||||
;; Lift out certain forms to make them visible to the module
|
;; Lift out certain forms to make them visible to the module
|
||||||
;; expander:
|
;; expander:
|
||||||
(syntax-case e2 (require define-syntaxes define-values-for-syntax define-values begin)
|
(syntax-case e2 (#%require define-syntaxes define-values-for-syntax define-values begin)
|
||||||
[(require . __)
|
[(#%require . __)
|
||||||
#`(begin #,e2 (frm e1s e3s def-ids))]
|
#`(begin #,e2 (frm e1s e3s def-ids))]
|
||||||
[(define-syntaxes (id ...) . _)
|
[(define-syntaxes (id ...) . _)
|
||||||
#`(begin #,e2 (frm e1s e3s (id ... . def-ids)))]
|
#`(begin #,e2 (frm e1s e3s (id ... . def-ids)))]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user