Skip to content

Error tolerant parser #120

@tritao

Description

@tritao

I'm playing with some changes for making the parser more error-tolerant, so it does not fail on first error (by keeping a list of emitted diagnostics during parse), adding an ND_ERROR node and overall improving robustness for invalid code.

Is this something you think could be interesting to add as a PR contribution?

For example:

struct foo {

}

enum bar {
    
}

union qux {
    
}

int main(void) {
    int a = 0;
    return 0;
}
=== Diagnostics ===
expected ';' after struct declaration
empty enum specifier
expected ';' after enum declaration
expected ';' after union declaration

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions