Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

Better parser error reporting

Open kant2002 opened this issue 2 years ago • 1 comments

int test() {
    return 1;
}
int main(void) {
    if (!test()) return -3;
    return 0; }

Produces Excessive output after the end of a translation unit at line 5, column 10: KeywordInt int.

If I comment out if (!test()) return -3; then things starts working.

Okay, I figure out while I wrote this, we lack of support for ! operator for conditions, but I think we should do something about better user reporting.

kant2002 avatar Aug 13 '22 12:08 kant2002

We couldn't parse anything beyond that int. I doubt we'll get anything better from an auto-generated parser.

I'm leaving this open for any ideas, though. Maybe one day we'll rewrite the parser and get better error messages.

For now, this isn't a priority for me, as our primary target is already written C programs.

ForNeVeR avatar Aug 14 '22 13:08 ForNeVeR