diagnostics: translate bison's own tokens

As a test case, support translations in Bison itself.

* src/parse-gram.y: Mark the translatable tokens.
While at it, use clearer names.
* tests/input.at: Adjust expectations.
This commit is contained in:
Akim Demaille
2018-12-29 07:35:58 +01:00
parent e6d1289f4a
commit 2cc361387c
2 changed files with 39 additions and 45 deletions

View File

@@ -287,10 +287,10 @@ input.y:5.8-15: error: syntax error, unexpected string, expecting character lite
input.y:6.8-13: error: syntax error, unexpected string, expecting character literal or identifier or <tag>
6 | %token "tok1" 1;
| ^~~~~~
input.y:7.14: error: syntax error, unexpected integer
input.y:7.14: error: syntax error, unexpected integer literal
7 | %left "tok2" 2;
| ^
input.y:8.14: error: syntax error, unexpected integer
input.y:8.14: error: syntax error, unexpected integer literal
8 | %type "tok3" 3;
| ^
]])