added checks to make ellipses appearing at different depths be a syntax error

This commit is contained in:
Robby Findler 2010-10-01 18:07:49 -05:00
parent 5a67535a95
commit c1285b12ed
2 changed files with 16 additions and 0 deletions

View File

@ -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))

View File

@ -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)