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

Cryptic errors on missing/wrong braces #94

Open
bannmann opened this issue Dec 1, 2021 · 0 comments
Open

Cryptic errors on missing/wrong braces #94

bannmann opened this issue Dec 1, 2021 · 0 comments

Comments

@bannmann
Copy link
Contributor

bannmann commented Dec 1, 2021

Silverchain fails to parse the following AG files, which is correct. However, the error messages are overly generic and vague. I included some examples of what I would consider a helpful message.

// fails with the following error:
// line 13:15 no viable alternative at input 'Foo{voidfirstsecond'
//
// fix:
// replace "first" with "first()"
//
// ideas for helpful messages:
// - line 13:14 expected '(', got ' '
// - line 13:15 expected '(', got 'second'
// - line 13:9 expected METHOD_SIGNATURE, got TYPE_NAME
//
Foo {
    void first second() third();
}
// fails with the following error:
// line 15:15 no viable alternative at input 'Foo{voidfirst(secondA('
//
// fix:
// replace "first" with "first()"
//
// ideas for helpful messages:
// - line 15:15 unexpected opening brace
// - line 15:8 expected TYPE_NAME, got METHOD_SIGNATURE
// - line 15:8 expected PARAMETER, got METHOD_SIGNATURE
//
Foo {
    void
    first
    (
        secondA()
        |
        secondB()
    )
    third();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant