From 0bec757e5e8ce7ddc171ed4d4e5f104326c21528 Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Fri, 1 Apr 2011 06:27:40 -0600 Subject: [PATCH] syntax/parse: fixed bug in ~literal uncovered by litset changes --- collects/syntax/parse/private/rep.rkt | 3 ++- collects/syntax/parse/private/runtime.rkt | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/collects/syntax/parse/private/rep.rkt b/collects/syntax/parse/private/rep.rkt index a9d53256c5..25f61ecb56 100644 --- a/collects/syntax/parse/private/rep.rkt +++ b/collects/syntax/parse/private/rep.rkt @@ -844,7 +844,8 @@ A syntax class is integrable if (let* ([chunks (parse-keyword-options/eol #'more phase-directive-table #:no-duplicates? #t #:context stx)] - [phase (options-select-value chunks '#:phase #:default 0)]) + [phase (options-select-value chunks '#:phase + #:default #'(syntax-local-phase-level))]) ;; FIXME: Duplicates phase expr! (create-pat:literal #'lit phase phase))] [_ diff --git a/collects/syntax/parse/private/runtime.rkt b/collects/syntax/parse/private/runtime.rkt index 9dce6f452f..859d3fe039 100644 --- a/collects/syntax/parse/private/runtime.rkt +++ b/collects/syntax/parse/private/runtime.rkt @@ -283,10 +283,10 @@ (eq? namex namey) (equal? phasex phasey)))] [else - (and (eq? bx 'lexical) (eq? by 'lexical) - ;; One must be lexical (can't be #f, since one must be bound) - ;; lexically-bound names bound in only one phase; just compare - (free-identifier=? x y))]))) + ;; Module is only way to get phase-shift; if not module-bound names, + ;; then only identifiers at same phase can refer to same binding. + (and (equal? phase-x phase-y) + (free-identifier=? x y phase-x))]))) ;; ----