Open nblumhardt opened 8 years ago
To avoid fiddling with the case of the message fragment:
Syntax error: unexpected number `123`, expected atom
--> line 1, column 13
|
1 | 123 abc 123 123
| ^^^ expected atom
Made some small improvements in https://github.com/datalust/superpower/pull/38 that should help with this (see the linked screenshot and example program).
Superpower produces errors that carry a location, error message fragment, and expectations.
By default, the result types'
ToString()
formats these into one-line messages as in this test case:This is a good default, but in some applications (especially those that produce output for terminals) a multi-line error can provide more context.
This is an example from FParsec:
Using the information available to Superpower,
It would be nice to show the preceding and following lines if available. The new
rustc
error formatting sets the benchmark here.