macro expander fix
Relevant to PR 12863 Merge to v5.3
This commit is contained in:
parent
94498465e6
commit
d3677524b8
|
@ -638,6 +638,33 @@
|
||||||
#'#f)
|
#'#f)
|
||||||
(two))
|
(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,
|
;; Check `free-identifier=?' propagation,
|
||||||
;; definition contexts, and `syntax-local-bind-syntaxes'
|
;; definition contexts, and `syntax-local-bind-syntaxes'
|
||||||
|
|
|
@ -1112,7 +1112,7 @@ Scheme_Object *scheme_tl_id_sym(Scheme_Env *env, Scheme_Object *id, Scheme_Objec
|
||||||
if (SCHEME_NULLP(amarks)) {
|
if (SCHEME_NULLP(amarks)) {
|
||||||
/* can always match empty marks */
|
/* can always match empty marks */
|
||||||
best_match = SCHEME_CDR(a);
|
best_match = SCHEME_CDR(a);
|
||||||
best_match_skipped = 0;
|
best_match_skipped = scheme_proper_list_length(marks);
|
||||||
} else if (!SCHEME_PAIRP(marks)) {
|
} else if (!SCHEME_PAIRP(marks)) {
|
||||||
/* To be better than nothing, could only match exactly: */
|
/* To be better than nothing, could only match exactly: */
|
||||||
if (scheme_equal(amarks, marks)) {
|
if (scheme_equal(amarks, marks)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user