[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/16] examples: bistromathic: comment changes
From: |
Akim Demaille |
Subject: |
[PATCH 11/16] examples: bistromathic: comment changes |
Date: |
Sun, 26 Apr 2020 16:40:46 +0200 |
* examples/c/bistromathic/parse.y: here.
---
examples/c/bistromathic/parse.y | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/examples/c/bistromathic/parse.y b/examples/c/bistromathic/parse.y
index 58601ce7..c47bec75 100644
--- a/examples/c/bistromathic/parse.y
+++ b/examples/c/bistromathic/parse.y
@@ -308,6 +308,13 @@ error_format_string (int argc)
default: /* Avoid compiler warnings. */
case 0: return _("%@: syntax error");
case 1: return _("%@: syntax error: unexpected %u");
+ // TRANSLATORS: '%@' is a location in a file, '%u' is an
+ // "unexpected token", and '%0e', '%1e'... are expected tokens
+ // at this point.
+ //
+ // For instance on the expression "1 + * 2", you'd get
+ //
+ // 1.5: syntax error: expected - or ( or number or function or variable
before *
case 2: return _("%@: syntax error: expected %0e before %u");
case 3: return _("%@: syntax error: expected %0e or %1e before %u");
case 4: return _("%@: syntax error: expected %0e or %1e or %2e before %u");
@@ -336,7 +343,7 @@ yyreport_syntax_error (const yypcontext_t *ctx)
YY_LOCATION_PRINT (stderr, *yypcontext_location (ctx));
format += 2;
}
- // %t: unexpected token.
+ // %u: unexpected token.
else if (format[0] == '%' && format[1] == 'u')
{
fputs (yysymbol_name (yypcontext_token (ctx)), stderr);
--
2.26.2
- [PATCH 00/16] Returning the error token from the scanner does not trigger an error message, Akim Demaille, 2020/04/26
- [PATCH 07/16] c++: fix a few style issues, Akim Demaille, 2020/04/26
- [PATCH 03/16] style: glr.c: fix indentation issue, Akim Demaille, 2020/04/26
- [PATCH 04/16] style: prefer b4_has_translations_if, Akim Demaille, 2020/04/26
- [PATCH 02/16] style: fix a few remaining 'type' instead of 'kind', Akim Demaille, 2020/04/26
- [PATCH 01/16] skeletons: make the warning about implementation details clearer, Akim Demaille, 2020/04/26
- [PATCH 06/16] all: prefer YYERRCODE to YYERROR, Akim Demaille, 2020/04/26
- [PATCH 08/16] c++: always define symbol_name, Akim Demaille, 2020/04/26
- [PATCH 09/16] c++: make valid to print the empty symbol, Akim Demaille, 2020/04/26
- [PATCH 11/16] examples: bistromathic: comment changes,
Akim Demaille <=
- [PATCH 10/16] doc: hacking tricks, Akim Demaille, 2020/04/26
- [PATCH 05/16] style: glr.c: clarify, Akim Demaille, 2020/04/26
- [PATCH 13/16] examples: bistromathic: demonstrate error recovery, Akim Demaille, 2020/04/26
- [PATCH 12/16] examples: bistromathic: when quitting, close the current line, Akim Demaille, 2020/04/26
- [PATCH 15/16] all: don't emit an error message when the scanner returns YYERRCODE, Akim Demaille, 2020/04/26
- [PATCH 16/16] todo: update, Akim Demaille, 2020/04/26
- [PATCH 14/16] c: don't emit an error message when the scanner returns YYERRCODE, Akim Demaille, 2020/04/26