From 3b50adf7f47f0fc1557c14a90cd35f4d349e3159 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 25 Apr 2020 14:56:04 +0200 Subject: [PATCH] examples: bistromathic: comment changes * 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);