diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-24 06:57:09 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-24 06:57:09 -0700 |
commit | af8709c031d7f0b7d61872536922d3acf16180c5 (patch) | |
tree | c61a1d5c4eb7fdf06c024303b77fd174ac033b11 /txr.c | |
parent | 4e3e4e1ccc60331ff8ff4c1c139e9da3c95e2272 (diff) | |
download | txr-af8709c031d7f0b7d61872536922d3acf16180c5.tar.gz txr-af8709c031d7f0b7d61872536922d3acf16180c5.tar.bz2 txr-af8709c031d7f0b7d61872536922d3acf16180c5.zip |
New --yydebug option.
* parser.y (have_yydebug): New global constant.
(yydebug_onoff): New function.
* parser.h (have_yydebug, yydebug_onof): Declared.
(yydebug_onoff): New function.
* txr.c (help): List --yydebug option.
(txr_main): --yydebug option implemented.
Diffstat (limited to 'txr.c')
-rw-r--r-- | txr.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -148,6 +148,7 @@ static void help(void) "--gc-delta=N Invoke garbage collection when malloc activity\n" " increments by N megabytes since last collection.\n" "--debug-autoload Allow debugger to step through library auto-loading.\n" +"--yydebug Debug Yacc parser, if compiled with YYDEBUG support.\n" "\n" "Options that take no argument can be combined. The -q and -v options\n" "are mutually exclusive; the right-most one dominates.\n" @@ -525,6 +526,19 @@ int txr_main(int argc, char **argv) no_dbg_support(opt); return EXIT_FAILURE; #endif + } else if (equal(opt, lit("yydebug"))) { + if (have_yydebug) { + yydebug_onoff(1); + format(std_error, + lit("~a: option --~a takes no argument, ~a given\n"), + prog_string, opt, org, nao); + continue; + } else { + format(std_error, + lit("~a: option ~a requires YYDEBUG support compiled in\n"), + prog_string, arg, nao); + return EXIT_FAILURE; + } } else if (equal(opt, lit("noninteractive"))) { opt_noninteractive = 1; stream_set_prop(std_input, real_time_k, nil); |