Skip to content

Commit 3064ae4

Browse files
committed
correct the 'is this varref deeper than its binding?' predicate
1 parent 8ea39ea commit 3064ae4

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

drracket-tool-test/tests/check-syntax/syncheck-direct.rkt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,36 @@
453453
'((28 39) (50 50))))
454454

455455

456+
(check-equal?
457+
(get-binding-arrows
458+
(string-append
459+
"#lang racket/base\n"
460+
"(module m racket/base\n"
461+
" (define lam 1)\n"
462+
" (provide lam)\n"
463+
" lam)\n"))
464+
(set '((6 17) (19 25))
465+
'((28 39) (43 49))
466+
'((28 39) (54 54))
467+
'((28 39) (60 67))
468+
'((50 53) (75 78))
469+
'((50 53) (68 71))))
470+
471+
(check-equal?
472+
(get-binding-arrows
473+
(string-append
474+
"#lang racket/base\n"
475+
"(module m racket/base\n"
476+
" (define lam 1)\n"
477+
" (module+ n (provide lam)))\n"))
478+
(set '((6 17) (19 25))
479+
'((28 39) (43 49))
480+
'((28 39) (54 54))
481+
'((28 39) (60 67))
482+
'((28 39) (71 78))
483+
'((50 53) (79 82))))
484+
485+
456486

457487
;
458488
;

drracket-tool-text-lib/drracket/private/syncheck/traversals.rkt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -919,12 +919,13 @@
919919
(let loop ([mods-where-var-is (reverse mods-where-var-is)]
920920
[mods-where-binder-is (reverse (binder+mods-mods binder+mods))])
921921
(cond
922-
[(null? mods-where-binder-is) #t]
922+
[(null? mods-where-binder-is)
923+
(for/and ([mod (in-list mods-where-var-is)])
924+
(submodule-enclosing-bindings-visible? mod))]
923925
[(null? mods-where-var-is) #f]
924926
[else
925-
(define mod (car mods-where-var-is))
926-
(and (submodule-enclosing-bindings-visible? mod)
927-
(equal? mod (car mods-where-binder-is))
927+
(and (equal? (car mods-where-var-is)
928+
(car mods-where-binder-is))
928929
(loop (cdr mods-where-var-is)
929930
(cdr mods-where-binder-is)))]))))
930931
(when binder-is-outside-reference?

0 commit comments

Comments
 (0)