input.y:20.1: error: syntax error, unexpected end of file
]])
+AT_BISON_CHECK([-fcaret -o input.c input.y], 1, [],
+[[input.y:1.10-2.0: error: missing '"' at end of line
+ %token A "a
+ ^^
+input.y:4.10-5.0: error: missing "'" at end of line
+ %token C '1
+ ^^
+input.y:14.11-15.0: error: missing "'" at end of line
+ %type <f> 'a
+ ^^
+input.y:16.11-17.0: error: missing '"' at end of line
+ %type <f> "a
+ ^^
+input.y:19.13-20.0: error: missing '}' at end of file
+ %destructor { free ($$)
+ ^^^^^^^^^^^
+input.y:20.1: error: syntax error, unexpected end of file
+]])
+
AT_CLEANUP
]])
AT_BISON_CHECK([[-Dvar=cmd-d input-dg.y]], [[1]], [],
[[input-dg.y:1.9-11: error: %define variable 'var' redefined
+<command line>:1: previous definition
+]])
+
+AT_DATA([[input-dg.y]],
+[[%define var "gram"
+%%
+start: ;
+]])
+AT_BISON_CHECK([[-fcaret -Dvar=cmd-d input-dg.y]], [[1]], [],
+[[input-dg.y:1.9-11: error: %define variable 'var' redefined
+ %define var "gram"
+ ^^^
<command line>:2: previous definition
]])
start: ;
]])
AT_BISON_CHECK([[-Dunused-d -Funused-f input-unused.y]], [[1]], [],
-[[<command line>:2: error: %define variable 'unused-d' is not used
-<command line>:3: error: %define variable 'unused-f' is not used
+[[<command line>:1: error: %define variable 'unused-d' is not used
+<command line>:2: error: %define variable 'unused-f' is not used
]])
AT_CLEANUP
# parse.lac.* options are useless if LAC isn't actually activated.
AT_BISON_CHECK([[-Dparse.lac.es-capacity-initial=1 input.y]],
[[1]], [],
-[[<command line>:2: error: %define variable 'parse.lac.es-capacity-initial' is not used
+[[<command line>:1: error: %define variable 'parse.lac.es-capacity-initial' is not used
]])
AT_BISON_CHECK([[-Dparse.lac.memory-trace=full input.y]],
[[1]], [],
-[[<command line>:2: error: %define variable 'parse.lac.memory-trace' is not used
+[[<command line>:1: error: %define variable 'parse.lac.memory-trace' is not used
]])
AT_CLEANUP
])
AT_TEST([%define api.prefix foo %name-prefix "bar"], [], [input.y:1.9-18])
-AT_TEST([], [-Dapi.prefix=foo -p bar], [<command line>:2])
-AT_TEST([%name-prefix "bar"], [-Dapi.prefix=foo], [<command line>:2])
+AT_TEST([], [-Dapi.prefix=foo -p bar], [<command line>:1])
+AT_TEST([%name-prefix "bar"], [-Dapi.prefix=foo], [<command line>:1])
AT_TEST([%define api.prefix foo], [-p bar], [input.y:1.9-18])
m4_popdef([AT_TEST])