macro expander fix

Relevant to PR 12863

Merge to v5.3
This commit is contained in:
Matthew Flatt 2012-07-19 20:42:19 -05:00
parent 94498465e6
commit d3677524b8
2 changed files with 28 additions and 1 deletions

View File

@ -638,6 +638,33 @@
#'#f)
(two))
;; ----------------------------------------
;; Related: check that matching no marks is considered less
;; of a match than matching with marks:
(module another-test-empty-marks-with-context racket/base
(require (for-syntax racket/base))
(define-for-syntax count 0)
(define-for-syntax (inc-count!) (set! count (add1 count)))
(define-syntax (foo stx)
(syntax-case stx ()
[(_ x e)
(let ([cid-marker (make-syntax-introducer)])
(with-syntax ([y (cid-marker #'x)])
#'(begin
(define y e)
(+ y 1)
(define-syntax x
(lambda (stx)
(inc-count!)
(when (= count 5) (error "stop"))
#'y)))))]))
(module* test #f
(foo eX 3)))
;; ----------------------------------------
;; Check `free-identifier=?' propagation,
;; definition contexts, and `syntax-local-bind-syntaxes'

View File

@ -1112,7 +1112,7 @@ Scheme_Object *scheme_tl_id_sym(Scheme_Env *env, Scheme_Object *id, Scheme_Objec
if (SCHEME_NULLP(amarks)) {
/* can always match empty marks */
best_match = SCHEME_CDR(a);
best_match_skipped = 0;
best_match_skipped = scheme_proper_list_length(marks);
} else if (!SCHEME_PAIRP(marks)) {
/* To be better than nothing, could only match exactly: */
if (scheme_equal(amarks, marks)) {