diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-13 12:41:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-13 12:41:41 +0000 |
commit | d5a3389886c9dc7f3492ef5369009c40d85b0f3c (patch) | |
tree | 884508c6b44f073721c42f5d54e667a3f82d32fb /ruby.c | |
parent | b7d363ead696a2f1143c547d71d0242b1402c9f6 (diff) | |
download | ruby-d5a3389886c9dc7f3492ef5369009c40d85b0f3c.tar.gz |
* common.mk (parse.c), ext/ripper/depend (ripper.c): process after
bison with sed. [ruby-dev:32204]
* ruby.c (proc_options): use yydebug in cmdline_options.
* ruby.c (process_options): set yydebug flag of parser.
* parse.y (yydebug): moved into struct parser_params.
* parse.y (rb_parser_get_yydebug, rb_parser_set_yydebug): parser
generic methods.
* */Makefile.sub (parse.c): moved to common.mk.
* tool/ytab.sed: comment out yydebug definition, and substitute
yyerror with parser_yyerror.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -61,7 +61,8 @@ char *getenv(); /* TODO: move to VM */ VALUE ruby_debug = Qfalse; VALUE ruby_verbose = Qfalse; -extern int ruby_yydebug; +VALUE rb_parser_get_yydebug(VALUE); +VALUE rb_parser_set_yydebug(VALUE, VALUE); char *ruby_inplace_mode = 0; @@ -593,7 +594,7 @@ proc_options(int argc, char **argv, struct cmdline_options *opt) goto reswitch; case 'y': - ruby_yydebug = 1; + opt->yydebug = 1; s++; goto reswitch; @@ -838,7 +839,7 @@ proc_options(int argc, char **argv, struct cmdline_options *opt) ruby_verbose = Qtrue; } else if (strcmp("yydebug", s) == 0) - ruby_yydebug = 1; + opt->yydebug = 1; else if (strcmp("help", s) == 0) { usage(origarg.argv[0]); rb_exit(EXIT_SUCCESS); @@ -993,6 +994,7 @@ process_options(VALUE arg) ruby_init_loadpath(); ruby_init_gems(opt); parser = rb_parser_new(); + if (opt->yydebug) rb_parser_set_yydebug(parser, Qtrue); if (opt->e_script) { if (opt->enc_index >= 0) rb_enc_associate_index(opt->e_script, opt->enc_index); |