Skip to content

More resilient parser for better error messages #103

@nicopap

Description

@nicopap

For example, we could use it to show more error messages.

  • When using commas, non-methods (such as string literals) in the method zone (suggest template call syntax if similar name, or not using commas)
  • When several subsequent identifiers are found in statement position (suggest string literal or single name)
  • Heuristic to parse unbalanced tokens in method position
  • When using semicolons after statements

An option is also to have a secondary parser that accepts a broader syntax and logs error on encountering syntax that diverges with the main parser. We would call the secondary parser when finding syntax errors in the file. This way, we keep the "happy path" fast, while making the "sad path" more informative if a bit slower.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-chirprelates to the cuicui_chirp file format crate specificallyT-error handlingHas to do with how we handle errors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions