X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/5a893c2b262ca9cb1ab0385c776ce933f2f48533..6c88b51e8395fe490c15ede2f1b2562258a4260d:/src/getargs.c diff --git a/src/getargs.c b/src/getargs.c index c36cabfd..2a0611bc 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -72,9 +72,9 @@ static struct bison_language const valid_languages[] = { { "", "", "", "", false } }; -static int skeleton_prio = 2; +int skeleton_prio = default_prio; const char *skeleton = NULL; -static int language_prio = 2; +int language_prio = default_prio; struct bison_language const *language = &valid_languages[0]; const char *include = NULL; @@ -176,6 +176,7 @@ static const char * const trace_args[] = "grammar - reading, reducing the grammar", "resource - memory consumption (where available)", "sets - grammar sets: firsts, nullable etc.", + "muscles - m4 definitions passed to the skeleton", "tools - m4 invocation", "m4 - m4 traces", "skeleton - skeleton postprocessing", @@ -194,6 +195,7 @@ static const int trace_types[] = trace_grammar, trace_resource, trace_sets, + trace_muscles, trace_tools, trace_m4, trace_skeleton, @@ -497,7 +499,7 @@ static struct option const long_options[] = /* Build a location for the current command line argument. */ static location -command_line_location() +command_line_location (void) { location res; /* "" is used in GCC's messages about -D. */ @@ -529,9 +531,8 @@ getargs (int argc, char *argv[]) char* value = strchr (optarg, '='); if (value) *value++ = 0; - else - value = ""; - muscle_percent_define_insert (name, command_line_location (), value); + muscle_percent_define_insert (name, command_line_location (), + value ? value : ""); } break; @@ -540,11 +541,13 @@ getargs (int argc, char *argv[]) break; case 'L': - language_argmatch (optarg, 0, command_line_location ()); + language_argmatch (optarg, command_line_prio, + command_line_location ()); break; case 'S': - skeleton_arg (AS_FILE_NAME (optarg), 0, command_line_location ()); + skeleton_arg (AS_FILE_NAME (optarg), command_line_prio, + command_line_location ()); break; case 'T':