Add error list of some kind #12

Open
opened 2025-04-14 21:47:47 +00:00 by omicron · 0 comments
Owner

Currently there is only one way to return a fatal error during any part of the assembling. We want to have some kind of error list that many/all stages of the assembler can use to push errors into. The error list should have enough context to print useful error messages.

Context wise it's probably enough to have a tokenlist entry along with a useful error message. Creating the tokenlist happens after the lexing stage, but lexer errors are already non-fatal so that should be okay, the lexer errors can be flagged when the tokens are added to the token list.

It's not yet clear to me when errors should be shown to the user. Presumably we want to show errors and fail after each stage is completed.

  • Lex
  • Create tokenlist
    • Abort if lexer errors are present, show them
  • Parse
    • Abort if parser errors are present, show them
  • Encode pass 1
    • Abort if any semantic errors appear, show them
  • Encode pass 2
    • Abort if any semantic errors appear, show them

For parsing errors there's still #5 that needs to be explored. I suspect parsing can only really throw a single error unless there is a way to recover from parse failures by skipping tokens according to some heuristic.

Currently there is only one way to return a fatal error during any part of the assembling. We want to have some kind of error list that many/all stages of the assembler can use to push errors into. The error list should have enough context to print useful error messages. Context wise it's probably enough to have a tokenlist entry along with a useful error message. Creating the tokenlist happens after the lexing stage, but lexer errors are already non-fatal so that should be okay, the lexer errors can be flagged when the tokens are added to the token list. It's not yet clear to me when errors should be shown to the user. Presumably we want to show errors and fail after each stage is completed. - Lex - Create tokenlist - Abort if lexer errors are present, show them - Parse - Abort if parser errors are present, show them - Encode pass 1 - Abort if any semantic errors appear, show them - Encode pass 2 - Abort if any semantic errors appear, show them For parsing errors there's still #5 that needs to be explored. I suspect parsing can only really throw a single error unless there is a way to recover from parse failures by skipping tokens according to some heuristic.
omicron added the
feature
label 2025-04-14 21:47:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: omicron/oas#12
No description provided.