-
-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Milestone
Description
It would be great if rnix-parser has errors more descriptive than "unexpected X," perhaps prompting the user how to fix the code if we can guess what's missing (e.g. a semicolon for the last value in an attr set)?
Existing error messages at the time of writing:
Lines 22 to 37 in fa6ddde
| #[derive(Clone, Debug, PartialEq)] | |
| #[non_exhaustive] | |
| pub enum ParseError { | |
| /// Unexpected is used when the cause cannot be specified further | |
| Unexpected(TextRange), | |
| /// UnexpectedExtra is used when there are additional tokens to the root in the tree | |
| UnexpectedExtra(TextRange), | |
| /// UnexpectedWanted is used when specific tokens are expected, but different one is found | |
| UnexpectedWanted(SyntaxKind, TextRange, Box<[SyntaxKind]>), | |
| /// UnexpectedDoubleBind is used when a pattern is bound twice | |
| UnexpectedDoubleBind(TextRange), | |
| /// UnexpectedEOF is used when the end of file is reached, while tokens are still expected | |
| UnexpectedEOF, | |
| /// UnexpectedEOFWanted is used when specific tokens are expected, but the end of file is reached | |
| UnexpectedEOFWanted(Box<[SyntaxKind]>), | |
| } |
Ma27 and oppiliappan
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed