bistromathic: don't stupidly reset the location for each token

That quite defeats the whole point of locations...  But anyway, we
should not see these messages at all.

* examples/c/bistromathic/parse.y (expected_tokens): Fix (useless)
location tracking.
This commit is contained in:
Akim Demaille
2020-07-11 14:00:10 +02:00
parent dab23c4a21
commit 093eeb27e9
2 changed files with 4 additions and 4 deletions

View File

@@ -313,7 +313,7 @@ sed -e 's/\\t/ /g' >input <<EOF
EOF
run -n 0 '> 1++ ''
> ''
err: 1.1: syntax error: expected - or ( or number or function or variable before +
err: 1.3: syntax error: expected - or ( or number or function or variable before +
err: 1.3: syntax error: expected - or ( or number or function or variable before +
'
@@ -323,8 +323,8 @@ sed -e 's/\\t/ /g' >input <<EOF
EOF
run -n 0 '> (1++2) + 3 + ''
> ''
err: 1.1: syntax error: expected - or ( or number or function or variable before +
err: 1.1: syntax error: expected - or ( or number or function or variable before +
err: 1.4: syntax error: expected - or ( or number or function or variable before +
err: 1.4: syntax error: expected - or ( or number or function or variable before +
err: 1.4: syntax error: expected - or ( or number or function or variable before +
err: 1.15: syntax error: expected - or ( or number or function or variable before end of file
'

View File

@@ -473,8 +473,8 @@ expected_tokens (const char *input,
// Parse the current state of the line.
yypstate *ps = yypstate_new ();
int status = 0;
YYLTYPE lloc = { 1, 1, 1, 1 };
do {
YYLTYPE lloc = { 1, 1, 1, 1 };
YYSTYPE lval;
yytoken_kind_t token = yylex (&input, &lval, &lloc);
// Don't let the parser know when we reach the end of input.