-
Notifications
You must be signed in to change notification settings - Fork 572
Clarify whitespace lex error in qualified identifier lexing #3845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ data ParserErrorType | |
| | ErrQualifiedName | ||
| | ErrEmptyDo | ||
| | ErrLexeme (Maybe String) [String] | ||
| | ErrQualifierLexeme Char | ||
| | ErrEof | ||
| | ErrCustom String | ||
| deriving (Show, Eq, Ord) | ||
|
|
@@ -128,6 +129,10 @@ prettyPrintErrorMessage (ParserErrorInfo {..}) = case errType of | |
| "Illegal whitespace character " <> displayCodePoint hd | ||
| ErrLexeme (Just a) _ -> | ||
| "Unexpected " <> a | ||
| ErrQualifierLexeme hd | isSpace hd -> | ||
| "Unexpected whitespace character " <> displayCodePoint hd <> ", expected qualifier" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you mean ‘expected identifier or operator’ instead of ‘expected qualifier’? The qualifier has already been seen at this point in the parse, right? Also, it looks like the other error messages of this nature follow an ‘Expected X, saw Y’ pattern; I'd expect these messages to match that. |
||
| ErrQualifierLexeme a -> | ||
| "Unexpected " <> [ a ] <> ", expected qualifier" | ||
| ErrLineFeedInString -> | ||
| "Unexpected line feed in string literal" | ||
| ErrAstralCodePointInChar -> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By analogy with
ErrImportInDecl,ErrTypeInConstraint, etc., should this beErrLexemeInQualified?