diagnostics: improve accuracy for deprecated %define variables

* src/parse-gram.y: Use the location of the whole definition to record
the location of a %define variable, instead of just the name of the
variable.
Adjust tests.
This commit is contained in:
Akim Demaille
2019-01-12 19:44:36 +01:00
parent ffe2e4aaec
commit 79e79be298
6 changed files with 95 additions and 93 deletions

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.2.90. */
/* A Bison parser, made by GNU Bison 3.2.90.11-ccb3-dirty. */
/* Bison implementation for Yacc-like parsers in C
@@ -48,7 +48,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "3.2.90"
#define YYBISON_VERSION "3.2.90.11-ccb3-dirty"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -2292,7 +2292,7 @@ yyreduce:
case 8:
#line 293 "src/parse-gram.y" /* yacc.c:1649 */
{
muscle_percent_define_insert ((yyvsp[-1].variable), (yylsp[-1]), (yyvsp[0].value).kind, (yyvsp[0].value).chars,
muscle_percent_define_insert ((yyvsp[-1].variable), (yyloc), (yyvsp[0].value).kind, (yyvsp[0].value).chars,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
}
#line 2299 "src/parse-gram.c" /* yacc.c:1649 */

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.2.90. */
/* A Bison parser, made by GNU Bison 3.2.90.11-ccb3-dirty. */
/* Bison interface for Yacc-like parsers in C

View File

@@ -291,7 +291,7 @@ prologue_declaration:
}
| "%define" variable value
{
muscle_percent_define_insert ($2, @2, $3.kind, $3.chars,
muscle_percent_define_insert ($2, @$, $3.kind, $3.chars,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
}
| "%defines" { defines_flag = true; }