1 /* indent-tabs-mode: nil */
3 #include "internal/parse.h"
4 #include "internal/symbol.h"
5 #include "internal/warnings.h"
9 #include "ruby/encoding.h"
10 #include "ruby/util.h"
16 static VALUE rb_cNode
;
24 node_gc_mark(void *ptr
)
26 struct ASTNodeData
*data
= (struct ASTNodeData
*)ptr
;
27 rb_gc_mark((VALUE
)data
->ast
);
31 node_memsize(const void *ptr
)
33 struct ASTNodeData
*data
= (struct ASTNodeData
*)ptr
;
34 return rb_ast_memsize(data
->ast
);
37 static const rb_data_type_t rb_node_type
= {
39 {node_gc_mark
, RUBY_TYPED_DEFAULT_FREE
, node_memsize
,},
41 RUBY_TYPED_FREE_IMMEDIATELY
,
44 static VALUE
rb_ast_node_alloc(VALUE klass
);
47 setup_node(VALUE obj
, rb_ast_t
*ast
, const NODE
*node
)
49 struct ASTNodeData
*data
;
51 TypedData_Get_Struct(obj
, struct ASTNodeData
, &rb_node_type
, data
);
57 ast_new_internal(rb_ast_t
*ast
, const NODE
*node
)
61 obj
= rb_ast_node_alloc(rb_cNode
);
62 setup_node(obj
, ast
, node
);
67 static VALUE
rb_ast_parse_str(VALUE str
, VALUE keep_script_lines
);
68 static VALUE
rb_ast_parse_file(VALUE path
, VALUE keep_script_lines
);
73 return rb_parser_set_context(rb_parser_new(), NULL
, 0);
77 ast_parse_done(rb_ast_t
*ast
)
79 if (!ast
->body
.root
) {
81 rb_exc_raise(GET_EC()->errinfo
);
84 return ast_new_internal(ast
, (NODE
*)ast
->body
.root
);
88 ast_s_parse(rb_execution_context_t
*ec
, VALUE module
, VALUE str
, VALUE keep_script_lines
)
90 return rb_ast_parse_str(str
, keep_script_lines
);
94 rb_ast_parse_str(VALUE str
, VALUE keep_script_lines
)
99 VALUE vparser
= ast_parse_new();
100 if (RTEST(keep_script_lines
)) rb_parser_keep_script_lines(vparser
);
101 ast
= rb_parser_compile_string_path(vparser
, Qnil
, str
, 1);
102 return ast_parse_done(ast
);
106 ast_s_parse_file(rb_execution_context_t
*ec
, VALUE module
, VALUE path
, VALUE keep_script_lines
)
108 return rb_ast_parse_file(path
, keep_script_lines
);
112 rb_ast_parse_file(VALUE path
, VALUE keep_script_lines
)
116 rb_encoding
*enc
= rb_utf8_encoding();
119 f
= rb_file_open_str(path
, "r");
120 rb_funcall(f
, rb_intern("set_encoding"), 2, rb_enc_from_encoding(enc
), rb_str_new_cstr("-"));
121 VALUE vparser
= ast_parse_new();
122 if (RTEST(keep_script_lines
)) rb_parser_keep_script_lines(vparser
);
123 ast
= rb_parser_compile_file_path(vparser
, Qnil
, f
, 1);
125 return ast_parse_done(ast
);
129 lex_array(VALUE array
, int index
)
131 VALUE str
= rb_ary_entry(array
, index
);
134 if (!rb_enc_asciicompat(rb_enc_get(str
))) {
135 rb_raise(rb_eArgError
, "invalid source encoding");
142 rb_ast_parse_array(VALUE array
, VALUE keep_script_lines
)
146 array
= rb_check_array_type(array
);
147 VALUE vparser
= ast_parse_new();
148 if (RTEST(keep_script_lines
)) rb_parser_keep_script_lines(vparser
);
149 ast
= rb_parser_compile_generic(vparser
, lex_array
, Qnil
, array
, 1);
150 return ast_parse_done(ast
);
153 static VALUE
node_children(rb_ast_t
*, const NODE
*);
156 node_find(VALUE self
, const int node_id
)
160 struct ASTNodeData
*data
;
161 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
163 if (nd_node_id(data
->node
) == node_id
) return self
;
165 ary
= node_children(data
->ast
, data
->node
);
167 for (i
= 0; i
< RARRAY_LEN(ary
); i
++) {
168 VALUE child
= RARRAY_AREF(ary
, i
);
170 if (CLASS_OF(child
) == rb_cNode
) {
171 VALUE result
= node_find(child
, node_id
);
172 if (RTEST(result
)) return result
;
179 extern VALUE rb_e_script
;
182 script_lines(VALUE path
)
186 CONST_ID(script_lines
, "SCRIPT_LINES__");
187 if (!rb_const_defined_at(rb_cObject
, script_lines
)) return Qnil
;
188 hash
= rb_const_get_at(rb_cObject
, script_lines
);
189 if (!RB_TYPE_P(hash
, T_HASH
)) return Qnil
;
190 lines
= rb_hash_lookup(hash
, path
);
191 if (!RB_TYPE_P(lines
, T_ARRAY
)) return Qnil
;
196 ast_s_of(rb_execution_context_t
*ec
, VALUE module
, VALUE body
, VALUE keep_script_lines
)
198 VALUE node
, lines
= Qnil
;
199 const rb_iseq_t
*iseq
;
202 if (rb_frame_info_p(body
)) {
203 iseq
= rb_get_iseq_from_frame_info(body
);
204 node_id
= rb_get_node_id_from_frame_info(body
);
209 if (rb_obj_is_proc(body
)) {
210 iseq
= vm_proc_iseq(body
);
212 if (!rb_obj_is_iseq((VALUE
)iseq
)) return Qnil
;
215 iseq
= rb_method_iseq(body
);
218 node_id
= iseq
->body
->location
.node_id
;
225 lines
= iseq
->body
->variable
.script_lines
;
227 VALUE path
= rb_iseq_path(iseq
);
228 int e_option
= RSTRING_LEN(path
) == 2 && memcmp(RSTRING_PTR(path
), "-e", 2) == 0;
230 if (NIL_P(lines
) && rb_iseq_from_eval_p(iseq
) && !e_option
) {
231 rb_raise(rb_eArgError
, "cannot get AST for method defined in eval");
234 if (!NIL_P(lines
) || !NIL_P(lines
= script_lines(path
))) {
235 node
= rb_ast_parse_array(lines
, keep_script_lines
);
238 node
= rb_ast_parse_str(rb_e_script
, keep_script_lines
);
241 node
= rb_ast_parse_file(path
, keep_script_lines
);
244 return node_find(node
, node_id
);
248 rb_ast_node_alloc(VALUE klass
)
250 struct ASTNodeData
*data
;
251 VALUE obj
= TypedData_Make_Struct(klass
, struct ASTNodeData
, &rb_node_type
, data
);
257 node_type_to_str(const NODE
*node
)
259 return (ruby_node_name(nd_type(node
)) + rb_strlen_lit("NODE_"));
263 ast_node_type(rb_execution_context_t
*ec
, VALUE self
)
265 struct ASTNodeData
*data
;
266 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
268 return rb_sym_intern_ascii_cstr(node_type_to_str(data
->node
));
272 ast_node_node_id(rb_execution_context_t
*ec
, VALUE self
)
274 struct ASTNodeData
*data
;
275 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
277 return INT2FIX(nd_node_id(data
->node
));
280 #define NEW_CHILD(ast, node) node ? ast_new_internal(ast, node) : Qnil
283 rb_ary_new_from_node_args(rb_ast_t
*ast
, long n
, ...)
289 ary
= rb_ary_new2(n
);
292 for (i
=0; i
<n
; i
++) {
294 node
= va_arg(ar
, NODE
*);
295 rb_ary_push(ary
, NEW_CHILD(ast
, node
));
302 dump_block(rb_ast_t
*ast
, const NODE
*node
)
304 VALUE ary
= rb_ary_new();
306 rb_ary_push(ary
, NEW_CHILD(ast
, node
->nd_head
));
307 } while (node
->nd_next
&&
308 nd_type_p(node
->nd_next
, NODE_BLOCK
) &&
309 (node
= node
->nd_next
, 1));
311 rb_ary_push(ary
, NEW_CHILD(ast
, node
->nd_next
));
318 dump_array(rb_ast_t
*ast
, const NODE
*node
)
320 VALUE ary
= rb_ary_new();
321 rb_ary_push(ary
, NEW_CHILD(ast
, node
->nd_head
));
323 while (node
->nd_next
&& nd_type_p(node
->nd_next
, NODE_LIST
)) {
324 node
= node
->nd_next
;
325 rb_ary_push(ary
, NEW_CHILD(ast
, node
->nd_head
));
327 rb_ary_push(ary
, NEW_CHILD(ast
, node
->nd_next
));
335 if (!id
) return Qnil
;
336 if (!rb_id2str(id
)) return Qnil
;
344 CONST_ID(rest
, "NODE_SPECIAL_NO_NAME_REST");
349 rest_arg(rb_ast_t
*ast
, const NODE
*rest_arg
)
351 return NODE_NAMED_REST_P(rest_arg
) ? NEW_CHILD(ast
, rest_arg
) : no_name_rest();
355 node_children(rb_ast_t
*ast
, const NODE
*node
)
357 char name
[DECIMAL_SIZE_OF_BITS(sizeof(long) * CHAR_BIT
) + 2]; /* including '$' */
359 enum node_type type
= nd_type(node
);
362 return dump_block(ast
, node
);
364 return rb_ary_new_from_node_args(ast
, 3, node
->nd_cond
, node
->nd_body
, node
->nd_else
);
366 return rb_ary_new_from_node_args(ast
, 3, node
->nd_cond
, node
->nd_body
, node
->nd_else
);
368 return rb_ary_new_from_node_args(ast
, 2, node
->nd_head
, node
->nd_body
);
370 return rb_ary_new_from_node_args(ast
, 2, node
->nd_head
, node
->nd_body
);
372 return rb_ary_new_from_node_args(ast
, 2, node
->nd_head
, node
->nd_body
);
374 return rb_ary_new_from_node_args(ast
, 3, node
->nd_head
, node
->nd_body
, node
->nd_next
);
376 return rb_ary_new_from_node_args(ast
, 3, node
->nd_head
, node
->nd_body
, node
->nd_next
);
379 return rb_ary_push(rb_ary_new_from_node_args(ast
, 2, node
->nd_cond
, node
->nd_body
),
380 RBOOL(node
->nd_state
));
383 return rb_ary_new_from_node_args(ast
, 2, node
->nd_iter
, node
->nd_body
);
385 return rb_ary_new_from_node_args(ast
, 1, node
->nd_var
);
389 return rb_ary_new_from_node_args(ast
, 1, node
->nd_stts
);
391 return rb_ary_new_from_node_args(ast
, 0);
393 return rb_ary_new_from_node_args(ast
, 0);
395 return rb_ary_new_from_node_args(ast
, 1, node
->nd_body
);
397 return rb_ary_new_from_node_args(ast
, 3, node
->nd_head
, node
->nd_resq
, node
->nd_else
);
399 return rb_ary_new_from_node_args(ast
, 3, node
->nd_args
, node
->nd_body
, node
->nd_head
);
401 return rb_ary_new_from_node_args(ast
, 2, node
->nd_head
, node
->nd_ensr
);
405 VALUE ary
= rb_ary_new();
408 rb_ary_push(ary
, NEW_CHILD(ast
, node
->nd_1st
));
409 if (!node
->nd_2nd
|| !nd_type_p(node
->nd_2nd
, type
))
413 rb_ary_push(ary
, NEW_CHILD(ast
, node
->nd_2nd
));
417 if (NODE_NAMED_REST_P(node
->nd_args
)) {
418 return rb_ary_new_from_node_args(ast
, 3, node
->nd_value
, node
->nd_head
, node
->nd_args
);
421 return rb_ary_new_from_args(3, NEW_CHILD(ast
, node
->nd_value
),
422 NEW_CHILD(ast
, node
->nd_head
),
430 if (NODE_REQUIRED_KEYWORD_P(node
)) {
431 return rb_ary_new_from_args(2, var_name(node
->nd_vid
), ID2SYM(rb_intern("NODE_SPECIAL_REQUIRED_KEYWORD")));
433 return rb_ary_new_from_args(2, var_name(node
->nd_vid
), NEW_CHILD(ast
, node
->nd_value
));
436 return rb_ary_new_from_args(2, ID2SYM(node
->nd_vid
), NEW_CHILD(ast
, node
->nd_value
));
438 return rb_ary_new_from_args(3, NEW_CHILD(ast
, node
->nd_else
), ID2SYM(node
->nd_else
->nd_mid
), NEW_CHILD(ast
, node
->nd_value
));
440 return rb_ary_new_from_args(4, NEW_CHILD(ast
, node
->nd_recv
),
441 ID2SYM(node
->nd_mid
),
442 NEW_CHILD(ast
, node
->nd_args
->nd_head
),
443 NEW_CHILD(ast
, node
->nd_args
->nd_body
));
445 return rb_ary_new_from_args(5, NEW_CHILD(ast
, node
->nd_recv
),
446 RBOOL(node
->nd_next
->nd_aid
),
447 ID2SYM(node
->nd_next
->nd_vid
),
448 ID2SYM(node
->nd_next
->nd_mid
),
449 NEW_CHILD(ast
, node
->nd_value
));
450 case NODE_OP_ASGN_AND
:
451 return rb_ary_new_from_args(3, NEW_CHILD(ast
, node
->nd_head
), ID2SYM(idANDOP
),
452 NEW_CHILD(ast
, node
->nd_value
));
453 case NODE_OP_ASGN_OR
:
454 return rb_ary_new_from_args(3, NEW_CHILD(ast
, node
->nd_head
), ID2SYM(idOROP
),
455 NEW_CHILD(ast
, node
->nd_value
));
457 return rb_ary_new_from_args(3, NEW_CHILD(ast
, node
->nd_head
),
458 ID2SYM(node
->nd_aid
),
459 NEW_CHILD(ast
, node
->nd_value
));
463 return rb_ary_new_from_args(3, NEW_CHILD(ast
, node
->nd_recv
),
464 ID2SYM(node
->nd_mid
),
465 NEW_CHILD(ast
, node
->nd_args
));
467 return rb_ary_new_from_args(2, ID2SYM(node
->nd_mid
),
468 NEW_CHILD(ast
, node
->nd_args
));
470 return rb_ary_new_from_args(1, ID2SYM(node
->nd_mid
));
472 return rb_ary_new_from_node_args(ast
, 1, node
->nd_args
);
474 return rb_ary_new_from_node_args(ast
, 0);
477 return dump_array(ast
, node
);
479 return rb_ary_new_from_node_args(ast
, 0);
481 return rb_ary_new_from_node_args(ast
, 1, node
->nd_head
);
483 return rb_ary_new_from_node_args(ast
, 1, node
->nd_head
);
486 return rb_ary_new_from_args(1, var_name(node
->nd_vid
));
491 return rb_ary_new_from_args(1, ID2SYM(node
->nd_vid
));
493 snprintf(name
, sizeof(name
), "$%ld", node
->nd_nth
);
494 return rb_ary_new_from_args(1, ID2SYM(rb_intern(name
)));
497 name
[1] = (char)node
->nd_nth
;
499 return rb_ary_new_from_args(1, ID2SYM(rb_intern(name
)));
502 return rb_ary_new_from_node_args(ast
, 3, node
->nd_recv
, node
->nd_value
, node
->nd_args
);
504 return rb_ary_new_from_node_args(ast
, 2, node
->nd_recv
, node
->nd_value
);
506 return rb_ary_new_from_node_args(ast
, 2, node
->nd_recv
, node
->nd_value
);
511 return rb_ary_new_from_args(1, node
->nd_lit
);
513 return rb_ary_new_from_node_args(ast
, 1, node
->nd_body
);
519 NODE
*n
= node
->nd_next
;
520 VALUE head
= Qnil
, next
= Qnil
;
522 head
= NEW_CHILD(ast
, n
->nd_head
);
523 next
= NEW_CHILD(ast
, n
->nd_next
);
525 return rb_ary_new_from_args(3, node
->nd_lit
, head
, next
);
528 return rb_ary_new_from_node_args(ast
, 1, node
->nd_body
);
530 return rb_ary_new_from_node_args(ast
, 2, node
->nd_head
, node
->nd_body
);
532 return rb_ary_new_from_node_args(ast
, 2, node
->nd_head
, node
->nd_body
);
534 return rb_ary_new_from_node_args(ast
, 1, node
->nd_head
);
535 case NODE_BLOCK_PASS
:
536 return rb_ary_new_from_node_args(ast
, 2, node
->nd_head
, node
->nd_body
);
538 return rb_ary_new_from_args(2, ID2SYM(node
->nd_mid
), NEW_CHILD(ast
, node
->nd_defn
));
540 return rb_ary_new_from_args(3, NEW_CHILD(ast
, node
->nd_recv
), ID2SYM(node
->nd_mid
), NEW_CHILD(ast
, node
->nd_defn
));
542 return rb_ary_new_from_node_args(ast
, 2, node
->nd_1st
, node
->nd_2nd
);
544 return rb_ary_new_from_args(2, ID2SYM(node
->nd_alias
), ID2SYM(node
->nd_orig
));
546 return rb_ary_new_from_node_args(ast
, 1, node
->nd_undef
);
548 return rb_ary_new_from_node_args(ast
, 3, node
->nd_cpath
, node
->nd_super
, node
->nd_body
);
550 return rb_ary_new_from_node_args(ast
, 2, node
->nd_cpath
, node
->nd_body
);
552 return rb_ary_new_from_node_args(ast
, 2, node
->nd_recv
, node
->nd_body
);
554 return rb_ary_new_from_args(2, NEW_CHILD(ast
, node
->nd_head
), ID2SYM(node
->nd_mid
));
556 return rb_ary_new_from_args(1, ID2SYM(node
->nd_mid
));
561 return rb_ary_new_from_node_args(ast
, 2, node
->nd_beg
, node
->nd_end
);
563 return rb_ary_new_from_node_args(ast
, 0);
565 return rb_ary_new_from_node_args(ast
, 0);
567 return rb_ary_new_from_node_args(ast
, 0);
569 return rb_ary_new_from_node_args(ast
, 0);
571 return rb_ary_new_from_node_args(ast
, 0);
573 return rb_ary_new_from_node_args(ast
, 1, node
->nd_head
);
575 return rb_ary_new_from_node_args(ast
, 1, node
->nd_body
);
577 return rb_ary_new_from_args(3, NEW_CHILD(ast
, node
->nd_recv
), ID2SYM(node
->nd_mid
), NEW_CHILD(ast
, node
->nd_args
));
579 return rb_ary_new_from_node_args(ast
, 1, node
->nd_body
);
581 return rb_ary_new_from_node_args(ast
, 2, node
->nd_body
, node
->nd_next
);
583 return rb_ary_new_from_node_args(ast
, 2, node
->nd_body
, node
->nd_next
);
585 if (NODE_NAMED_REST_P(node
->nd_1st
)) {
586 return rb_ary_new_from_node_args(ast
, 2, node
->nd_1st
, node
->nd_2nd
);
588 return rb_ary_new_from_args(2, no_name_rest(),
589 NEW_CHILD(ast
, node
->nd_2nd
));
592 struct rb_args_info
*ainfo
= node
->nd_ainfo
;
593 return rb_ary_new_from_args(10,
594 INT2NUM(ainfo
->pre_args_num
),
595 NEW_CHILD(ast
, ainfo
->pre_init
),
596 NEW_CHILD(ast
, ainfo
->opt_args
),
597 var_name(ainfo
->first_post_arg
),
598 INT2NUM(ainfo
->post_args_num
),
599 NEW_CHILD(ast
, ainfo
->post_init
),
600 (ainfo
->rest_arg
== NODE_SPECIAL_EXCESSIVE_COMMA
601 ? ID2SYM(rb_intern("NODE_SPECIAL_EXCESSIVE_COMMA"))
602 : var_name(ainfo
->rest_arg
)),
603 (ainfo
->no_kwarg
? Qfalse
: NEW_CHILD(ast
, ainfo
->kw_args
)),
604 (ainfo
->no_kwarg
? Qfalse
: NEW_CHILD(ast
, ainfo
->kw_rest_arg
)),
605 var_name(ainfo
->block_arg
));
609 rb_ast_id_table_t
*tbl
= node
->nd_tbl
;
610 int i
, size
= tbl
? tbl
->size
: 0;
611 VALUE locals
= rb_ary_new_capa(size
);
612 for (i
= 0; i
< size
; i
++) {
613 rb_ary_push(locals
, var_name(tbl
->ids
[i
]));
615 return rb_ary_new_from_args(3, locals
, NEW_CHILD(ast
, node
->nd_args
), NEW_CHILD(ast
, node
->nd_body
));
619 struct rb_ary_pattern_info
*apinfo
= node
->nd_apinfo
;
620 VALUE rest
= rest_arg(ast
, apinfo
->rest_arg
);
621 return rb_ary_new_from_args(4,
622 NEW_CHILD(ast
, node
->nd_pconst
),
623 NEW_CHILD(ast
, apinfo
->pre_args
),
625 NEW_CHILD(ast
, apinfo
->post_args
));
629 struct rb_fnd_pattern_info
*fpinfo
= node
->nd_fpinfo
;
630 VALUE pre_rest
= rest_arg(ast
, fpinfo
->pre_rest_arg
);
631 VALUE post_rest
= rest_arg(ast
, fpinfo
->post_rest_arg
);
632 return rb_ary_new_from_args(4,
633 NEW_CHILD(ast
, node
->nd_pconst
),
635 NEW_CHILD(ast
, fpinfo
->args
),
640 VALUE kwrest
= node
->nd_pkwrestarg
== NODE_SPECIAL_NO_REST_KEYWORD
? ID2SYM(rb_intern("NODE_SPECIAL_NO_REST_KEYWORD")) :
641 NEW_CHILD(ast
, node
->nd_pkwrestarg
);
643 return rb_ary_new_from_args(3,
644 NEW_CHILD(ast
, node
->nd_pconst
),
645 NEW_CHILD(ast
, node
->nd_pkwargs
),
653 rb_bug("node_children: unknown node: %s", ruby_node_name(type
));
657 ast_node_children(rb_execution_context_t
*ec
, VALUE self
)
659 struct ASTNodeData
*data
;
660 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
662 return node_children(data
->ast
, data
->node
);
666 ast_node_first_lineno(rb_execution_context_t
*ec
, VALUE self
)
668 struct ASTNodeData
*data
;
669 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
671 return INT2NUM(nd_first_lineno(data
->node
));
675 ast_node_first_column(rb_execution_context_t
*ec
, VALUE self
)
677 struct ASTNodeData
*data
;
678 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
680 return INT2NUM(nd_first_column(data
->node
));
684 ast_node_last_lineno(rb_execution_context_t
*ec
, VALUE self
)
686 struct ASTNodeData
*data
;
687 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
689 return INT2NUM(nd_last_lineno(data
->node
));
693 ast_node_last_column(rb_execution_context_t
*ec
, VALUE self
)
695 struct ASTNodeData
*data
;
696 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
698 return INT2NUM(nd_last_column(data
->node
));
702 ast_node_inspect(rb_execution_context_t
*ec
, VALUE self
)
706 struct ASTNodeData
*data
;
707 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
709 cname
= rb_class_path(rb_obj_class(self
));
710 str
= rb_str_new2("#<");
712 rb_str_append(str
, cname
);
713 rb_str_catf(str
, ":%s@%d:%d-%d:%d>",
714 node_type_to_str(data
->node
),
715 nd_first_lineno(data
->node
), nd_first_column(data
->node
),
716 nd_last_lineno(data
->node
), nd_last_column(data
->node
));
722 ast_node_script_lines(rb_execution_context_t
*ec
, VALUE self
)
724 struct ASTNodeData
*data
;
725 TypedData_Get_Struct(self
, struct ASTNodeData
, &rb_node_type
, data
);
726 VALUE ret
= data
->ast
->body
.script_lines
;
727 if (!RB_TYPE_P(ret
, T_ARRAY
)) return Qnil
;
736 rb_mAST
= rb_define_module_under(rb_cRubyVM
, "AbstractSyntaxTree");
737 rb_cNode
= rb_define_class_under(rb_mAST
, "Node", rb_cObject
);
738 rb_undef_alloc_func(rb_cNode
);