bistromathic: demonstrate caret-diagnostics

* examples/c/bistromathic/parse.y (user_context): We need the current
line.
(yyreport_syntax_error): Quote the guilty line, with squiggles.
* examples/c/bistromathic/bistromathic.test: Adjust.
This commit is contained in:
Akim Demaille
2020-07-11 14:30:15 +02:00
parent c47e1174d4
commit dc72b3566d
6 changed files with 86 additions and 13 deletions

11
NEWS
View File

@@ -2,6 +2,17 @@ GNU Bison NEWS
* Noteworthy changes in release ?.? (????-??-??) [?]
** Documentation
*** Examples
The bistromathic demonstrates %param and how to quote sources in the error
messages:
> 123 456
1.5-7: syntax error: expected end of file or + or - or * or / or ^ before number
1 | 123 456
| ^~~
* Noteworthy changes in release 3.6.91 (2020-07-09) [beta]