X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/d782395d52519fabb2cac3bd479246cc6de7efa8..ef1b427325c10362bd5880c22de310ed96dbc235:/src/parse-gram.y diff --git a/src/parse-gram.y b/src/parse-gram.y index e50ec271..9c59e737 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -266,7 +266,19 @@ prologue_declaration: | "%output" STRING { spec_outfile = $2; } | "%output" "=" STRING { spec_outfile = $3; } /* deprecated */ | "%parse-param" "{...}" { add_param ("parse_param", $2, @2); } -| "%pure-parser" { pure_parser = true; } +| "%pure-parser" + { + /* %pure-parser is deprecated in favor of `%define api.pure', so use + `%define api.pure' in a backward-compatible manner here. First, don't + complain if %pure-parser is specified multiple times. */ + if (!muscle_find_const ("percent_define(api.pure)")) + muscle_percent_define_insert ("api.pure", @1, ""); + /* In all cases, use api.pure now so that the backend doesn't complain if + the skeleton ignores api.pure, but do warn now if there's a previous + conflicting definition from an actual %define. */ + if (!muscle_percent_define_flag_if ("api.pure")) + muscle_percent_define_insert ("api.pure", @1, ""); + } | "%require" STRING { version_check (&@2, $2); } | "%skeleton" STRING { @@ -293,7 +305,7 @@ prologue_declaration: skeleton_arg (skeleton_user, 1, &@1); } | "%token-table" { token_table_flag = true; } -| "%verbose" { report_flag = report_states; } +| "%verbose" { report_flag |= report_states; } | "%yacc" { yacc_flag = true; } | /*FIXME: Err? What is this horror doing here? */ ";" ;