14#include "internal/variable.h"
18#define NODE_BUF_DEFAULT_LEN 16
20#define A(str) rb_str_cat2(buf, (str))
21#define AR(str) rb_str_concat(buf, (str))
23#define A_INDENT add_indent(buf, indent)
24#define D_INDENT rb_str_cat2(indent, next_indent)
25#define D_DEDENT rb_str_resize(indent, RSTRING_LEN(indent) - 4)
26#define A_ID(id) add_id(buf, (id))
27#define A_INT(val) rb_str_catf(buf, "%d", (val))
28#define A_LONG(val) rb_str_catf(buf, "%ld", (val))
29#define A_LIT(lit) AR(rb_dump_literal(lit))
30#define A_NODE_HEADER(node, term) \
31 rb_str_catf(buf, "@ %s (line: %d, location: (%d,%d)-(%d,%d))%s"term, \
32 ruby_node_name(nd_type(node)), nd_line(node), \
33 nd_first_lineno(node), nd_first_column(node), \
34 nd_last_lineno(node), nd_last_column(node), \
35 (node->flags & NODE_FL_NEWLINE ? "*" : ""))
36#define A_FIELD_HEADER(len, name, term) \
37 rb_str_catf(buf, "+- %.*s:"term, (len), (name))
38#define D_FIELD_HEADER(len, name, term) (A_INDENT, A_FIELD_HEADER(len, name, term))
40#define D_NULL_NODE (A_INDENT, A("(null node)\n"))
41#define D_NODE_HEADER(node) (A_INDENT, A_NODE_HEADER(node, "\n"))
43#define COMPOUND_FIELD(len, name) \
44 FIELD_BLOCK((D_FIELD_HEADER((len), (name), "\n"), D_INDENT), D_DEDENT)
46#define COMPOUND_FIELD1(name, ann) \
47 COMPOUND_FIELD(FIELD_NAME_LEN(name, ann), \
48 FIELD_NAME_DESC(name, ann))
50#define FIELD_NAME_DESC(name, ann) name " (" ann ")"
51#define FIELD_NAME_LEN(name, ann) (int)( \
53 rb_strlen_lit(FIELD_NAME_DESC(name, ann)) : \
55#define SIMPLE_FIELD(len, name) \
56 FIELD_BLOCK(D_FIELD_HEADER((len), (name), " "), A("\n"))
58#define FIELD_BLOCK(init, reset) \
59 for (init, field_flag = 1; \
61 reset, field_flag = 0)
63#define SIMPLE_FIELD1(name, ann) SIMPLE_FIELD(FIELD_NAME_LEN(name, ann), FIELD_NAME_DESC(name, ann))
64#define F_CUSTOM1(name, ann) SIMPLE_FIELD1(#name, ann)
65#define F_ID(name, ann) SIMPLE_FIELD1(#name, ann) A_ID(node->name)
66#define F_GENTRY(name, ann) SIMPLE_FIELD1(#name, ann) A_ID(node->name)
67#define F_INT(name, ann) SIMPLE_FIELD1(#name, ann) A_INT(node->name)
68#define F_LONG(name, ann) SIMPLE_FIELD1(#name, ann) A_LONG(node->name)
69#define F_LIT(name, ann) SIMPLE_FIELD1(#name, ann) A_LIT(node->name)
70#define F_MSG(name, ann, desc) SIMPLE_FIELD1(#name, ann) A(desc)
72#define F_NODE(name, ann) \
73 COMPOUND_FIELD1(#name, ann) {dump_node(buf, indent, comment, node->name);}
77 A_INDENT; A("| # " ann "\n"); \
80#define LAST_NODE (next_indent = " ")
85 if (!RB_SPECIAL_CONST_P(lit)) {
87 switch (RB_BUILTIN_TYPE(lit)) {
130static const char default_indent[] =
"| ";
136 const char *next_indent = default_indent;
140 node = node->nd_next;
152 const char *next_indent = default_indent;
165 ANN(
"statement sequence");
166 ANN(
"format: [nd_head]; ...; [nd_next]");
167 ANN(
"example: foo; bar");
172 comment ?
"statement #" :
"", ++i);
175 dump_node(
buf, indent, comment, node->nd_head);
177 }
while (node->nd_next &&
179 (node = node->nd_next, 1));
188 ANN(
"format: if [nd_cond] then [nd_body] else [nd_else] end");
189 ANN(
"example: if x == 1 then foo else bar end");
197 ANN(
"unless statement");
198 ANN(
"format: unless [nd_cond] then [nd_body] else [nd_else] end");
199 ANN(
"example: unless x == 1 then foo else bar end");
207 ANN(
"case statement");
208 ANN(
"format: case [nd_head]; [nd_body]; end");
209 ANN(
"example: case x; when 1; foo; when 2; bar; else baz; end");
215 ANN(
"case statement with no head");
216 ANN(
"format: case; [nd_body]; end");
217 ANN(
"example: case; when 1; foo; when 2; bar; else baz; end");
223 ANN(
"case statement (pattern matching)");
224 ANN(
"format: case [nd_head]; [nd_body]; end");
225 ANN(
"example: case x; in 1; foo; in 2; bar; else baz; end");
233 ANN(
"format: when [nd_head]; [nd_body]; (when or else) [nd_next]");
234 ANN(
"example: case x; when 1; foo; when 2; bar; else baz; end");
243 ANN(
"format: in [nd_head]; [nd_body]; (in or else) [nd_next]");
244 ANN(
"example: case x; in 1; foo; in 2; bar; else baz; end");
252 ANN(
"while statement");
253 ANN(
"format: while [nd_cond]; [nd_body]; end");
254 ANN(
"example: while x == 1; foo; end");
257 ANN(
"until statement");
258 ANN(
"format: until [nd_cond]; [nd_body]; end");
259 ANN(
"example: until x == 1; foo; end");
262 A_INT((
int)node->nd_state);
263 A((node->nd_state == 1) ?
" (while-end)" :
" (begin-end-while)");
271 ANN(
"method call with block");
272 ANN(
"format: [nd_iter] { [nd_body] }");
273 ANN(
"example: 3.times { foo }");
276 ANN(
"for statement");
277 ANN(
"format: for * in [nd_iter] do [nd_body] end");
278 ANN(
"example: for i in 1..3 do foo end");
286 ANN(
"vars of for statement with masgn");
287 ANN(
"format: for [nd_var] in ... do ... end");
288 ANN(
"example: for x, y in 1..3 do foo end");
294 ANN(
"break statement");
295 ANN(
"format: break [nd_stts]");
296 ANN(
"example: break 1");
299 ANN(
"next statement");
300 ANN(
"format: next [nd_stts]");
301 ANN(
"example: next 1");
304 ANN(
"return statement");
305 ANN(
"format: return [nd_stts]");
306 ANN(
"example: return 1");
313 ANN(
"redo statement");
315 ANN(
"example: redo");
319 ANN(
"retry statement");
320 ANN(
"format: retry");
321 ANN(
"example: retry");
325 ANN(
"begin statement");
326 ANN(
"format: begin; [nd_body]; end");
327 ANN(
"example: begin; 1; end");
333 ANN(
"rescue clause");
334 ANN(
"format: begin; [nd_body]; (rescue) [nd_resq]; else [nd_else]; end");
335 ANN(
"example: begin; foo; rescue; bar; else; baz; end");
343 ANN(
"rescue clause (cont'd)");
344 ANN(
"format: rescue [nd_args]; [nd_body]; (rescue) [nd_head]");
345 ANN(
"example: begin; foo; rescue; bar; else; baz; end");
353 ANN(
"ensure clause");
354 ANN(
"format: begin; [nd_head]; ensure; [nd_ensr]; end");
355 ANN(
"example: begin; foo; ensure; bar; end");
363 ANN(
"format: [nd_1st] && [nd_2nd]");
364 ANN(
"example: foo && bar");
368 ANN(
"format: [nd_1st] || [nd_2nd]");
369 ANN(
"example: foo || bar");
373 if (!node->nd_2nd ||
nd_type(node->nd_2nd) != (
int)
type)
382 ANN(
"multiple assignment");
383 ANN(
"format: [nd_head], [nd_args] = [nd_value]");
384 ANN(
"example: a, b = foo");
392 F_MSG(
nd_args,
"splatn",
"NODE_SPECIAL_NO_NAME_REST (rest argument without name)");
397 ANN(
"local variable assignment");
398 ANN(
"format: [nd_vid](lvar) = [nd_value]");
399 ANN(
"example: x = foo");
402 F_MSG(
nd_value,
"rvalue",
"NODE_SPECIAL_REQUIRED_KEYWORD (required keyword argument)");
410 ANN(
"dynamic variable assignment (out of current scope)");
411 ANN(
"format: [nd_vid](dvar) = [nd_value]");
412 ANN(
"example: x = nil; 1.times { x = foo }");
418 ANN(
"dynamic variable assignment (in current scope)");
419 ANN(
"format: [nd_vid](current dvar) = [nd_value]");
420 ANN(
"example: 1.times { x = foo }");
423 F_MSG(
nd_value,
"rvalue",
"NODE_SPECIAL_REQUIRED_KEYWORD (required keyword argument)");
431 ANN(
"instance variable assignment");
432 ANN(
"format: [nd_vid](ivar) = [nd_value]");
433 ANN(
"example: @x = foo");
439 ANN(
"class variable assignment");
440 ANN(
"format: [nd_vid](cvar) = [nd_value]");
441 ANN(
"example: @@x = foo");
447 ANN(
"global variable assignment");
448 ANN(
"format: [nd_entry](gvar) = [nd_value]");
449 ANN(
"example: $x = foo");
456 ANN(
"constant declaration");
457 ANN(
"format: [nd_else]::[nd_vid](constant) = [nd_value]");
458 ANN(
"example: X = foo");
464 F_MSG(
nd_vid,
"constant",
"0 (see extension field)");
472 ANN(
"array assignment with operator");
473 ANN(
"format: [nd_recv] [ [nd_args->nd_head] ] [nd_mid]= [nd_args->nd_body]");
474 ANN(
"example: ary[1] += foo");
483 ANN(
"attr assignment with operator");
484 ANN(
"format: [nd_recv].[attr] [nd_next->nd_mid]= [nd_value]");
485 ANN(
" where [attr]: [nd_next->nd_vid]");
486 ANN(
"example: struct.field += foo");
489 if (node->nd_next->nd_aid)
A(
"? ");
490 A_ID(node->nd_next->nd_vid);
498 ANN(
"assignment with && operator");
499 ANN(
"format: [nd_head] &&= [nd_value]");
500 ANN(
"example: foo &&= bar");
503 ANN(
"assignment with || operator");
504 ANN(
"format: [nd_head] ||= [nd_value]");
505 ANN(
"example: foo ||= bar");
513 ANN(
"constant declaration with operator");
514 ANN(
"format: [nd_head](constant) [nd_aid]= [nd_value]");
515 ANN(
"example: A::B ||= 1");
523 ANN(
"method invocation");
524 ANN(
"format: [nd_recv].[nd_mid]([nd_args])");
525 ANN(
"example: obj.foo(1)");
533 ANN(
"method invocation");
534 ANN(
"format: [nd_recv] [nd_mid] [nd_args]");
535 ANN(
"example: foo + bar");
543 ANN(
"function call");
544 ANN(
"format: [nd_mid]([nd_args])");
545 ANN(
"example: foo(1)");
552 ANN(
"function call with no argument");
553 ANN(
"format: [nd_mid]");
559 ANN(
"safe method invocation");
560 ANN(
"format: [nd_recv]&.[nd_mid]([nd_args])");
561 ANN(
"example: obj&.foo(1)");
569 ANN(
"super invocation");
570 ANN(
"format: super [nd_args]");
571 ANN(
"example: super 1");
577 ANN(
"super invocation with no argument");
578 ANN(
"format: super");
579 ANN(
"example: super");
583 ANN(
"list constructor");
584 ANN(
"format: [ [nd_head], [nd_next].. ] (length: [nd_alen])");
585 ANN(
"example: [1, 2, 3]");
588 ANN(
"return arguments");
589 ANN(
"format: [ [nd_head], [nd_next].. ] (length: [nd_alen])");
590 ANN(
"example: return 1, 2, 3");
592 dump_array(
buf, indent, comment, node);
596 ANN(
"empty list constructor");
602 if (!node->nd_brace) {
603 ANN(
"keyword arguments");
604 ANN(
"format: nd_head");
605 ANN(
"example: a: 1, b: 2");
608 ANN(
"hash constructor");
609 ANN(
"format: { [nd_head] }");
610 ANN(
"example: { 1 => 2, 3 => 4 }");
613 switch (node->nd_brace) {
614 case 0:
A(
"0 (keyword argument)");
break;
615 case 1:
A(
"1 (hash literal)");
break;
623 ANN(
"yield invocation");
624 ANN(
"format: yield [nd_head]");
625 ANN(
"example: yield 1");
631 ANN(
"local variable reference");
632 ANN(
"format: [nd_vid](lvar)");
637 ANN(
"dynamic variable reference");
638 ANN(
"format: [nd_vid](dvar)");
639 ANN(
"example: 1.times { x = 1; x }");
643 ANN(
"instance variable reference");
644 ANN(
"format: [nd_vid](ivar)");
649 ANN(
"constant reference");
650 ANN(
"format: [nd_vid](constant)");
655 ANN(
"class variable reference");
656 ANN(
"format: [nd_vid](cvar)");
662 ANN(
"global variable reference");
663 ANN(
"format: [nd_entry](gvar)");
669 ANN(
"nth special variable reference");
670 ANN(
"format: $[nd_nth]");
671 ANN(
"example: $1, $2, ..");
676 ANN(
"back special variable reference");
677 ANN(
"format: $[nd_nth]");
678 ANN(
"example: $&, $`, $', $+");
682 name[1] = (char)node->nd_nth;
689 ANN(
"match expression (against $_ implicitly)");
690 ANN(
"format: [nd_lit] (in condition)");
691 ANN(
"example: if /foo/; foo; end");
696 ANN(
"match expression (regexp first)");
697 ANN(
"format: [nd_recv] =~ [nd_value]");
698 ANN(
"example: /foo/ =~ 'foo'");
709 ANN(
"match expression (regexp second)");
710 ANN(
"format: [nd_recv] =~ [nd_value]");
711 ANN(
"example: 'foo' =~ /foo/");
719 ANN(
"format: [nd_lit]");
720 ANN(
"example: 1, /foo/");
723 ANN(
"string literal");
724 ANN(
"format: [nd_lit]");
725 ANN(
"example: 'foo'");
728 ANN(
"xstring literal");
729 ANN(
"format: [nd_lit]");
730 ANN(
"example: `foo`");
736 ANN(
"once evaluation");
737 ANN(
"format: [nd_body]");
738 ANN(
"example: /foo#{ bar }baz/o");
743 ANN(
"string literal with interpolation");
744 ANN(
"format: [nd_lit]");
745 ANN(
"example: \"foo#{ bar }baz\"");
748 ANN(
"xstring literal with interpolation");
749 ANN(
"format: [nd_lit]");
750 ANN(
"example: `foo#{ bar }baz`");
753 ANN(
"regexp literal with interpolation");
754 ANN(
"format: [nd_lit]");
755 ANN(
"example: /foo#{ bar }baz/");
758 ANN(
"symbol literal with interpolation");
759 ANN(
"format: [nd_lit]");
760 ANN(
"example: :\"foo#{ bar }baz\"");
763 if (!node->nd_next)
return;
770 ANN(
"interpolation expression");
771 ANN(
"format: \"..#{ [nd_lit] }..\"");
772 ANN(
"example: \"foo#{ bar }baz\"");
778 ANN(
"splat argument following arguments");
779 ANN(
"format: ..(*[nd_head], [nd_body..])");
780 ANN(
"example: foo(*ary, post_arg1, post_arg2)");
787 ANN(
"splat argument following one argument");
788 ANN(
"format: ..(*[nd_head], [nd_body])");
789 ANN(
"example: foo(*ary, post_arg)");
796 ANN(
"splat argument");
797 ANN(
"format: *[nd_head]");
798 ANN(
"example: foo(*ary)");
804 ANN(
"arguments with block argument");
805 ANN(
"format: ..([nd_head], &[nd_body])");
806 ANN(
"example: foo(x, &blk)");
813 ANN(
"method definition");
814 ANN(
"format: def [nd_mid] [nd_defn]; end");
815 ANN(
"example: def foo; bar; end");
822 ANN(
"singleton method definition");
823 ANN(
"format: def [nd_recv].[nd_mid] [nd_defn]; end");
824 ANN(
"example: def obj.foo; bar; end");
832 ANN(
"method alias statement");
833 ANN(
"format: alias [nd_1st] [nd_2nd]");
834 ANN(
"example: alias bar foo");
841 ANN(
"global variable alias statement");
842 ANN(
"format: alias [nd_alias](gvar) [nd_orig](gvar)");
843 ANN(
"example: alias $y $x");
849 ANN(
"method undef statement");
850 ANN(
"format: undef [nd_undef]");
851 ANN(
"example: undef foo");
857 ANN(
"class definition");
858 ANN(
"format: class [nd_cpath] < [nd_super]; [nd_body]; end");
859 ANN(
"example: class C2 < C; ..; end");
867 ANN(
"module definition");
868 ANN(
"format: module [nd_cpath]; [nd_body]; end");
869 ANN(
"example: module M; ..; end");
876 ANN(
"singleton class definition");
877 ANN(
"format: class << [nd_recv]; [nd_body]; end");
878 ANN(
"example: class << obj; ..; end");
885 ANN(
"scoped constant reference");
886 ANN(
"format: [nd_head]::[nd_mid]");
887 ANN(
"example: M::C");
894 ANN(
"top-level constant reference");
895 ANN(
"format: ::[nd_mid]");
896 ANN(
"example: ::Object");
901 ANN(
"range constructor (incl.)");
902 ANN(
"format: [nd_beg]..[nd_end]");
903 ANN(
"example: 1..5");
906 ANN(
"range constructor (excl.)");
907 ANN(
"format: [nd_beg]...[nd_end]");
908 ANN(
"example: 1...5");
911 ANN(
"flip-flop condition (incl.)");
912 ANN(
"format: [nd_beg]..[nd_end]");
913 ANN(
"example: if (x==1)..(x==5); foo; end");
916 ANN(
"flip-flop condition (excl.)");
917 ANN(
"format: [nd_beg]...[nd_end]");
918 ANN(
"example: if (x==1)...(x==5); foo; end");
928 ANN(
"example: self");
940 ANN(
"example: true");
945 ANN(
"format: false");
946 ANN(
"example: false");
950 ANN(
"virtual reference to $!");
951 ANN(
"format: rescue => id");
952 ANN(
"example: rescue => id");
956 ANN(
"defined? expression");
957 ANN(
"format: defined?([nd_head])");
958 ANN(
"example: defined?(foo)");
963 ANN(
"post-execution");
964 ANN(
"format: END { [nd_body] }");
965 ANN(
"example: END { foo }");
971 ANN(
"attr assignment");
972 ANN(
"format: [nd_recv].[nd_mid] = [nd_args]");
973 ANN(
"example: struct.field = foo");
981 ANN(
"lambda expression");
982 ANN(
"format: -> [nd_body]");
983 ANN(
"example: -> { foo }");
989 ANN(
"optional arguments");
990 ANN(
"format: def method_name([nd_body=some], [nd_next..])");
991 ANN(
"example: def foo(a, b=1, c); end");
998 ANN(
"keyword arguments");
999 ANN(
"format: def method_name([nd_body=some], [nd_next..])");
1000 ANN(
"example: def foo(a:1, b:2); end");
1007 ANN(
"post arguments");
1008 ANN(
"format: *[nd_1st], [nd_2nd..] = ..");
1009 ANN(
"example: a, *rest, z = foo");
1014 F_MSG(
nd_1st,
"rest argument",
"NODE_SPECIAL_NO_NAME_REST (rest argument without name)");
1021 ANN(
"method parameters");
1022 ANN(
"format: def method_name(.., [nd_opt=some], *[nd_rest], [nd_pid], .., &[nd_body])");
1023 ANN(
"example: def foo(a, b, opt1=1, opt2=2, *rest, y, z, &blk); end");
1024 F_INT(
nd_ainfo->pre_args_num,
"count of mandatory (pre-)arguments");
1026 F_INT(
nd_ainfo->post_args_num,
"count of mandatory post-arguments");
1031 A(
"1 (excessed comma)");
1034 A_ID(node->nd_ainfo->rest_arg);
1046 ANN(
"format: [nd_tbl]: local table, [nd_args]: arguments, [nd_body]: body");
1048 ID *tbl = node->nd_tbl;
1050 int size = tbl ? (
int)*tbl++ : 0;
1051 if (
size == 0)
A(
"(empty)");
1052 for (i = 0; i <
size; i++) {
1062 ANN(
"array pattern");
1063 ANN(
"format: [nd_pconst]([pre_args], ..., *[rest_arg], [post_args], ...)");
1070 F_MSG(
nd_apinfo->rest_arg,
"rest argument",
"NODE_SPECIAL_NO_NAME_REST (rest argument without name)");
1077 ANN(
"find pattern");
1078 ANN(
"format: [nd_pconst](*[pre_rest_arg], args, ..., *[post_rest_arg])");
1084 F_MSG(
nd_fpinfo->pre_rest_arg,
"pre rest argument",
"NODE_SPECIAL_NO_NAME_REST (rest argument without name)");
1093 F_MSG(
nd_fpinfo->post_rest_arg,
"post rest argument",
"NODE_SPECIAL_NO_NAME_REST (rest argument without name)");
1098 ANN(
"hash pattern");
1099 ANN(
"format: [nd_pconst]([nd_pkwargs], ..., **[nd_pkwrestarg])");
1104 F_MSG(
nd_pkwrestarg,
"keyword rest argument",
"NODE_SPECIAL_NO_REST_KEYWORD (**nil)");
1123 "###########################################################\n"
1124 "## Do NOT use this node dump for any purpose other than ##\n"
1125 "## debug and research. Compatibility is not guaranteed. ##\n"
1126 "###########################################################\n\n"
1182rb_node_buffer_new(
void)
1185 const size_t alloc_size =
sizeof(
node_buffer_t) + (bucket_size * 2);
1203 while (nbe != nb->
last) {
1214 node_buffer_list_free(&nb->
markable);
1216 while (local_table) {
1217 unsigned int size = (
unsigned int)*local_table;
1228 if (nb->
idx >= nb->
len) {
1229 long n = nb->
len * 2;
1269 return ast_newnode_in_bucket(bucket);
1276 if (nodetype_markable_p(old_type) != nodetype_markable_p(
type)) {
1277 rb_bug(
"node type changed: %s -> %s",
1312 for (cursor = 0; cursor <
len; cursor++) {
1313 func(ctx, &nbe->
buf[cursor]);
1323 iterate_buffer_elements(nbe, nb->
idx, func, ctx);
1327 iterate_buffer_elements(nbe, nbe->
len, func, ctx);
1333mark_ast_value(
void *ctx,
NODE * node)
1362update_ast_value(
void *ctx,
NODE * node)
1396 iterate_node_values(&nb->
markable, update_ast_value,
NULL);
1408 iterate_node_values(&nb->
markable, mark_ast_value,
NULL);
1426 while (nbe != nb->
last) {
#define offsetof(p_type, field)
char str[HTML_ESCAPE_MAX_LEN+1]
VALUE rb_gc_location(VALUE value)
void rb_gc_mark_movable(VALUE ptr)
void * rb_xmalloc_mul_add(size_t x, size_t y, size_t z)
void rb_gc_mark(VALUE ptr)
void * ruby_xmalloc(size_t size)
Allocates a storage instance.
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
void rb_bug(const char *fmt,...)
VALUE rb_ident_hash_new(void)
VALUE rb_inspect(VALUE)
Convenient wrapper of Object::inspect.
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
#define rb_str_new_cstr(str)
VALUE rb_class_path(VALUE)
Internal header for Hash.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
const char * ruby_node_name(int node)
VALUE type(ANYARGS)
ANYARGS-ed function type.
void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
#define F_NODE(name, ann)
VALUE rb_parser_dump_tree(const NODE *node, int comment)
VALUE rb_dump_literal(VALUE lit)
#define F_CUSTOM1(name, ann)
void rb_ast_dispose(rb_ast_t *ast)
struct node_buffer_elem_struct node_buffer_elem_t
#define D_NODE_HEADER(node)
rb_ast_t * rb_ast_new(void)
#define F_LONG(name, ann)
void rb_ast_add_mark_object(rb_ast_t *ast, VALUE obj)
NODE * rb_ast_newnode(rb_ast_t *ast, enum node_type type)
void rb_ast_add_local_table(rb_ast_t *ast, ID *buf)
void rb_ast_update_references(rb_ast_t *ast)
#define F_GENTRY(name, ann)
void rb_ast_mark(rb_ast_t *ast)
size_t rb_ast_memsize(const rb_ast_t *ast)
void node_itr_t(void *ctx, NODE *node)
void rb_ast_node_type_change(NODE *n, enum node_type type)
#define NODE_BUF_DEFAULT_LEN
void rb_ast_free(rb_ast_t *ast)
#define F_MSG(name, ann, desc)
void rb_ast_delete_node(rb_ast_t *ast, NODE *n)
#define NODE_NAMED_REST_P(node)
struct node_buffer_struct node_buffer_t
#define NODE_SPECIAL_NO_REST_KEYWORD
#define NODE_REQUIRED_KEYWORD_P(node)
#define nd_init_type(n, t)
#define NODE_SPECIAL_EXCESSIVE_COMMA
#define RBIMPL_ATTR_PURE()
Wraps (or simulates) __attribute__((pure))
#define RB_OBJ_WRITE(a, slot, b)
WB for new reference from ‘a’ to ‘b’.
VALUE rb_str_catf(VALUE, const char *,...)
VALUE rb_sprintf(const char *,...)
rb_code_location_t nd_loc
struct node_buffer_elem_struct * next
node_buffer_elem_t * last
node_buffer_elem_t * head
node_buffer_list_t markable
node_buffer_list_t unmarkable
node_buffer_t * node_buffer
rb_code_position_t beg_pos
rb_code_position_t end_pos