-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "error nodes" for types and expressions (#398)
Types and expressions can form complex parse trees, but sometimes something goes wrong in a sub-part of the tree. For example, a dict field might have an invalid expression as its value. Rather than use nil, which typically means "missing" and has no span information, we can use `ExprError` with a span containing the skipped tokens. This also means that we can have parser functions like e.g. `tryParseExpr()` which can signal nil when the tokens that follow cannot begin an expression, but `ExprError` upon committing to a parse.
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters