SemGuS-git / Semgus-Parser

Library and tool for parsing SemGuS specifications
MIT License
4 stars 1 forks source link

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

Open kjcjohnson opened 2 years ago

kjcjohnson commented 2 years ago

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.