diagnostics: report syntax errors in color

* src/parse-gram.y (parse.error): Set to 'custom'.
(yyreport_syntax_error): New.
* data/bison-default.css (.expected, .unexpected): New.
* tests/diagnostics.at: Adjust.
This commit is contained in:
Akim Demaille
2020-01-22 22:29:09 +01:00
parent f54a5b303b
commit 46ab1d0cbe
4 changed files with 65 additions and 3 deletions

View File

@@ -273,7 +273,7 @@ AT_TEST([[Carriage return]],
[[input.y:10.8-11.0: <error>error:</error> missing '"' at end of line
10 | %token <error>"</error>
| <error>^</error>
input.y:10.8-11.0: <error>error:</error> syntax error, unexpected string, expecting character literal or identifier or <tag>
input.y:10.8-11.0: <error>error:</error> syntax error, unexpected <unexpected>string</unexpected>, expecting <expected>character literal</expected> or <expected>identifier</expected> or <expected><tag></expected>
10 | %token <error>"</error>
| <error>^</error>
]])