-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Grammar: add descriptions to productions for error messages
The obvious strategy of adding a description to every production does not work well, as when constructing an error message, Ohm seems to stop at the first description. So for example, it would produce: Expected an expression rather than something like Expected "+", "-", "(", a number, a boolean,… In extreme cases it says: Expected a which seems wrong!
- Loading branch information
Showing
3 changed files
with
17 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Line 1, col 4: | ||
> 1 | 4 + | ||
^ | ||
Expected "(", "gen", "fn", "{", "[", "_", a letter, a digit, ".", "r####\"", "r###\"", "r##\"", "r#\"", "r\"", "\"", "true", "false", "null", "-", "+", or "~" | ||
Expected "(", a function, a block, a list, an identifier, an object, a map, a number, a literal string, a string, a boolean, "null", "-", "+", or "~" |