mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
Reorder error message to add callstack after the error syntax node
This commit is contained in:
parent
1a98dba03b
commit
9519e557be
@ -167,9 +167,9 @@ data ErrorCause symbol
|
||||
showError :: Show symbol => Source.Source -> Error symbol -> ShowS
|
||||
showError source Error{..}
|
||||
= showSourcePos errorPos . showString ": error: " . showExpectation . showChar '\n'
|
||||
. showString (prettyCallStack callStack) . showChar '\n'
|
||||
. showString context -- actualLines results include line endings, so no newline here
|
||||
. showString (replicate (succ (Info.column errorPos + lineNumberDigits)) ' ') . showChar '^' . showChar '\n'
|
||||
. showString (prettyCallStack callStack) . showChar '\n'
|
||||
where showExpectation = case errorCause of
|
||||
UnexpectedEndOfInput [] -> showString "no rule to match at end of input nodes"
|
||||
UnexpectedEndOfInput symbols -> showString "expected " . showSymbols symbols . showString " at end of input nodes"
|
||||
|
Loading…
Reference in New Issue
Block a user