Maintain source locations appropriately.
svn: r18422
This commit is contained in:
parent
65b12a2af3
commit
f37f81cdb2
|
@ -9,6 +9,7 @@
|
|||
syntax/parse
|
||||
syntax/struct
|
||||
syntax/stx
|
||||
unstable/location
|
||||
"private/unit-contract-syntax.ss"
|
||||
"private/unit-compiletime.ss"
|
||||
"private/unit-syntax.ss"))
|
||||
|
@ -483,7 +484,7 @@
|
|||
(if (pair? v/c)
|
||||
(contract (let-syntax #,renamings ctc-stx) (car v/c) (cdr v/c)
|
||||
(current-contract-region)
|
||||
(quote #,var) (quote-syntax #,var))
|
||||
(quote #,var) (quote-srcloc #,var))
|
||||
(error 'unit "contracted import ~a used before definition"
|
||||
(quote #,(syntax->datum var))))))))
|
||||
(quasisyntax/loc (error-syntax)
|
||||
|
@ -749,7 +750,7 @@
|
|||
(current-contract-region)
|
||||
'cant-happen
|
||||
(quote #,id)
|
||||
(quote-syntax #,id))
|
||||
(quote-srcloc #,id))
|
||||
(set-box! #,export-loc
|
||||
(cons #,tmp (current-contract-region)))))
|
||||
(quasisyntax/loc defn-or-expr
|
||||
|
@ -826,7 +827,7 @@
|
|||
#`(let ([old-v/c (#,vref)])
|
||||
(contract ctc-stx (car old-v/c)
|
||||
(cdr old-v/c) (current-contract-region)
|
||||
(quote #,var) (quote-syntax #,var)))
|
||||
(quote #,var) (quote-srcloc #,var)))
|
||||
#`(#,vref))
|
||||
(current-contract-region)))
|
||||
(if ctc
|
||||
|
@ -834,7 +835,7 @@
|
|||
(let ([old-v/c (#,vref)])
|
||||
(contract ctc-stx (car old-v/c)
|
||||
(cdr old-v/c) (current-contract-region)
|
||||
(quote #,var) (quote-syntax #,var))))
|
||||
(quote #,var) (quote-srcloc #,var))))
|
||||
vref)))))
|
||||
(car target-sig)
|
||||
(cadddr target-sig)))
|
||||
|
@ -1305,7 +1306,7 @@
|
|||
#`(let ([v/c (#,tb)])
|
||||
(contract ctc-stx (car v/c) (cdr v/c)
|
||||
(current-contract-region)
|
||||
(quote #,v) (quote-syntax #,v))))
|
||||
(quote #,v) (quote-srcloc #,v))))
|
||||
#`(#,tb)))
|
||||
tbs
|
||||
(iota (length (car os)))
|
||||
|
@ -1508,7 +1509,7 @@
|
|||
(export (export-tagged-sig-id [e.x e.c] ...) ...))))])
|
||||
(values
|
||||
(syntax/loc stx
|
||||
(contract unit-contract new-unit '(unit name) (current-contract-region) (quote name) (quote-syntax name)))
|
||||
(contract unit-contract new-unit '(unit name) (current-contract-region) (quote name) (quote-srcloc name)))
|
||||
isigs esigs deps))))]
|
||||
[(ic:import-clause/contract ec:export-clause/contract . body)
|
||||
(build-unit/contract
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
pos-module-source
|
||||
(quote-module-path)
|
||||
'external-id
|
||||
(quote-syntax id))))))])
|
||||
(quote-srcloc id))))))])
|
||||
(when key
|
||||
(hash-set! saved-id-table key lifted-id))
|
||||
;; Expand to a use of the lifted expression:
|
||||
|
@ -664,7 +664,7 @@
|
|||
(syntax-local-lift-module-end-declaration
|
||||
#`(begin
|
||||
(unless extra-test
|
||||
(contract contract-id id pos-module-source 'ignored 'id (quote-syntax id)))
|
||||
(contract contract-id id pos-module-source 'ignored 'id (quote-srcloc id)))
|
||||
(void)))
|
||||
|
||||
(syntax (code id-rename))))))]))
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
(prefix-in a: "private/helpers.ss"))
|
||||
scheme/splicing
|
||||
scheme/stxparam
|
||||
unstable/location
|
||||
"private/arrow.ss"
|
||||
"private/base.ss"
|
||||
"private/guts.ss")
|
||||
|
@ -311,7 +312,7 @@
|
|||
'(struct name)
|
||||
'cant-happen
|
||||
(quote #,av-id)
|
||||
(quote-syntax #,av-id)))))]
|
||||
(quote-srcloc #,av-id)))))]
|
||||
;; a list of variables, one for each super field
|
||||
[(super-fields ...) (generate-temporaries super-fields)]
|
||||
;; the contract for a super field is any/c becuase the
|
||||
|
@ -343,7 +344,7 @@
|
|||
guard
|
||||
(current-contract-region) blame-id
|
||||
(quote maker)
|
||||
(quote-syntax maker))))))))))]
|
||||
(quote-srcloc maker))))))))))]
|
||||
[(_ name . bad-fields)
|
||||
(identifier? #'name)
|
||||
(syntax-error "expected a list of field name/contract pairs"
|
||||
|
@ -380,15 +381,15 @@
|
|||
(syntax-case stx (set!)
|
||||
[(set! i arg)
|
||||
(quasisyntax/loc stx
|
||||
(set! id (contract ctc arg neg pos (quote id) (quote-syntax id))))]
|
||||
(set! id (contract ctc arg neg pos (quote id) (quote-srcloc id))))]
|
||||
[(f arg ...)
|
||||
(quasisyntax/loc stx
|
||||
((contract ctc id pos neg (quote id) (quote-syntax id))
|
||||
((contract ctc id pos neg (quote id) (quote-srcloc id))
|
||||
arg ...))]
|
||||
[ident
|
||||
(identifier? (syntax ident))
|
||||
(quasisyntax/loc stx
|
||||
(contract ctc id pos neg (quote id) (quote-syntax id)))])))))
|
||||
(contract ctc id pos neg (quote id) (quote-srcloc id)))])))))
|
||||
|
||||
(define-syntax (with-contract-helper stx)
|
||||
(syntax-case stx ()
|
||||
|
@ -511,7 +512,7 @@
|
|||
blame-id
|
||||
'cant-happen
|
||||
(quote free-var)
|
||||
(quote-syntax free-var))
|
||||
(quote-srcloc free-var))
|
||||
...
|
||||
(values)))
|
||||
(define-syntaxes (free-var-id ...)
|
||||
|
@ -576,7 +577,7 @@
|
|||
blame-id
|
||||
'cant-happen
|
||||
(quote free-var)
|
||||
(quote-syntax free-var))
|
||||
(quote-srcloc free-var))
|
||||
...
|
||||
(values)))
|
||||
(define-syntaxes (free-var-id ...)
|
||||
|
@ -594,7 +595,7 @@
|
|||
blame-stx
|
||||
'cant-happen
|
||||
(quote marked-p)
|
||||
(quote-syntax marked-p))
|
||||
(quote-srcloc marked-p))
|
||||
...
|
||||
(values)))
|
||||
(define-syntaxes (p ...)
|
||||
|
|
Loading…
Reference in New Issue
Block a user