carets: activate by default

* src/getargs.c (feature_flag): Here.
* tests/local.at (AT_BISON_CHECK_, AT_BISON_CHECK_NO_XML): Deactivate carets
for the testsuite, by default.
* tests/input.at: Adjust the locations for command line definitions.
This commit is contained in:
Theophile Ranquet
2012-12-28 13:32:14 +01:00
parent 6656c9b52a
commit 9c4788b7ee
3 changed files with 11 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ bool yacc_flag; /* for -y */
bool nondeterministic_parser = false; bool nondeterministic_parser = false;
bool glr_parser = false; bool glr_parser = false;
int feature_flag = feature_none; int feature_flag = feature_caret;
int report_flag = report_none; int report_flag = report_none;
int trace_flag = trace_none; int trace_flag = trace_none;

View File

@@ -1240,7 +1240,7 @@ start: ;
]]) ]])
AT_BISON_CHECK([[-Dvar=cmd-d input-dg.y]], [[1]], [], AT_BISON_CHECK([[-Dvar=cmd-d input-dg.y]], [[1]], [],
[[input-dg.y:1.9-11: error: %define variable 'var' redefined [[input-dg.y:1.9-11: error: %define variable 'var' redefined
<command line>:1: previous definition <command line>:2: previous definition
]]) ]])
AT_DATA([[input-dg.y]], AT_DATA([[input-dg.y]],
@@ -1252,7 +1252,7 @@ AT_BISON_CHECK([[-fcaret -Dvar=cmd-d input-dg.y]], [[1]], [],
[[input-dg.y:1.9-11: error: %define variable 'var' redefined [[input-dg.y:1.9-11: error: %define variable 'var' redefined
%define var "gram" %define var "gram"
^^^ ^^^
<command line>:2: previous definition <command line>:3: previous definition
]]) ]])
AT_DATA([[input-unused.y]], AT_DATA([[input-unused.y]],
@@ -1260,8 +1260,8 @@ AT_DATA([[input-unused.y]],
start: ; start: ;
]]) ]])
AT_BISON_CHECK([[-Dunused-d -Funused-f input-unused.y]], [[1]], [], AT_BISON_CHECK([[-Dunused-d -Funused-f input-unused.y]], [[1]], [],
[[<command line>:1: error: %define variable 'unused-d' is not used [[<command line>:2: error: %define variable 'unused-d' is not used
<command line>:2: error: %define variable 'unused-f' is not used <command line>:3: error: %define variable 'unused-f' is not used
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -1582,11 +1582,11 @@ start: ;
# parse.lac.* options are useless if LAC isn't actually activated. # parse.lac.* options are useless if LAC isn't actually activated.
AT_BISON_CHECK([[-Dparse.lac.es-capacity-initial=1 input.y]], AT_BISON_CHECK([[-Dparse.lac.es-capacity-initial=1 input.y]],
[[1]], [], [[1]], [],
[[<command line>:1: error: %define variable 'parse.lac.es-capacity-initial' is not used [[<command line>:2: error: %define variable 'parse.lac.es-capacity-initial' is not used
]]) ]])
AT_BISON_CHECK([[-Dparse.lac.memory-trace=full input.y]], AT_BISON_CHECK([[-Dparse.lac.memory-trace=full input.y]],
[[1]], [], [[1]], [],
[[<command line>:1: error: %define variable 'parse.lac.memory-trace' is not used [[<command line>:2: error: %define variable 'parse.lac.memory-trace' is not used
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -1644,8 +1644,8 @@ AT_BISON_CHECK([[$2 input.y]], [[1]], [[]],
]) ])
AT_TEST([%define api.prefix foo %name-prefix "bar"], [], [input.y:1.9-18]) AT_TEST([%define api.prefix foo %name-prefix "bar"], [], [input.y:1.9-18])
AT_TEST([], [-Dapi.prefix=foo -p bar], [<command line>:1]) AT_TEST([], [-Dapi.prefix=foo -p bar], [<command line>:2])
AT_TEST([%name-prefix "bar"], [-Dapi.prefix=foo], [<command line>:1]) AT_TEST([%name-prefix "bar"], [-Dapi.prefix=foo], [<command line>:2])
AT_TEST([%define api.prefix foo], [-p bar], [input.y:1.9-18]) AT_TEST([%define api.prefix foo], [-p bar], [input.y:1.9-18])
m4_popdef([AT_TEST]) m4_popdef([AT_TEST])

View File

@@ -478,7 +478,7 @@ AT_BISON_CHECK_NO_XML($@)])
# -------------------------------------------------- # --------------------------------------------------
# Low-level macro to run bison once. # Low-level macro to run bison once.
m4_define([AT_BISON_CHECK_], m4_define([AT_BISON_CHECK_],
[AT_CHECK(AT_QUELL_VALGRIND[[ bison ]]$@)]) [AT_CHECK(AT_QUELL_VALGRIND[[ bison -fno-caret ]]$@)])
# AT_BISON_CHECK_WARNINGS(BISON_ARGS, [OTHER_AT_CHECK_ARGS]) # AT_BISON_CHECK_WARNINGS(BISON_ARGS, [OTHER_AT_CHECK_ARGS])
@@ -529,7 +529,7 @@ fi]dnl
# when a tortured grammar's XML is known to be too large for xsltproc to # when a tortured grammar's XML is known to be too large for xsltproc to
# handle. # handle.
m4_define([AT_BISON_CHECK_NO_XML], m4_define([AT_BISON_CHECK_NO_XML],
[AT_CHECK(m4_null_if([$2], [], [AT_QUELL_VALGRIND ])[[bison ]]$@) [AT_CHECK(m4_null_if([$2], [], [AT_QUELL_VALGRIND ])[[bison -fno-caret ]]$@)
AT_BISON_CHECK_WARNINGS($@)]) AT_BISON_CHECK_WARNINGS($@)])
# AT_BISON_CHECK_XML(BISON_ARGS, [OTHER_AT_CHECK_ARGS]) # AT_BISON_CHECK_XML(BISON_ARGS, [OTHER_AT_CHECK_ARGS])