From d5a3389886c9dc7f3492ef5369009c40d85b0f3c Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 13 Nov 2007 12:41:41 +0000 Subject: * 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 --- ruby.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 4285247005..51659e140a 100644 --- a/ruby.c +++ b/ruby.c @@ -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); -- cgit v1.2.3