racket / redex

Other
93 stars 36 forks source link

malformed `where` clause in `judgment-form` causes a confusing error message #176

Closed florence closed 5 years ago

florence commented 5 years ago

In the program:

#lang racket
(require redex/reduction-semantics)
(define-language L)
(define-judgment-form L
  #:mode (T)
  [(where _ 1 2)
   -------------
   (T)])

define-judgment-form: expected judgment form name in: where

Which can be rather confusing where is not apparent that the where clause is malformed.

In the case where where is still bound to the identifier for where clauses, a better error message would probably be the standard syntax parse error message like:

where: unexpected term in: 3