mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
* 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
This commit is contained in:
parent
b7d363ead6
commit
d5a3389886
10 changed files with 85 additions and 56 deletions
8
ruby.c
8
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue