1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ruby.c (proc_options): moved do_print and do_loop options

handling from ruby_process_options().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-07-05 09:28:00 +00:00
parent 46603a78af
commit c5077a2c72
2 changed files with 13 additions and 10 deletions

View file

@ -1,10 +1,13 @@
Thu Jul 5 17:12:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Jul 5 18:27:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c, * include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c, eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline, yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables. ruby_nerrs): purge global variables.
* ruby.c (proc_options): moved do_print and do_loop options
handling from ruby_process_options().
Thu Jul 5 16:37:34 2007 NAKAMURA Usaku <usa@ruby-lang.org> Thu Jul 5 16:37:34 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* numeric.c (int_pow): fix previous nubu's commit. * numeric.c (int_pow): fix previous nubu's commit.

18
ruby.c
View file

@ -456,6 +456,8 @@ process_sflag(void)
sflag = 0; sflag = 0;
} }
NODE *rb_parser_append_print(VALUE, NODE *);
NODE *rb_parser_while_loop(VALUE, NODE *, int, int);
static NODE *proc_options(int argc, char **argv); static NODE *proc_options(int argc, char **argv);
static char * static char *
@ -881,6 +883,13 @@ proc_options(int argc, char **argv)
FL_UNSET(rb_load_path, FL_TAINT); FL_UNSET(rb_load_path, FL_TAINT);
} }
if (do_print) {
tree = rb_parser_append_print(parser, tree);
}
if (do_loop) {
tree = rb_parser_while_loop(parser, tree, do_line, do_split);
}
return tree; return tree;
} }
@ -1232,9 +1241,6 @@ ruby_set_argv(int argc, char **argv)
} }
} }
NODE *rb_parser_append_print(NODE *);
NODE *rb_parser_while_loop(NODE *, int, int);
void * void *
ruby_process_options(int argc, char **argv) ruby_process_options(int argc, char **argv)
{ {
@ -1255,11 +1261,5 @@ ruby_process_options(int argc, char **argv)
printf("Syntax OK\n"); printf("Syntax OK\n");
exit(0); exit(0);
} }
if (do_print) {
tree = rb_parser_append_print(tree);
}
if (do_loop) {
tree = rb_parser_while_loop(tree, do_line, do_split);
}
return tree; return tree;
} }