module-reader constructs proper source information, fix s-exp reader to use it
svn: r11769
This commit is contained in:
parent
d165c586af
commit
0b2f559e29
|
@ -5,4 +5,4 @@
|
||||||
(let* ([mod* (rd in)]
|
(let* ([mod* (rd in)]
|
||||||
[mod (if stx? (syntax->list mod*) mod*)]
|
[mod (if stx? (syntax->list mod*) mod*)]
|
||||||
[mod `(,(car mod) ,(cadr mod) ,@(cdddr mod))])
|
[mod `(,(car mod) ,(cadr mod) ,@(cdddr mod))])
|
||||||
(if stx? (datum->syntax mod* mod) mod))))
|
(if stx? (datum->syntax mod* mod mod*) mod))))
|
||||||
|
|
|
@ -74,6 +74,12 @@
|
||||||
[body (cond [(not wrapper) (body)]
|
[body (cond [(not wrapper) (body)]
|
||||||
[(procedure-arity-includes? wrapper 2) (wrapper body stx?)]
|
[(procedure-arity-includes? wrapper 2) (wrapper body stx?)]
|
||||||
[else (wrapper body)])]
|
[else (wrapper body)])]
|
||||||
|
[all-loc (vector src line col pos
|
||||||
|
(let-values ([(l c p) (port-next-location port)])
|
||||||
|
(and p (- p pos))))]
|
||||||
|
[body (if (and stx? (not (syntax? body)))
|
||||||
|
(datum->syntax #f body all-loc)
|
||||||
|
body)]
|
||||||
[p-name (object-name port)]
|
[p-name (object-name port)]
|
||||||
[name (if (path? p-name)
|
[name (if (path? p-name)
|
||||||
(let-values ([(base name dir?) (split-path p-name)])
|
(let-values ([(base name dir?) (split-path p-name)])
|
||||||
|
@ -89,7 +95,7 @@
|
||||||
v))]
|
v))]
|
||||||
[lib (if stx? (datum->syntax #f lib modpath modpath) lib)]
|
[lib (if stx? (datum->syntax #f lib modpath modpath) lib)]
|
||||||
[r `(,(tag-src 'module) ,(tag-src name) ,lib . ,body)])
|
[r `(,(tag-src 'module) ,(tag-src name) ,lib . ,body)])
|
||||||
(if stx? (datum->syntax #f r) r)))
|
(if stx? (datum->syntax #f r all-loc) r)))
|
||||||
|
|
||||||
(define (wrap lib port read modpath src line col pos)
|
(define (wrap lib port read modpath src line col pos)
|
||||||
(wrap-internal lib port read #f #f #f modpath src line col pos))
|
(wrap-internal lib port read #f #f #f modpath src line col pos))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user