Fixed uses of free-identifier=? guards
free-identifier=? expects, contrary to documentation, a syntax?, causing contract errors. (and (identifier? ...) ...) solves this. [Since the function is called only on fully expanded forms, it doesn't look like the `identifier?` tests can ever fail, but it still seems sensible to have them. -Matthew]
This commit is contained in:
parent
61d717fd07
commit
b76b2aa638
|
@ -8,13 +8,13 @@
|
||||||
(define ((count-meta-levels phase) expr)
|
(define ((count-meta-levels phase) expr)
|
||||||
(syntax-case expr ()
|
(syntax-case expr ()
|
||||||
[(bfs . exprs)
|
[(bfs . exprs)
|
||||||
(free-identifier=? #'bfs #'begin-for-syntax phase base)
|
(and (identifier? #'bfs) (free-identifier=? #'bfs #'begin-for-syntax phase base))
|
||||||
(add1 (apply max 0 (map (count-meta-levels (add1 phase)) (syntax->list #'exprs))))]
|
(add1 (apply max 0 (map (count-meta-levels (add1 phase)) (syntax->list #'exprs))))]
|
||||||
[(ds . _)
|
[(ds . _)
|
||||||
(free-identifier=? #'ds #'define-syntaxes phase base)
|
(and (identifier? #'ds) (free-identifier=? #'ds #'define-syntaxes phase base))
|
||||||
1]
|
1]
|
||||||
[(b . exprs)
|
[(b . exprs)
|
||||||
(free-identifier=? #'b #'begin phase base)
|
(and (identifier? #'b) (free-identifier=? #'b #'begin phase base))
|
||||||
(apply max 0 (map (count-meta-levels phase) (syntax->list #'exprs)))]
|
(apply max 0 (map (count-meta-levels phase) (syntax->list #'exprs)))]
|
||||||
[_ 0]))
|
[_ 0]))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user