summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-05 08:59:23 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-05 08:59:23 +0000
commit38c62063c085ddf592461435bfa379de91851e65 (patch)
treea035fb1f593f07c04e8c9cad8eca3b92d1d60398 /node.c
parent92b81dc5972607f745d26b8a7a83166ff0fa354b (diff)
node.h: remove NODE_PRELUDE
NODE_PRELUDE contains a `BEGIN` node, a main node, and compile_option. This node is assumed that it must be located immediately under the root NODE_SCOPE, but this strange assumption is not so good, IMO. This change removes the assumtion; it integrates the former two nodes by block_append, and moves compile_option into rb_ast_body_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'node.c')
-rw-r--r--node.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/node.c b/node.c
index 072f4f57b3..042d4724f6 100644
--- a/node.c
+++ b/node.c
@@ -101,37 +101,6 @@ struct add_option_arg {
st_index_t count;
};
-static int
-add_option_i(VALUE key, VALUE val, VALUE args)
-{
- struct add_option_arg *argp = (void *)args;
- VALUE buf = argp->buf;
- VALUE indent = argp->indent;
-
- A_INDENT;
- A("+- ");
- AR(rb_sym2str(key));
- A(": ");
- A_LIT(val);
- A("\n");
- return ST_CONTINUE;
-}
-
-static void
-dump_option(VALUE buf, VALUE indent, VALUE opt)
-{
- struct add_option_arg arg;
-
- if (!RB_TYPE_P(opt, T_HASH)) {
- A_LIT(opt);
- return;
- }
- arg.buf = buf;
- arg.indent = indent;
- arg.count = 0;
- rb_hash_foreach(opt, add_option_i, (VALUE)&arg);
-}
-
static void dump_node(VALUE, VALUE, int, const NODE *);
static const char default_indent[] = "| ";
@@ -960,19 +929,6 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
F_NODE(nd_args, "arguments");
return;
- case NODE_PRELUDE:
- ANN("pre-execution");
- ANN("format: BEGIN { [nd_head] }; [nd_body]");
- ANN("example: bar; BEGIN { foo }");
- F_NODE(nd_head, "prelude");
- if (!node->nd_compile_option) LAST_NODE;
- F_NODE(nd_body, "body");
- if (node->nd_compile_option) {
- LAST_NODE;
- F_OPTION(nd_compile_option, "compile_option");
- }
- return;
-
case NODE_LAMBDA:
ANN("lambda expression");
ANN("format: -> [nd_body]");