Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kjcjohnson opened this issue Mar 25, 2022 · 0 comments

Comments

@kjcjohnson
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant