racket/collects/redex/tests/syn-err-tests/relation-definition.rktd
Burke Fetscher cf9b0f774b Change define-relation to compile to a judgment-form, instead of a metafunction.
Also:
- remove the restriction on the use of unquote in define-judgment-form
- allows limited use (I modes only) of judgment-forms in terms
- allows the use of define-relation with the search/unification
  based random term generation
2012-11-29 17:17:34 -06:00

27 lines
663 B
Racket
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(#rx"expected the name of the relation"
([bad-def (define-relation syn-err-lang R)])
bad-def)
(#rx"expected a sequence of patterns separated by"
([subset ])
(define-relation syn-err-lang R subset))
(#rx"expected clause definitions"
([bad-def (define-relation syn-err-lang foo c)])
bad-def)
(#rx"expected a pattern"
([cross ×])
(define-relation syn-err-lang foo c cross))
(#rx"found a 'where' clause not at the end"
([first-where (where any_c any_a)]
[first-post-where (R () ())])
(define-relation syn-err-lang
[(R () ())]
[(R (any_a) (any_b))
(R any_c any_d)
first-where
(where any_d any_b)
first-post-where]))