Skip to content

Malformed declare-term-types structure doesn't provide a useful error message #45

@kjcjohnson

Description

@kjcjohnson

Consider the (wrong but reasonable) declare-term-types form:

(declare-term-types
  ; Declare the 'universal grammar' to be used in the Semgus problem
  ((E 0))
  (  ; <-- missing (
    ($1) ; Leaf node 1
    ($x) ; Leaf node variable x
    ($+ (e1 E) (e2 E)) ; Production: E -> E + E
  ) ; <-- missing )
)

It's missing an additional list around the constructors for E. Instead of being useful, the parser prints the following error:

error: .\max-exp-i.sem:11:5: Cannot convert SymbolToken [$1] to ConstructorDecl[] while converting list.
error: .\max-exp-i.sem:11:5: Cannot convert ConsToken [($1)] to IList`1[ConstructorDecl] while converting list.

We should do better than this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions