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

@@ -32,7 +32,7 @@ exp: %empty;
]])
AT_BISON_CHECK([[input.y]], [[1]], [[]],
[[input.y:2.9-22: error: '%union' and '%define api.value.type' cannot be used together
[[input.y:2.1-38: error: '%union' and '%define api.value.type' cannot be used together
]])
AT_CLEANUP
@@ -51,7 +51,7 @@ exp: %empty;
]])
AT_BISON_CHECK([[input.y]], [[1]], [[]],
[[input.y:2.9-22: error: '%yacc' and '%define api.value.type "union"' cannot be used together
[[input.y:2.1-28: error: '%yacc' and '%define api.value.type "union"' cannot be used together
]])
AT_CLEANUP