added checks to make ellipses appearing at different depths be a syntax error
This commit is contained in:
parent
5a67535a95
commit
c1285b12ed
|
@ -38,6 +38,10 @@
|
|||
(define ((expect-identifier src) stx)
|
||||
(unless (identifier? stx)
|
||||
(raise-syntax-error what "expected an identifier" src stx)))
|
||||
|
||||
;; call this and discard the result to ensure that all names are at the right ellipsis depths.
|
||||
(extract-names all-nts what bind-names? orig-stx)
|
||||
|
||||
(let loop ([term orig-stx])
|
||||
(syntax-case term (side-condition variable-except variable-prefix hole name in-hole hide-hole side-condition cross)
|
||||
[(side-condition pre-pat (and))
|
||||
|
|
|
@ -1206,6 +1206,18 @@
|
|||
#rx"different depths"
|
||||
2)
|
||||
|
||||
(test-syn-err (redex-match
|
||||
grammar
|
||||
((name x any) (name x any_2) ...))
|
||||
#rx"different depths"
|
||||
2)
|
||||
|
||||
(test-syn-err (define-language bad-lang5
|
||||
(e ((name x any) (name x any_2) ...)))
|
||||
#rx"different depths"
|
||||
2)
|
||||
|
||||
|
||||
(test-syn-err (reduction-relation
|
||||
grammar
|
||||
(--> 1 2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user