mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (rb_parser_append_print, rb_parser_while_loop): moved check
for node to the head. * ruby.c (proc_options): do nothing for -p/-n options if tree is null. submitted by Yusuke ENDOH <mame AT tsg.ne.jp> at [ruby-dev:31243]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
73c8156360
commit
233221db60
3 changed files with 16 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
|||
Wed Jul 18 09:19:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (rb_parser_append_print, rb_parser_while_loop): moved check
|
||||
for node to the head.
|
||||
|
||||
* ruby.c (proc_options): do nothing for -p/-n options if tree is null.
|
||||
submitted by Yusuke ENDOH <mame AT tsg.ne.jp> at [ruby-dev:31243].
|
||||
|
||||
Wed Jul 18 08:47:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* time.c (time_succ): Time#succ should return a time object in the
|
||||
|
|
8
parse.y
8
parse.y
|
@ -8110,11 +8110,13 @@ rb_parser_append_print(VALUE vparser, NODE *node)
|
|||
NODE *scope = node;
|
||||
struct parser_params *parser;
|
||||
|
||||
if (!node) return node;
|
||||
|
||||
Data_Get_Struct(vparser, struct parser_params, parser);
|
||||
|
||||
node = node->nd_body;
|
||||
|
||||
if (node && (nd_type(node) == NODE_PRELUDE)) {
|
||||
if (nd_type(node) == NODE_PRELUDE) {
|
||||
prelude = node;
|
||||
node = node->nd_body;
|
||||
}
|
||||
|
@ -8140,11 +8142,13 @@ rb_parser_while_loop(VALUE vparser, NODE *node, int chop, int split)
|
|||
NODE *scope = node;
|
||||
struct parser_params *parser;
|
||||
|
||||
if (!node) return node;
|
||||
|
||||
Data_Get_Struct(vparser, struct parser_params, parser);
|
||||
|
||||
node = node->nd_body;
|
||||
|
||||
if (node && (nd_type(node) == NODE_PRELUDE)) {
|
||||
if (nd_type(node) == NODE_PRELUDE) {
|
||||
prelude = node;
|
||||
node = node->nd_body;
|
||||
}
|
||||
|
|
4
ruby.c
4
ruby.c
|
@ -883,10 +883,10 @@ proc_options(int argc, char **argv)
|
|||
FL_UNSET(rb_load_path, FL_TAINT);
|
||||
}
|
||||
|
||||
if (do_print) {
|
||||
if (tree && do_print) {
|
||||
tree = rb_parser_append_print(parser, tree);
|
||||
}
|
||||
if (do_loop) {
|
||||
if (tree && do_loop) {
|
||||
tree = rb_parser_while_loop(parser, tree, do_line, do_split);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue