cleanup, tentatively annotating all top-level-vars
This commit is contained in:
parent
e88ec555bb
commit
d81a95ef26
|
@ -170,6 +170,9 @@ stepper-binding-type :
|
||||||
[ 'macro-bound ] : this variable's binding was inserted by a macro
|
[ 'macro-bound ] : this variable's binding was inserted by a macro
|
||||||
[ 'let-bound ] : this variable's binding was in a let/*/rec
|
[ 'let-bound ] : this variable's binding was in a let/*/rec
|
||||||
[ 'lambda-bound ] : this variable's binding was in a lambda
|
[ 'lambda-bound ] : this variable's binding was in a lambda
|
||||||
|
[ 'non-lexical ] : this variable's identifier-binding is not
|
||||||
|
'lexical (i.e., unbound, top-level, or a module binding
|
||||||
|
|
||||||
|
|
||||||
stepper-no-lifting-info :
|
stepper-no-lifting-info :
|
||||||
this label is applied to a let-bound-variable whose binding is not
|
this label is applied to a let-bound-variable whose binding is not
|
||||||
|
|
|
@ -105,7 +105,8 @@
|
||||||
; label-var-types returns a syntax object which is identical to the
|
; label-var-types returns a syntax object which is identical to the
|
||||||
; original except that the variable references are labeled with the
|
; original except that the variable references are labeled with the
|
||||||
; stepper-syntax-property 'stepper-binding-type, which is set to either
|
; stepper-syntax-property 'stepper-binding-type, which is set to either
|
||||||
; let-bound, lambda-bound, or non-lexical.
|
; let-bound, lambda-bound, or non-lexical. (It can also be 'macro-bound, set
|
||||||
|
; earlier during macro expansion.)
|
||||||
|
|
||||||
(define (top-level-rewrite stx)
|
(define (top-level-rewrite stx)
|
||||||
(let loop ([stx stx]
|
(let loop ([stx stx]
|
||||||
|
@ -811,21 +812,25 @@
|
||||||
[varref-no-break-wrap
|
[varref-no-break-wrap
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(outer-wcm-wrap (make-debug-info-normal free-varrefs) var))]
|
(outer-wcm-wrap (make-debug-info-normal free-varrefs) var))]
|
||||||
|
;; JBC: shouldn't this be the namespace of the user's code... ?
|
||||||
[base-namespace-symbols (namespace-mapped-symbols (make-base-namespace))]
|
[base-namespace-symbols (namespace-mapped-symbols (make-base-namespace))]
|
||||||
[top-level-varref-break-wrap
|
[module-bound-varref-break-wrap
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(if (or (memq (syntax-e var) beginner-defined:must-reduce)
|
(varref-break-wrap)
|
||||||
|
#;(if (or (memq (syntax-e var) beginner-defined:must-reduce)
|
||||||
(and (stepper-syntax-property var 'lazy-op)
|
(and (stepper-syntax-property var 'lazy-op)
|
||||||
(not (memq (syntax->datum var) base-namespace-symbols))))
|
(not (memq (syntax->datum var) base-namespace-symbols))))
|
||||||
(varref-break-wrap)
|
(varref-break-wrap)
|
||||||
(varref-no-break-wrap)))])
|
(varref-no-break-wrap)))])
|
||||||
(vector
|
(vector
|
||||||
(case (stepper-syntax-property var 'stepper-binding-type)
|
(match (stepper-syntax-property var 'stepper-binding-type)
|
||||||
((lambda-bound macro-bound) (varref-no-break-wrap))
|
[(or 'lambda-bound 'macro-bound) (varref-no-break-wrap)]
|
||||||
((let-bound) (varref-break-wrap))
|
['let-bound (varref-break-wrap)]
|
||||||
((non-lexical) ;; is it from this module or not?
|
['non-lexical ;; is it from this module or not?
|
||||||
(match (identifier-binding var)
|
(match (identifier-binding var)
|
||||||
(#f (top-level-varref-break-wrap))
|
;; this can only come up when stepping through non-module code...
|
||||||
|
;; perhaps we should just signal an error here.
|
||||||
|
(#f (varref-break-wrap))
|
||||||
['lexical
|
['lexical
|
||||||
;; my reading of the docs suggest that this should not occur in v4...
|
;; my reading of the docs suggest that this should not occur in v4...
|
||||||
(error 'varref-abstraction
|
(error 'varref-abstraction
|
||||||
|
@ -835,12 +840,17 @@
|
||||||
(module-path-index-split path-index)])
|
(module-path-index-split path-index)])
|
||||||
(if module-path
|
(if module-path
|
||||||
;; not a module-local variable:
|
;; not a module-local variable:
|
||||||
(top-level-varref-break-wrap)
|
(module-bound-varref-break-wrap)
|
||||||
;; a module-local-variable:
|
;; a module-local-variable:
|
||||||
(varref-break-wrap)))]
|
(varref-break-wrap)))]
|
||||||
[other (error
|
[other (error
|
||||||
'annotate
|
'annotate
|
||||||
"unexpected value for identifier-binding: ~v" other)])))
|
"unexpected value for identifier-binding: ~v" other)])]
|
||||||
|
[other
|
||||||
|
(error 'annotate
|
||||||
|
"unexpected value for stepper-binding-type on variable ~e: ~e"
|
||||||
|
(syntax->datum var)
|
||||||
|
other)])
|
||||||
free-varrefs)))
|
free-varrefs)))
|
||||||
|
|
||||||
(define (recertifier vals)
|
(define (recertifier vals)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user