mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Issue directives for IDE/editors to fix the source file. http://clang.llvm.org/docs/UsersManual.html#cmdoption-fdiagnostics-parseable-fixits Do it for deprecated features. For instance: $ cat foo.y %error-verbose %name-prefix = "foo" %name-prefix="bar" %define parser_class_name "Parser" %% exp:; $ LC_ALL=C ./_build/8d/tests/bison -ffixit /tmp/foo.yy /tmp/foo.yy:1.1-14: warning: deprecated directive, use '%define parse.error verbose' [-Wdeprecated] %error-verbose ^^^^^^^^^^^^^^ fix-it:"/tmp/foo.yy":{1:1-1:15}:"%define parse.error verbose" /tmp/foo.yy:3.1-20: warning: deprecated directive, use '%define api.prefix {foo}' [-Wdeprecated] %name-prefix = "foo" ^^^^^^^^^^^^^^^^^^^^ fix-it:"/tmp/foo.yy":{3:1-3:21}:"%define api.prefix {foo}" /tmp/foo.yy:4.1-18: warning: deprecated directive, use '%define api.prefix {bar}' [-Wdeprecated] %name-prefix="bar" ^^^^^^^^^^^^^^^^^^ fix-it:"/tmp/foo.yy":{4:1-4:19}:"%define api.prefix {bar}" /tmp/foo.yy:5.9-25: warning: deprecated directive, use '%define api.parser.class {Parser}' [-Wdeprecated] %define parser_class_name "Parser" ^^^^^^^^^^^^^^^^^ fix-it:"/tmp/foo.yy":{5:9-5:26}:"%define api.parser.class {Parser}" /tmp/foo.yy:5.9-25: error: %define variable 'api.parser.class' is not used %define parser_class_name "Parser" ^^^^^^^^^^^^^^^^^ * src/getargs.h, src/getargs.c (feature_fixit_parsable): New. (feature_types, feature_args): Use it. * src/complain.c (deprecated_directive): Use it. * tests/input.at: Check it.