ruby-internal 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/Rakefile +1 -1
  2. data/bin/ruby-internal-node-dump +1 -1
  3. data/bin/ruby-internal-obfuscate +1 -1
  4. data/ext/cached/ruby-1.8.4/internal/node/node_type_descrip.c +45 -45
  5. data/ext/cached/ruby-1.8.4/internal/node/nodeinfo.c +259 -258
  6. data/ext/cached/ruby-1.8.5/internal/node/node_type_descrip.c +43 -43
  7. data/ext/cached/ruby-1.8.5/internal/node/nodeinfo.c +261 -260
  8. data/ext/cached/ruby-1.8.6/internal/node/node_type_descrip.c +45 -45
  9. data/ext/cached/ruby-1.8.6/internal/node/nodeinfo.c +261 -260
  10. data/ext/cached/ruby-1.8.7/internal/node/node_type_descrip.c +37 -37
  11. data/ext/cached/ruby-1.8.7/internal/node/nodeinfo.c +219 -218
  12. data/ext/cached/ruby-1.9.1/internal/node/global_entry.h +4 -0
  13. data/ext/cached/ruby-1.9.1/internal/node/node_type_descrip.c +41 -41
  14. data/ext/cached/ruby-1.9.1/internal/node/nodeinfo.c +231 -230
  15. data/ext/cached/ruby-1.9.2/internal/node/global_entry.h +4 -0
  16. data/ext/cached/ruby-1.9.2/internal/node/node_type_descrip.c +37 -37
  17. data/ext/cached/ruby-1.9.2/internal/node/nodeinfo.c +206 -205
  18. data/ext/cached/ruby-1.9.3/internal/node/global_entry.h +4 -0
  19. data/ext/cached/ruby-1.9.3/internal/node/node_type_descrip.c +41 -41
  20. data/ext/cached/ruby-1.9.3/internal/node/nodeinfo.c +230 -229
  21. data/ext/internal/binding/block.h +0 -20
  22. data/ext/internal/method/internal_method.h +5 -5
  23. data/ext/internal/module/classpath.c +13 -18
  24. data/ext/internal/module/classpath.h +3 -3
  25. data/ext/internal/module/getcfp.h +12 -0
  26. data/ext/internal/node/block.h +0 -20
  27. data/ext/internal/node/global_entry.h +31 -42
  28. data/ext/internal/node/global_entry.h.rpp +1 -1
  29. data/ext/internal/node/node_type_descrip.c +38 -47
  30. data/ext/internal/node/nodeinfo.c +311 -626
  31. data/ext/internal/node/nodeinfo.h +4 -1
  32. data/ext/internal/proc/block.h +0 -20
  33. data/ext/internal/tag/tag.h +0 -10
  34. data/ext/internal/vm/instruction/insns_info.c +5974 -3
  35. data/ext/internal/vm/instruction/insns_info.h +878 -0
  36. metadata +37 -51
@@ -3,6 +3,7 @@
3
3
 
4
4
  st_table * rb_global_tbl;
5
5
 
6
+ #define global_variable rb_global_variable
6
7
  #define gvar_getter_t rb_gvar_getter_t
7
8
  #define gvar_setter_t rb_gvar_setter_t
8
9
  #define gvar_marker_t rb_gvar_marker_t
@@ -28,6 +29,9 @@ struct global_entry {
28
29
  #define undef_getter rb_gvar_undef_getter
29
30
  #define undef_setter rb_gvar_undef_setter
30
31
  #define undef_marker rb_gvar_undef_marker
32
+ #define val_getter rb_gvar_val_getter
33
+ #define val_setter rb_gvar_val_setter
34
+ #define val_marker rb_gvar_val_marker
31
35
  struct global_entry*
32
36
  rb_global_entry(ID id)
33
37
  {
@@ -2,44 +2,44 @@
2
2
  #include "version.h"
3
3
 
4
4
  Node_Type_Descrip node_type_descrips_unsorted[] = {
5
- { NODE_ALIAS, NEN_2ND, NEN_1ST, NEN_NONE, "ALIAS" },
5
+ { NODE_ALIAS, NEN_1ST, NEN_2ND, NEN_NONE, "ALIAS" },
6
6
  #ifdef HAVE_NODE_ALLOCA
7
- { NODE_ALLOCA, NEN_CNT, NEN_CFNC, NEN_VALUE, "ALLOCA" },
7
+ { NODE_ALLOCA, NEN_CFNC, NEN_VALUE, NEN_CNT, "ALLOCA" },
8
8
  #endif
9
9
  { NODE_AND, NEN_2ND, NEN_1ST, NEN_NONE, "AND" },
10
- { NODE_ARGS, NEN_CNT, NEN_OPT, NEN_REST, "ARGS" },
10
+ { NODE_ARGS, NEN_REST, NEN_OPT, NEN_CNT, "ARGS" },
11
11
  { NODE_ARGSCAT, NEN_HEAD, NEN_BODY, NEN_NONE, "ARGSCAT" },
12
12
  { NODE_ARGSPUSH, NEN_HEAD, NEN_BODY, NEN_NONE, "ARGSPUSH" },
13
- { NODE_ARRAY, NEN_HEAD, NEN_ALEN, NEN_NEXT, "ARRAY" },
14
- { NODE_ATTRASGN, NEN_MID, NEN_RECV, NEN_ARGS, "ATTRASGN" },
13
+ { NODE_ARRAY, NEN_ALEN, NEN_HEAD, NEN_NEXT, "ARRAY" },
14
+ { NODE_ATTRASGN, NEN_RECV, NEN_ARGS, NEN_MID, "ATTRASGN" },
15
15
  { NODE_ATTRSET, NEN_VID, NEN_NONE, NEN_NONE, "ATTRSET" },
16
- { NODE_BACK_REF, NEN_CNT, NEN_NTH, NEN_NONE, "BACK_REF" },
16
+ { NODE_BACK_REF, NEN_NTH, NEN_CNT, NEN_NONE, "BACK_REF" },
17
17
  { NODE_BEGIN, NEN_BODY, NEN_NONE, NEN_NONE, "BEGIN" },
18
18
  { NODE_BLOCK, NEN_HEAD, NEN_NEXT, NEN_NONE, "BLOCK" },
19
19
  { NODE_BLOCK_ARG, NEN_CNT, NEN_NONE, NEN_NONE, "BLOCK_ARG" },
20
- { NODE_BLOCK_PASS, NEN_ITER, NEN_BODY, NEN_NONE, "BLOCK_PASS" },
20
+ { NODE_BLOCK_PASS, NEN_BODY, NEN_ITER, NEN_NONE, "BLOCK_PASS" },
21
21
  { NODE_BMETHOD, NEN_CVAL, NEN_NONE, NEN_NONE, "BMETHOD" },
22
22
  { NODE_BREAK, NEN_STTS, NEN_NONE, NEN_NONE, "BREAK" },
23
- { NODE_CALL, NEN_MID, NEN_RECV, NEN_ARGS, "CALL" },
23
+ { NODE_CALL, NEN_ARGS, NEN_MID, NEN_RECV, "CALL" },
24
24
  { NODE_CASE, NEN_HEAD, NEN_BODY, NEN_NEXT, "CASE" },
25
- { NODE_CDECL, NEN_VID, NEN_VALUE, NEN_NONE, "CDECL" },
25
+ { NODE_CDECL, NEN_VALUE, NEN_VID, NEN_NONE, "CDECL" },
26
26
  { NODE_CFUNC, NEN_CFNC, NEN_ARGC, NEN_NONE, "CFUNC" },
27
- { NODE_CLASS, NEN_BODY, NEN_SUPER, NEN_CPATH, "CLASS" },
27
+ { NODE_CLASS, NEN_SUPER, NEN_CPATH, NEN_BODY, "CLASS" },
28
28
  { NODE_COLON2, NEN_HEAD, NEN_MID, NEN_NONE, "COLON2" },
29
29
  { NODE_COLON3, NEN_MID, NEN_NONE, NEN_NONE, "COLON3" },
30
30
  { NODE_CONST, NEN_VID, NEN_NONE, NEN_NONE, "CONST" },
31
31
  { NODE_CVAR, NEN_VID, NEN_NONE, NEN_NONE, "CVAR" },
32
- { NODE_CVASGN, NEN_VID, NEN_VALUE, NEN_NONE, "CVASGN" },
33
- { NODE_CVDECL, NEN_VID, NEN_VALUE, NEN_NONE, "CVDECL" },
34
- { NODE_DASGN, NEN_VID, NEN_VALUE, NEN_NONE, "DASGN" },
35
- { NODE_DASGN_CURR, NEN_VID, NEN_VALUE, NEN_NONE, "DASGN_CURR" },
32
+ { NODE_CVASGN, NEN_VALUE, NEN_VID, NEN_NONE, "CVASGN" },
33
+ { NODE_CVDECL, NEN_VALUE, NEN_VID, NEN_NONE, "CVDECL" },
34
+ { NODE_DASGN, NEN_VALUE, NEN_VID, NEN_NONE, "DASGN" },
35
+ { NODE_DASGN_CURR, NEN_VALUE, NEN_VID, NEN_NONE, "DASGN_CURR" },
36
36
  { NODE_DEFINED, NEN_HEAD, NEN_NONE, NEN_NONE, "DEFINED" },
37
- { NODE_DEFN, NEN_MID, NEN_DEFN, NEN_NOEX, "DEFN" },
38
- { NODE_DEFS, NEN_MID, NEN_DEFN, NEN_RECV, "DEFS" },
39
- { NODE_DOT2, NEN_END, NEN_STATE, NEN_BEG, "DOT2" },
40
- { NODE_DOT3, NEN_END, NEN_STATE, NEN_BEG, "DOT3" },
41
- { NODE_DREGX, NEN_LIT, NEN_CFLAG, NEN_NEXT, "DREGX" },
42
- { NODE_DREGX_ONCE, NEN_LIT, NEN_CFLAG, NEN_NEXT, "DREGX_ONCE" },
37
+ { NODE_DEFN, NEN_DEFN, NEN_MID, NEN_NOEX, "DEFN" },
38
+ { NODE_DEFS, NEN_DEFN, NEN_RECV, NEN_MID, "DEFS" },
39
+ { NODE_DOT2, NEN_BEG, NEN_END, NEN_STATE, "DOT2" },
40
+ { NODE_DOT3, NEN_BEG, NEN_END, NEN_STATE, "DOT3" },
41
+ { NODE_DREGX, NEN_LIT, NEN_NEXT, NEN_CFLAG, "DREGX" },
42
+ { NODE_DREGX_ONCE, NEN_LIT, NEN_NEXT, NEN_CFLAG, "DREGX_ONCE" },
43
43
  { NODE_DSTR, NEN_LIT, NEN_NEXT, NEN_NONE, "DSTR" },
44
44
  { NODE_DSYM, NEN_LIT, NEN_NEXT, NEN_NONE, "DSYM" },
45
45
  { NODE_DVAR, NEN_VID, NEN_NONE, NEN_NONE, "DVAR" },
@@ -47,36 +47,36 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
47
47
  { NODE_ENSURE, NEN_HEAD, NEN_ENSR, NEN_NONE, "ENSURE" },
48
48
  { NODE_EVSTR, NEN_BODY, NEN_NONE, NEN_NONE, "EVSTR" },
49
49
  { NODE_FALSE, NEN_NONE, NEN_NONE, NEN_NONE, "FALSE" },
50
- { NODE_FCALL, NEN_MID, NEN_ARGS, NEN_NONE, "FCALL" },
51
- { NODE_FLIP2, NEN_CNT, NEN_END, NEN_BEG, "FLIP2" },
52
- { NODE_FLIP3, NEN_CNT, NEN_END, NEN_BEG, "FLIP3" },
53
- { NODE_FOR, NEN_ITER, NEN_BODY, NEN_VAR, "FOR" },
54
- { NODE_GASGN, NEN_VID, NEN_ENTRY, NEN_VALUE, "GASGN" },
50
+ { NODE_FCALL, NEN_ARGS, NEN_MID, NEN_NONE, "FCALL" },
51
+ { NODE_FLIP2, NEN_CNT, NEN_BEG, NEN_END, "FLIP2" },
52
+ { NODE_FLIP3, NEN_CNT, NEN_BEG, NEN_END, "FLIP3" },
53
+ { NODE_FOR, NEN_BODY, NEN_ITER, NEN_VAR, "FOR" },
54
+ { NODE_GASGN, NEN_VALUE, NEN_VID, NEN_ENTRY, "GASGN" },
55
55
  { NODE_GVAR, NEN_VID, NEN_ENTRY, NEN_NONE, "GVAR" },
56
56
  { NODE_HASH, NEN_HEAD, NEN_NONE, NEN_NONE, "HASH" },
57
- { NODE_IASGN, NEN_VID, NEN_VALUE, NEN_NONE, "IASGN" },
58
- { NODE_IF, NEN_BODY, NEN_COND, NEN_ELSE, "IF" },
59
- { NODE_IFUNC, NEN_STATE, NEN_CFNC, NEN_TVAL, "IFUNC" },
60
- { NODE_ITER, NEN_ITER, NEN_BODY, NEN_VAR, "ITER" },
57
+ { NODE_IASGN, NEN_VALUE, NEN_VID, NEN_NONE, "IASGN" },
58
+ { NODE_IF, NEN_COND, NEN_BODY, NEN_ELSE, "IF" },
59
+ { NODE_IFUNC, NEN_CFNC, NEN_TVAL, NEN_STATE, "IFUNC" },
60
+ { NODE_ITER, NEN_BODY, NEN_ITER, NEN_VAR, "ITER" },
61
61
  { NODE_IVAR, NEN_VID, NEN_NONE, NEN_NONE, "IVAR" },
62
- { NODE_LASGN, NEN_CNT, NEN_VID, NEN_VALUE, "LASGN" },
62
+ { NODE_LASGN, NEN_VALUE, NEN_VID, NEN_CNT, "LASGN" },
63
63
  { NODE_LIT, NEN_LIT, NEN_NONE, NEN_NONE, "LIT" },
64
- { NODE_LVAR, NEN_CNT, NEN_VID, NEN_NONE, "LVAR" },
65
- { NODE_MASGN, NEN_HEAD, NEN_ARGS, NEN_VALUE, "MASGN" },
64
+ { NODE_LVAR, NEN_VID, NEN_CNT, NEN_NONE, "LVAR" },
65
+ { NODE_MASGN, NEN_ARGS, NEN_HEAD, NEN_VALUE, "MASGN" },
66
66
  { NODE_MATCH, NEN_LIT, NEN_VALUE, NEN_NONE, "MATCH" },
67
67
  { NODE_MATCH2, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH2" },
68
68
  { NODE_MATCH3, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH3" },
69
69
  { NODE_MEMO, NEN_NONE, NEN_NONE, NEN_NONE, "MEMO" },
70
- { NODE_MODULE, NEN_BODY, NEN_CPATH, NEN_NONE, "MODULE" },
70
+ { NODE_MODULE, NEN_CPATH, NEN_BODY, NEN_NONE, "MODULE" },
71
71
  { NODE_NEXT, NEN_STTS, NEN_NONE, NEN_NONE, "NEXT" },
72
72
  { NODE_NIL, NEN_NONE, NEN_NONE, NEN_NONE, "NIL" },
73
- { NODE_NTH_REF, NEN_CNT, NEN_NTH, NEN_NONE, "NTH_REF" },
73
+ { NODE_NTH_REF, NEN_NTH, NEN_CNT, NEN_NONE, "NTH_REF" },
74
74
  { NODE_OPT_N, NEN_BODY, NEN_NONE, NEN_NONE, "OPT_N" },
75
- { NODE_OP_ASGN1, NEN_MID, NEN_RECV, NEN_ARGS, "OP_ASGN1" },
75
+ { NODE_OP_ASGN1, NEN_ARGS, NEN_MID, NEN_RECV, "OP_ASGN1" },
76
76
  { NODE_OP_ASGN2, NEN_RECV, NEN_NEXT, NEN_VALUE, "OP_ASGN2" },
77
- { NODE_OP_ASGN2_ARG, NEN_MID, NEN_VID, NEN_AID, "OP_ASGN2_ARG" },
77
+ { NODE_OP_ASGN2_ARG, NEN_VID, NEN_AID, NEN_MID, "OP_ASGN2_ARG" },
78
78
  { NODE_OP_ASGN_AND, NEN_RECV, NEN_VALUE, NEN_NONE, "OP_ASGN_AND" },
79
- { NODE_OP_ASGN_OR, NEN_RECV, NEN_AID, NEN_VALUE, "OP_ASGN_OR" },
79
+ { NODE_OP_ASGN_OR, NEN_AID, NEN_VALUE, NEN_RECV, "OP_ASGN_OR" },
80
80
  { NODE_OR, NEN_2ND, NEN_1ST, NEN_NONE, "OR" },
81
81
  { NODE_POSTEXE, NEN_NONE, NEN_NONE, NEN_NONE, "POSTEXE" },
82
82
  { NODE_REDO, NEN_NONE, NEN_NONE, NEN_NONE, "REDO" },
@@ -85,7 +85,7 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
85
85
  { NODE_RETRY, NEN_NONE, NEN_NONE, NEN_NONE, "RETRY" },
86
86
  { NODE_RETURN, NEN_STTS, NEN_NONE, NEN_NONE, "RETURN" },
87
87
  { NODE_SCLASS, NEN_BODY, NEN_RECV, NEN_NONE, "SCLASS" },
88
- { NODE_SCOPE, NEN_RVAL, NEN_TBL, NEN_NEXT, "SCOPE" },
88
+ { NODE_SCOPE, NEN_TBL, NEN_RVAL, NEN_NEXT, "SCOPE" },
89
89
  { NODE_SELF, NEN_NONE, NEN_NONE, NEN_NONE, "SELF" },
90
90
  { NODE_SPLAT, NEN_HEAD, NEN_NONE, NEN_NONE, "SPLAT" },
91
91
  { NODE_STR, NEN_LIT, NEN_NONE, NEN_NONE, "STR" },
@@ -93,11 +93,11 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
93
93
  { NODE_TO_ARY, NEN_HEAD, NEN_NONE, NEN_NONE, "TO_ARY" },
94
94
  { NODE_TRUE, NEN_NONE, NEN_NONE, NEN_NONE, "TRUE" },
95
95
  { NODE_UNDEF, NEN_BODY, NEN_NONE, NEN_NONE, "UNDEF" },
96
- { NODE_UNTIL, NEN_STATE, NEN_BODY, NEN_COND, "UNTIL" },
97
- { NODE_VALIAS, NEN_2ND, NEN_1ST, NEN_NONE, "VALIAS" },
96
+ { NODE_UNTIL, NEN_BODY, NEN_COND, NEN_STATE, "UNTIL" },
97
+ { NODE_VALIAS, NEN_1ST, NEN_2ND, NEN_NONE, "VALIAS" },
98
98
  { NODE_VCALL, NEN_MID, NEN_NONE, NEN_NONE, "VCALL" },
99
99
  { NODE_WHEN, NEN_HEAD, NEN_BODY, NEN_NEXT, "WHEN" },
100
- { NODE_WHILE, NEN_STATE, NEN_BODY, NEN_COND, "WHILE" },
100
+ { NODE_WHILE, NEN_BODY, NEN_COND, NEN_STATE, "WHILE" },
101
101
  { NODE_XSTR, NEN_LIT, NEN_NONE, NEN_NONE, "XSTR" },
102
102
  { NODE_YIELD, NEN_HEAD, NEN_STATE, NEN_NONE, "YIELD" },
103
103
  { NODE_ZARRAY, NEN_NONE, NEN_NONE, NEN_NONE, "ZARRAY" },
@@ -2832,10 +2832,10 @@ void define_node_subclass_methods()
2832
2832
  rb_iv_set(rb_cALIAS, "__member__", members);
2833
2833
  rb_iv_set(rb_cALIAS, "__type__", INT2NUM(NODE_ALIAS));
2834
2834
  rb_define_singleton_method(rb_cALIAS, "members", node_s_members, 0);
2835
- rb_define_method(rb_cALIAS, "second", node_2nd, 0);
2836
- rb_ary_push(members, rb_str_new2("second"));
2837
2835
  rb_define_method(rb_cALIAS, "first", node_1st, 0);
2838
2836
  rb_ary_push(members, rb_str_new2("first"));
2837
+ rb_define_method(rb_cALIAS, "second", node_2nd, 0);
2838
+ rb_ary_push(members, rb_str_new2("second"));
2839
2839
  }
2840
2840
 
2841
2841
  /* Document-class: Node::ALLOCA
@@ -2853,12 +2853,6 @@ void define_node_subclass_methods()
2853
2853
  rb_iv_set(rb_cALLOCA, "__type__", INT2NUM(NODE_ALLOCA));
2854
2854
  rb_define_singleton_method(rb_cALLOCA, "members", node_s_members, 0);
2855
2855
 
2856
- /* Document-method: cnt
2857
- * the number of bytes allocated
2858
- */
2859
- rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
2860
- rb_ary_push(members, rb_str_new2("cnt"));
2861
-
2862
2856
  /* Document-method: cfnc
2863
2857
  * a pointer to the allocated memory
2864
2858
  */
@@ -2870,6 +2864,12 @@ void define_node_subclass_methods()
2870
2864
  */
2871
2865
  rb_define_method(rb_cALLOCA, "value", node_value, 0);
2872
2866
  rb_ary_push(members, rb_str_new2("value"));
2867
+
2868
+ /* Document-method: cnt
2869
+ * the number of bytes allocated
2870
+ */
2871
+ rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
2872
+ rb_ary_push(members, rb_str_new2("cnt"));
2873
2873
  }
2874
2874
  #endif
2875
2875
 
@@ -2912,11 +2912,11 @@ void define_node_subclass_methods()
2912
2912
  rb_iv_set(rb_cARGS, "__type__", INT2NUM(NODE_ARGS));
2913
2913
  rb_define_singleton_method(rb_cARGS, "members", node_s_members, 0);
2914
2914
 
2915
- /* Document-method: cnt
2916
- * the number of required arguments
2915
+ /* Document-method: rest
2916
+ * an assignment node to assign the rest arg, if it is present
2917
2917
  */
2918
- rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
2919
- rb_ary_push(members, rb_str_new2("cnt"));
2918
+ rb_define_method(rb_cARGS, "rest", node_rest, 0);
2919
+ rb_ary_push(members, rb_str_new2("rest"));
2920
2920
 
2921
2921
  /* Document-method: opt
2922
2922
  * a list of assignment nodes to assign default values to the
@@ -2925,11 +2925,11 @@ void define_node_subclass_methods()
2925
2925
  rb_define_method(rb_cARGS, "opt", node_opt, 0);
2926
2926
  rb_ary_push(members, rb_str_new2("opt"));
2927
2927
 
2928
- /* Document-method: rest
2929
- * an assignment node to assign the rest arg, if it is present
2928
+ /* Document-method: cnt
2929
+ * the number of required arguments
2930
2930
  */
2931
- rb_define_method(rb_cARGS, "rest", node_rest, 0);
2932
- rb_ary_push(members, rb_str_new2("rest"));
2931
+ rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
2932
+ rb_ary_push(members, rb_str_new2("cnt"));
2933
2933
  }
2934
2934
 
2935
2935
  /* Document-class: Node::ARGSCAT
@@ -2995,14 +2995,14 @@ void define_node_subclass_methods()
2995
2995
  rb_iv_set(rb_cARRAY, "__member__", members);
2996
2996
  rb_iv_set(rb_cARRAY, "__type__", INT2NUM(NODE_ARRAY));
2997
2997
  rb_define_singleton_method(rb_cARRAY, "members", node_s_members, 0);
2998
+ rb_define_method(rb_cARRAY, "alen", node_alen, 0);
2999
+ rb_ary_push(members, rb_str_new2("alen"));
2998
3000
 
2999
3001
  /* Document-method: head
3000
3002
  * the first element of the array
3001
3003
  */
3002
3004
  rb_define_method(rb_cARRAY, "head", node_head, 0);
3003
3005
  rb_ary_push(members, rb_str_new2("head"));
3004
- rb_define_method(rb_cARRAY, "alen", node_alen, 0);
3005
- rb_ary_push(members, rb_str_new2("alen"));
3006
3006
 
3007
3007
  /* Document-method: next
3008
3008
  * the tail of the array
@@ -3025,12 +3025,6 @@ void define_node_subclass_methods()
3025
3025
  rb_iv_set(rb_cATTRASGN, "__type__", INT2NUM(NODE_ATTRASGN));
3026
3026
  rb_define_singleton_method(rb_cATTRASGN, "members", node_s_members, 0);
3027
3027
 
3028
- /* Document-method: mid
3029
- * the id of the attribute, with a trailing '=' sign
3030
- */
3031
- rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
3032
- rb_ary_push(members, rb_str_new2("mid"));
3033
-
3034
3028
  /* Document-method: recv
3035
3029
  * the receiver of the method
3036
3030
  */
@@ -3042,6 +3036,12 @@ void define_node_subclass_methods()
3042
3036
  */
3043
3037
  rb_define_method(rb_cATTRASGN, "args", node_args, 0);
3044
3038
  rb_ary_push(members, rb_str_new2("args"));
3039
+
3040
+ /* Document-method: mid
3041
+ * the id of the attribute, with a trailing '=' sign
3042
+ */
3043
+ rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
3044
+ rb_ary_push(members, rb_str_new2("mid"));
3045
3045
  }
3046
3046
 
3047
3047
  /* Document-class: Node::ATTRSET
@@ -3080,19 +3080,19 @@ void define_node_subclass_methods()
3080
3080
  rb_iv_set(rb_cBACK_REF, "__type__", INT2NUM(NODE_BACK_REF));
3081
3081
  rb_define_singleton_method(rb_cBACK_REF, "members", node_s_members, 0);
3082
3082
 
3083
- /* Document-method: cnt
3084
- * the index into the local variable table where the match data is
3085
- * stored
3086
- */
3087
- rb_define_method(rb_cBACK_REF, "cnt", node_cnt, 0);
3088
- rb_ary_push(members, rb_str_new2("cnt"));
3089
-
3090
3083
  /* Document-method: nth
3091
3084
  * the integer representation of the character of the variable to
3092
3085
  * reference, one of '&', '`', '\'', or '+'
3093
3086
  */
3094
3087
  rb_define_method(rb_cBACK_REF, "nth", node_nth, 0);
3095
3088
  rb_ary_push(members, rb_str_new2("nth"));
3089
+
3090
+ /* Document-method: cnt
3091
+ * the index into the local variable table where the match data is
3092
+ * stored
3093
+ */
3094
+ rb_define_method(rb_cBACK_REF, "cnt", node_cnt, 0);
3095
+ rb_ary_push(members, rb_str_new2("cnt"));
3096
3096
  }
3097
3097
 
3098
3098
  /* Document-class: Node::BEGIN
@@ -3180,17 +3180,17 @@ void define_node_subclass_methods()
3180
3180
  rb_iv_set(rb_cBLOCK_PASS, "__type__", INT2NUM(NODE_BLOCK_PASS));
3181
3181
  rb_define_singleton_method(rb_cBLOCK_PASS, "members", node_s_members, 0);
3182
3182
 
3183
- /* Document-method: iter
3184
- * an expression which calls a method
3185
- */
3186
- rb_define_method(rb_cBLOCK_PASS, "iter", node_iter, 0);
3187
- rb_ary_push(members, rb_str_new2("iter"));
3188
-
3189
3183
  /* Document-method: body
3190
3184
  * the object to pass as a block
3191
3185
  */
3192
3186
  rb_define_method(rb_cBLOCK_PASS, "body", node_body, 0);
3193
3187
  rb_ary_push(members, rb_str_new2("body"));
3188
+
3189
+ /* Document-method: iter
3190
+ * an expression which calls a method
3191
+ */
3192
+ rb_define_method(rb_cBLOCK_PASS, "iter", node_iter, 0);
3193
+ rb_ary_push(members, rb_str_new2("iter"));
3194
3194
  }
3195
3195
 
3196
3196
  /* Document-class: Node::BMETHOD
@@ -3247,6 +3247,12 @@ void define_node_subclass_methods()
3247
3247
  rb_iv_set(rb_cCALL, "__type__", INT2NUM(NODE_CALL));
3248
3248
  rb_define_singleton_method(rb_cCALL, "members", node_s_members, 0);
3249
3249
 
3250
+ /* Document-method: args
3251
+ * the arguments to the method
3252
+ */
3253
+ rb_define_method(rb_cCALL, "args", node_args, 0);
3254
+ rb_ary_push(members, rb_str_new2("args"));
3255
+
3250
3256
  /* Document-method: mid
3251
3257
  * the method id
3252
3258
  */
@@ -3258,12 +3264,6 @@ void define_node_subclass_methods()
3258
3264
  */
3259
3265
  rb_define_method(rb_cCALL, "recv", node_recv, 0);
3260
3266
  rb_ary_push(members, rb_str_new2("recv"));
3261
-
3262
- /* Document-method: args
3263
- * the arguments to the method
3264
- */
3265
- rb_define_method(rb_cCALL, "args", node_args, 0);
3266
- rb_ary_push(members, rb_str_new2("args"));
3267
3267
  }
3268
3268
 
3269
3269
  /* Document-class: Node::CASE
@@ -3309,17 +3309,17 @@ void define_node_subclass_methods()
3309
3309
  rb_iv_set(rb_cCDECL, "__type__", INT2NUM(NODE_CDECL));
3310
3310
  rb_define_singleton_method(rb_cCDECL, "members", node_s_members, 0);
3311
3311
 
3312
- /* Document-method: vid
3313
- * the name of the constant to be assigned, all uppercase
3314
- */
3315
- rb_define_method(rb_cCDECL, "vid", node_vid, 0);
3316
- rb_ary_push(members, rb_str_new2("vid"));
3317
-
3318
3312
  /* Document-method: value
3319
3313
  * the value to be assigned to the constant
3320
3314
  */
3321
3315
  rb_define_method(rb_cCDECL, "value", node_value, 0);
3322
3316
  rb_ary_push(members, rb_str_new2("value"));
3317
+
3318
+ /* Document-method: vid
3319
+ * the name of the constant to be assigned, all uppercase
3320
+ */
3321
+ rb_define_method(rb_cCDECL, "vid", node_vid, 0);
3322
+ rb_ary_push(members, rb_str_new2("vid"));
3323
3323
  }
3324
3324
 
3325
3325
  /* Document-class: Node::CFUNC
@@ -3362,12 +3362,6 @@ void define_node_subclass_methods()
3362
3362
  rb_iv_set(rb_cCLASS, "__type__", INT2NUM(NODE_CLASS));
3363
3363
  rb_define_singleton_method(rb_cCLASS, "members", node_s_members, 0);
3364
3364
 
3365
- /* Document-method: body
3366
- * the body of the class definition
3367
- */
3368
- rb_define_method(rb_cCLASS, "body", node_body, 0);
3369
- rb_ary_push(members, rb_str_new2("body"));
3370
-
3371
3365
  /* Document-method: super
3372
3366
  * an expression returning the base class, or false if there is no
3373
3367
  * base class specified
@@ -3380,6 +3374,12 @@ void define_node_subclass_methods()
3380
3374
  */
3381
3375
  rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
3382
3376
  rb_ary_push(members, rb_str_new2("cpath"));
3377
+
3378
+ /* Document-method: body
3379
+ * the body of the class definition
3380
+ */
3381
+ rb_define_method(rb_cCLASS, "body", node_body, 0);
3382
+ rb_ary_push(members, rb_str_new2("body"));
3383
3383
  }
3384
3384
 
3385
3385
  /* Document-class: Node::COLON2
@@ -3481,18 +3481,18 @@ void define_node_subclass_methods()
3481
3481
  rb_iv_set(rb_cCVASGN, "__type__", INT2NUM(NODE_CVASGN));
3482
3482
  rb_define_singleton_method(rb_cCVASGN, "members", node_s_members, 0);
3483
3483
 
3484
- /* Document-method: vid
3485
- * the name of the class variable to assign
3486
- */
3487
- rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
3488
- rb_ary_push(members, rb_str_new2("vid"));
3489
-
3490
3484
  /* Document-method: value
3491
3485
  * an expression whose result is the new value of the class
3492
3486
  * variable
3493
3487
  */
3494
3488
  rb_define_method(rb_cCVASGN, "value", node_value, 0);
3495
3489
  rb_ary_push(members, rb_str_new2("value"));
3490
+
3491
+ /* Document-method: vid
3492
+ * the name of the class variable to assign
3493
+ */
3494
+ rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
3495
+ rb_ary_push(members, rb_str_new2("vid"));
3496
3496
  }
3497
3497
 
3498
3498
  /* Document-class: Node::CVDECL
@@ -3508,18 +3508,18 @@ void define_node_subclass_methods()
3508
3508
  rb_iv_set(rb_cCVDECL, "__type__", INT2NUM(NODE_CVDECL));
3509
3509
  rb_define_singleton_method(rb_cCVDECL, "members", node_s_members, 0);
3510
3510
 
3511
- /* Document-method: vid
3512
- * the name of the class variable to assign
3513
- */
3514
- rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
3515
- rb_ary_push(members, rb_str_new2("vid"));
3516
-
3517
3511
  /* Document-method: value
3518
3512
  * an expression whose result is the new value of the class
3519
3513
  * variable
3520
3514
  */
3521
3515
  rb_define_method(rb_cCVDECL, "value", node_value, 0);
3522
3516
  rb_ary_push(members, rb_str_new2("value"));
3517
+
3518
+ /* Document-method: vid
3519
+ * the name of the class variable to assign
3520
+ */
3521
+ rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
3522
+ rb_ary_push(members, rb_str_new2("vid"));
3523
3523
  }
3524
3524
 
3525
3525
  /* Document-class: Node::DASGN
@@ -3542,17 +3542,17 @@ void define_node_subclass_methods()
3542
3542
  rb_iv_set(rb_cDASGN, "__type__", INT2NUM(NODE_DASGN));
3543
3543
  rb_define_singleton_method(rb_cDASGN, "members", node_s_members, 0);
3544
3544
 
3545
- /* Document-method: vid
3546
- * the name of the local variable
3547
- */
3548
- rb_define_method(rb_cDASGN, "vid", node_vid, 0);
3549
- rb_ary_push(members, rb_str_new2("vid"));
3550
-
3551
3545
  /* Document-method: value
3552
3546
  * the value to assign to the local variable
3553
3547
  */
3554
3548
  rb_define_method(rb_cDASGN, "value", node_value, 0);
3555
3549
  rb_ary_push(members, rb_str_new2("value"));
3550
+
3551
+ /* Document-method: vid
3552
+ * the name of the local variable
3553
+ */
3554
+ rb_define_method(rb_cDASGN, "vid", node_vid, 0);
3555
+ rb_ary_push(members, rb_str_new2("vid"));
3556
3556
  }
3557
3557
 
3558
3558
  /* Document-class: Node::DASGN_CURR
@@ -3567,17 +3567,17 @@ void define_node_subclass_methods()
3567
3567
  rb_iv_set(rb_cDASGN_CURR, "__type__", INT2NUM(NODE_DASGN_CURR));
3568
3568
  rb_define_singleton_method(rb_cDASGN_CURR, "members", node_s_members, 0);
3569
3569
 
3570
- /* Document-method: vid
3571
- * the name of the local variable
3572
- */
3573
- rb_define_method(rb_cDASGN_CURR, "vid", node_vid, 0);
3574
- rb_ary_push(members, rb_str_new2("vid"));
3575
-
3576
3570
  /* Document-method: value
3577
3571
  * the value to assign to the local variable
3578
3572
  */
3579
3573
  rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
3580
3574
  rb_ary_push(members, rb_str_new2("value"));
3575
+
3576
+ /* Document-method: vid
3577
+ * the name of the local variable
3578
+ */
3579
+ rb_define_method(rb_cDASGN_CURR, "vid", node_vid, 0);
3580
+ rb_ary_push(members, rb_str_new2("vid"));
3581
3581
  }
3582
3582
 
3583
3583
  /* Document-class: Node::DEFINED
@@ -3613,18 +3613,18 @@ void define_node_subclass_methods()
3613
3613
  rb_iv_set(rb_cDEFN, "__type__", INT2NUM(NODE_DEFN));
3614
3614
  rb_define_singleton_method(rb_cDEFN, "members", node_s_members, 0);
3615
3615
 
3616
- /* Document-method: mid
3617
- * the name of the method* defn the body of the method
3618
- */
3619
- rb_define_method(rb_cDEFN, "mid", node_mid, 0);
3620
- rb_ary_push(members, rb_str_new2("mid"));
3621
-
3622
3616
  /* Document-method: defn
3623
3617
  * the body of the method definition
3624
3618
  */
3625
3619
  rb_define_method(rb_cDEFN, "defn", node_defn, 0);
3626
3620
  rb_ary_push(members, rb_str_new2("defn"));
3627
3621
 
3622
+ /* Document-method: mid
3623
+ * the name of the method* defn the body of the method
3624
+ */
3625
+ rb_define_method(rb_cDEFN, "mid", node_mid, 0);
3626
+ rb_ary_push(members, rb_str_new2("mid"));
3627
+
3628
3628
  /* Document-method: noex
3629
3629
  * the flags which should be used to define the method
3630
3630
  */
@@ -3645,12 +3645,6 @@ void define_node_subclass_methods()
3645
3645
  rb_iv_set(rb_cDEFS, "__member__", members);
3646
3646
  rb_iv_set(rb_cDEFS, "__type__", INT2NUM(NODE_DEFS));
3647
3647
  rb_define_singleton_method(rb_cDEFS, "members", node_s_members, 0);
3648
-
3649
- /* Document-method: mid
3650
- * the name of the method* defn the body of the method
3651
- */
3652
- rb_define_method(rb_cDEFS, "mid", node_mid, 0);
3653
- rb_ary_push(members, rb_str_new2("mid"));
3654
3648
  rb_define_method(rb_cDEFS, "defn", node_defn, 0);
3655
3649
  rb_ary_push(members, rb_str_new2("defn"));
3656
3650
 
@@ -3659,6 +3653,12 @@ void define_node_subclass_methods()
3659
3653
  */
3660
3654
  rb_define_method(rb_cDEFS, "recv", node_recv, 0);
3661
3655
  rb_ary_push(members, rb_str_new2("recv"));
3656
+
3657
+ /* Document-method: mid
3658
+ * the name of the method* defn the body of the method
3659
+ */
3660
+ rb_define_method(rb_cDEFS, "mid", node_mid, 0);
3661
+ rb_ary_push(members, rb_str_new2("mid"));
3662
3662
  }
3663
3663
 
3664
3664
  /* Document-class: Node::DOT2
@@ -3674,6 +3674,12 @@ void define_node_subclass_methods()
3674
3674
  rb_iv_set(rb_cDOT2, "__type__", INT2NUM(NODE_DOT2));
3675
3675
  rb_define_singleton_method(rb_cDOT2, "members", node_s_members, 0);
3676
3676
 
3677
+ /* Document-method: beg
3678
+ * the beginning of the range
3679
+ */
3680
+ rb_define_method(rb_cDOT2, "beg", node_beg, 0);
3681
+ rb_ary_push(members, rb_str_new2("beg"));
3682
+
3677
3683
  /* Document-method: end
3678
3684
  * the end of the range
3679
3685
  */
@@ -3681,12 +3687,6 @@ void define_node_subclass_methods()
3681
3687
  rb_ary_push(members, rb_str_new2("end"));
3682
3688
  rb_define_method(rb_cDOT2, "state", node_state, 0);
3683
3689
  rb_ary_push(members, rb_str_new2("state"));
3684
-
3685
- /* Document-method: beg
3686
- * the beginning of the range
3687
- */
3688
- rb_define_method(rb_cDOT2, "beg", node_beg, 0);
3689
- rb_ary_push(members, rb_str_new2("beg"));
3690
3690
  }
3691
3691
 
3692
3692
  /* Document-class: Node::DOT3
@@ -3702,6 +3702,12 @@ void define_node_subclass_methods()
3702
3702
  rb_iv_set(rb_cDOT3, "__type__", INT2NUM(NODE_DOT3));
3703
3703
  rb_define_singleton_method(rb_cDOT3, "members", node_s_members, 0);
3704
3704
 
3705
+ /* Document-method: beg
3706
+ * the beginning of the range
3707
+ */
3708
+ rb_define_method(rb_cDOT3, "beg", node_beg, 0);
3709
+ rb_ary_push(members, rb_str_new2("beg"));
3710
+
3705
3711
  /* Document-method: end
3706
3712
  * the end of the range
3707
3713
  */
@@ -3709,12 +3715,6 @@ void define_node_subclass_methods()
3709
3715
  rb_ary_push(members, rb_str_new2("end"));
3710
3716
  rb_define_method(rb_cDOT3, "state", node_state, 0);
3711
3717
  rb_ary_push(members, rb_str_new2("state"));
3712
-
3713
- /* Document-method: beg
3714
- * the beginning of the range
3715
- */
3716
- rb_define_method(rb_cDOT3, "beg", node_beg, 0);
3717
- rb_ary_push(members, rb_str_new2("beg"));
3718
3718
  }
3719
3719
 
3720
3720
  /* Document-class: Node::DREGX
@@ -3739,6 +3739,12 @@ void define_node_subclass_methods()
3739
3739
  rb_define_method(rb_cDREGX, "lit", node_lit, 0);
3740
3740
  rb_ary_push(members, rb_str_new2("lit"));
3741
3741
 
3742
+ /* Document-method: next
3743
+ * a list of expressions to be appended onto the string
3744
+ */
3745
+ rb_define_method(rb_cDREGX, "next", node_next, 0);
3746
+ rb_ary_push(members, rb_str_new2("next"));
3747
+
3742
3748
  /* Document-method: cflag
3743
3749
  * a bitfield containing the options used in the regular
3744
3750
  * expression. Valid values include:
@@ -3755,12 +3761,6 @@ void define_node_subclass_methods()
3755
3761
  */
3756
3762
  rb_define_method(rb_cDREGX, "cflag", node_cflag, 0);
3757
3763
  rb_ary_push(members, rb_str_new2("cflag"));
3758
-
3759
- /* Document-method: next
3760
- * a list of expressions to be appended onto the string
3761
- */
3762
- rb_define_method(rb_cDREGX, "next", node_next, 0);
3763
- rb_ary_push(members, rb_str_new2("next"));
3764
3764
  }
3765
3765
 
3766
3766
  /* Document-class: Node::DREGX_ONCE
@@ -3782,18 +3782,18 @@ void define_node_subclass_methods()
3782
3782
  rb_define_method(rb_cDREGX_ONCE, "lit", node_lit, 0);
3783
3783
  rb_ary_push(members, rb_str_new2("lit"));
3784
3784
 
3785
+ /* Document-method: next
3786
+ * a list of expressions to be appended onto the string
3787
+ */
3788
+ rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
3789
+ rb_ary_push(members, rb_str_new2("next"));
3790
+
3785
3791
  /* Document-method: cflag
3786
3792
  * a bitfield containing the options used in the regular
3787
3793
  * expression. See DREGX for a list of valid values.
3788
3794
  */
3789
3795
  rb_define_method(rb_cDREGX_ONCE, "cflag", node_cflag, 0);
3790
3796
  rb_ary_push(members, rb_str_new2("cflag"));
3791
-
3792
- /* Document-method: next
3793
- * a list of expressions to be appended onto the string
3794
- */
3795
- rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
3796
- rb_ary_push(members, rb_str_new2("next"));
3797
3797
  }
3798
3798
 
3799
3799
  /* Document-class: Node::DSTR
@@ -3985,17 +3985,17 @@ void define_node_subclass_methods()
3985
3985
  rb_iv_set(rb_cFCALL, "__type__", INT2NUM(NODE_FCALL));
3986
3986
  rb_define_singleton_method(rb_cFCALL, "members", node_s_members, 0);
3987
3987
 
3988
- /* Document-method: mid
3989
- * the method id
3990
- */
3991
- rb_define_method(rb_cFCALL, "mid", node_mid, 0);
3992
- rb_ary_push(members, rb_str_new2("mid"));
3993
-
3994
3988
  /* Document-method: args
3995
3989
  * the arguments to the method
3996
3990
  */
3997
3991
  rb_define_method(rb_cFCALL, "args", node_args, 0);
3998
3992
  rb_ary_push(members, rb_str_new2("args"));
3993
+
3994
+ /* Document-method: mid
3995
+ * the method id
3996
+ */
3997
+ rb_define_method(rb_cFCALL, "mid", node_mid, 0);
3998
+ rb_ary_push(members, rb_str_new2("mid"));
3999
3999
  }
4000
4000
 
4001
4001
  /* Document-class: Node::FLIP2
@@ -4019,17 +4019,17 @@ void define_node_subclass_methods()
4019
4019
  rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
4020
4020
  rb_ary_push(members, rb_str_new2("cnt"));
4021
4021
 
4022
- /* Document-method: end
4023
- * the end of the range
4024
- */
4025
- rb_define_method(rb_cFLIP2, "end", node_end, 0);
4026
- rb_ary_push(members, rb_str_new2("end"));
4027
-
4028
4022
  /* Document-method: beg
4029
4023
  * the beginning of the range
4030
4024
  */
4031
4025
  rb_define_method(rb_cFLIP2, "beg", node_beg, 0);
4032
4026
  rb_ary_push(members, rb_str_new2("beg"));
4027
+
4028
+ /* Document-method: end
4029
+ * the end of the range
4030
+ */
4031
+ rb_define_method(rb_cFLIP2, "end", node_end, 0);
4032
+ rb_ary_push(members, rb_str_new2("end"));
4033
4033
  }
4034
4034
 
4035
4035
  /* Document-class: Node::FLIP3
@@ -4053,17 +4053,17 @@ void define_node_subclass_methods()
4053
4053
  rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
4054
4054
  rb_ary_push(members, rb_str_new2("cnt"));
4055
4055
 
4056
- /* Document-method: end
4057
- * the end of the range
4058
- */
4059
- rb_define_method(rb_cFLIP3, "end", node_end, 0);
4060
- rb_ary_push(members, rb_str_new2("end"));
4061
-
4062
4056
  /* Document-method: beg
4063
4057
  * the beginning of the range
4064
4058
  */
4065
4059
  rb_define_method(rb_cFLIP3, "beg", node_beg, 0);
4066
4060
  rb_ary_push(members, rb_str_new2("beg"));
4061
+
4062
+ /* Document-method: end
4063
+ * the end of the range
4064
+ */
4065
+ rb_define_method(rb_cFLIP3, "end", node_end, 0);
4066
+ rb_ary_push(members, rb_str_new2("end"));
4067
4067
  }
4068
4068
 
4069
4069
  /* Document-class: Node::FOR
@@ -4088,18 +4088,18 @@ void define_node_subclass_methods()
4088
4088
  rb_iv_set(rb_cFOR, "__type__", INT2NUM(NODE_FOR));
4089
4089
  rb_define_singleton_method(rb_cFOR, "members", node_s_members, 0);
4090
4090
 
4091
- /* Document-method: iter
4092
- * the sequence over which to iterate
4093
- */
4094
- rb_define_method(rb_cFOR, "iter", node_iter, 0);
4095
- rb_ary_push(members, rb_str_new2("iter"));
4096
-
4097
4091
  /* Document-method: body
4098
4092
  * the body of the loop
4099
4093
  */
4100
4094
  rb_define_method(rb_cFOR, "body", node_body, 0);
4101
4095
  rb_ary_push(members, rb_str_new2("body"));
4102
4096
 
4097
+ /* Document-method: iter
4098
+ * the sequence over which to iterate
4099
+ */
4100
+ rb_define_method(rb_cFOR, "iter", node_iter, 0);
4101
+ rb_ary_push(members, rb_str_new2("iter"));
4102
+
4103
4103
  /* Document-method: var
4104
4104
  * an assignment node which assigns the next value in the sequence
4105
4105
  * to a variable, which may or may not be local. May also be a
@@ -4120,6 +4120,12 @@ void define_node_subclass_methods()
4120
4120
  rb_iv_set(rb_cGASGN, "__type__", INT2NUM(NODE_GASGN));
4121
4121
  rb_define_singleton_method(rb_cGASGN, "members", node_s_members, 0);
4122
4122
 
4123
+ /* Document-method: value
4124
+ * an expression whose result is the new value of the global variable
4125
+ */
4126
+ rb_define_method(rb_cGASGN, "value", node_value, 0);
4127
+ rb_ary_push(members, rb_str_new2("value"));
4128
+
4123
4129
  /* Document-method: vid
4124
4130
  * the name of the global variable, with a leading '$' character.
4125
4131
  */
@@ -4127,12 +4133,6 @@ void define_node_subclass_methods()
4127
4133
  rb_ary_push(members, rb_str_new2("vid"));
4128
4134
  rb_define_method(rb_cGASGN, "entry", node_entry, 0);
4129
4135
  rb_ary_push(members, rb_str_new2("entry"));
4130
-
4131
- /* Document-method: value
4132
- * an expression whose result is the new value of the global variable
4133
- */
4134
- rb_define_method(rb_cGASGN, "value", node_value, 0);
4135
- rb_ary_push(members, rb_str_new2("value"));
4136
4136
  }
4137
4137
 
4138
4138
  /* Document-class: Node::GVAR
@@ -4185,17 +4185,17 @@ void define_node_subclass_methods()
4185
4185
  rb_iv_set(rb_cIASGN, "__type__", INT2NUM(NODE_IASGN));
4186
4186
  rb_define_singleton_method(rb_cIASGN, "members", node_s_members, 0);
4187
4187
 
4188
- /* Document-method: vid
4189
- * the name of the instance variable, with a leading '@' sign
4190
- */
4191
- rb_define_method(rb_cIASGN, "vid", node_vid, 0);
4192
- rb_ary_push(members, rb_str_new2("vid"));
4193
-
4194
4188
  /* Document-method: value
4195
4189
  * the value to assign to the instance variable
4196
4190
  */
4197
4191
  rb_define_method(rb_cIASGN, "value", node_value, 0);
4198
4192
  rb_ary_push(members, rb_str_new2("value"));
4193
+
4194
+ /* Document-method: vid
4195
+ * the name of the instance variable, with a leading '@' sign
4196
+ */
4197
+ rb_define_method(rb_cIASGN, "vid", node_vid, 0);
4198
+ rb_ary_push(members, rb_str_new2("vid"));
4199
4199
  }
4200
4200
 
4201
4201
  /* Document-class: Node::IF
@@ -4218,6 +4218,7 @@ void define_node_subclass_methods()
4218
4218
  *
4219
4219
  * A conditional block using elsif has another IF node as the else
4220
4220
  * expression.
4221
+ *
4221
4222
  */
4222
4223
  {
4223
4224
  VALUE rb_cIF = rb_define_class_under(rb_cNode, "IF", rb_cNode);
@@ -4227,6 +4228,12 @@ void define_node_subclass_methods()
4227
4228
  rb_iv_set(rb_cIF, "__type__", INT2NUM(NODE_IF));
4228
4229
  rb_define_singleton_method(rb_cIF, "members", node_s_members, 0);
4229
4230
 
4231
+ /* Document-method: cond
4232
+ * the condition to evaluate
4233
+ */
4234
+ rb_define_method(rb_cIF, "cond", node_cond, 0);
4235
+ rb_ary_push(members, rb_str_new2("cond"));
4236
+
4230
4237
  /* Document-method: body
4231
4238
  * the expression to evaluate if the expression is true, or false
4232
4239
  * if the expression is empty
@@ -4234,12 +4241,6 @@ void define_node_subclass_methods()
4234
4241
  rb_define_method(rb_cIF, "body", node_body, 0);
4235
4242
  rb_ary_push(members, rb_str_new2("body"));
4236
4243
 
4237
- /* Document-method: cond
4238
- * the condition to evaluate
4239
- */
4240
- rb_define_method(rb_cIF, "cond", node_cond, 0);
4241
- rb_ary_push(members, rb_str_new2("cond"));
4242
-
4243
4244
  /* Document-method: else
4244
4245
  * the expression to evaluate if the expression is false, or false
4245
4246
  * if the expression is empty
@@ -4259,12 +4260,6 @@ void define_node_subclass_methods()
4259
4260
  rb_iv_set(rb_cIFUNC, "__type__", INT2NUM(NODE_IFUNC));
4260
4261
  rb_define_singleton_method(rb_cIFUNC, "members", node_s_members, 0);
4261
4262
 
4262
- /* Document-method: state
4263
- * always 0
4264
- */
4265
- rb_define_method(rb_cIFUNC, "state", node_state, 0);
4266
- rb_ary_push(members, rb_str_new2("state"));
4267
-
4268
4263
  /* Document-method: cfnc
4269
4264
  * a pointer to the C function to which to yield
4270
4265
  */
@@ -4277,6 +4272,12 @@ void define_node_subclass_methods()
4277
4272
  */
4278
4273
  rb_define_method(rb_cIFUNC, "tval", node_tval, 0);
4279
4274
  rb_ary_push(members, rb_str_new2("tval"));
4275
+
4276
+ /* Document-method: state
4277
+ * always 0
4278
+ */
4279
+ rb_define_method(rb_cIFUNC, "state", node_state, 0);
4280
+ rb_ary_push(members, rb_str_new2("state"));
4280
4281
  }
4281
4282
 
4282
4283
  /* Document-class: Node::ITER
@@ -4300,6 +4301,12 @@ void define_node_subclass_methods()
4300
4301
  rb_iv_set(rb_cITER, "__type__", INT2NUM(NODE_ITER));
4301
4302
  rb_define_singleton_method(rb_cITER, "members", node_s_members, 0);
4302
4303
 
4304
+ /* Document-method: body
4305
+ * the body of the loop
4306
+ */
4307
+ rb_define_method(rb_cITER, "body", node_body, 0);
4308
+ rb_ary_push(members, rb_str_new2("body"));
4309
+
4303
4310
  /* Document-method: iter
4304
4311
  * an expression which calls the desired iteration method, usually
4305
4312
  * recv.each
@@ -4307,12 +4314,6 @@ void define_node_subclass_methods()
4307
4314
  rb_define_method(rb_cITER, "iter", node_iter, 0);
4308
4315
  rb_ary_push(members, rb_str_new2("iter"));
4309
4316
 
4310
- /* Document-method: body
4311
- * the body of the loop
4312
- */
4313
- rb_define_method(rb_cITER, "body", node_body, 0);
4314
- rb_ary_push(members, rb_str_new2("body"));
4315
-
4316
4317
  /* Document-method: var
4317
4318
  * an assignment node which assigns the next value in the sequence
4318
4319
  * to a variable, which may or may not be local. May also be a
@@ -4353,20 +4354,20 @@ void define_node_subclass_methods()
4353
4354
  rb_iv_set(rb_cLASGN, "__member__", members);
4354
4355
  rb_iv_set(rb_cLASGN, "__type__", INT2NUM(NODE_LASGN));
4355
4356
  rb_define_singleton_method(rb_cLASGN, "members", node_s_members, 0);
4356
- rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
4357
- rb_ary_push(members, rb_str_new2("cnt"));
4358
-
4359
- /* Document-method: vid
4360
- * the name of the local variable
4361
- */
4362
- rb_define_method(rb_cLASGN, "vid", node_vid, 0);
4363
- rb_ary_push(members, rb_str_new2("vid"));
4364
4357
 
4365
4358
  /* Document-method: value
4366
4359
  * the value to assign to the local variable
4367
4360
  */
4368
4361
  rb_define_method(rb_cLASGN, "value", node_value, 0);
4369
4362
  rb_ary_push(members, rb_str_new2("value"));
4363
+
4364
+ /* Document-method: vid
4365
+ * the name of the local variable
4366
+ */
4367
+ rb_define_method(rb_cLASGN, "vid", node_vid, 0);
4368
+ rb_ary_push(members, rb_str_new2("vid"));
4369
+ rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
4370
+ rb_ary_push(members, rb_str_new2("cnt"));
4370
4371
  }
4371
4372
 
4372
4373
  /* Document-class: Node::LIT
@@ -4398,14 +4399,14 @@ void define_node_subclass_methods()
4398
4399
  rb_iv_set(rb_cLVAR, "__member__", members);
4399
4400
  rb_iv_set(rb_cLVAR, "__type__", INT2NUM(NODE_LVAR));
4400
4401
  rb_define_singleton_method(rb_cLVAR, "members", node_s_members, 0);
4401
- rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
4402
- rb_ary_push(members, rb_str_new2("cnt"));
4403
4402
 
4404
4403
  /* Document-method: vid
4405
4404
  * the name of the local variable to retrieve.
4406
4405
  */
4407
4406
  rb_define_method(rb_cLVAR, "vid", node_vid, 0);
4408
4407
  rb_ary_push(members, rb_str_new2("vid"));
4408
+ rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
4409
+ rb_ary_push(members, rb_str_new2("cnt"));
4409
4410
  }
4410
4411
 
4411
4412
  /* Document-class: Node::MASGN
@@ -4419,18 +4420,18 @@ void define_node_subclass_methods()
4419
4420
  rb_iv_set(rb_cMASGN, "__type__", INT2NUM(NODE_MASGN));
4420
4421
  rb_define_singleton_method(rb_cMASGN, "members", node_s_members, 0);
4421
4422
 
4422
- /* Document-method: head
4423
- * TODO
4424
- */
4425
- rb_define_method(rb_cMASGN, "head", node_head, 0);
4426
- rb_ary_push(members, rb_str_new2("head"));
4427
-
4428
4423
  /* Document-method: args
4429
4424
  * TODO
4430
4425
  */
4431
4426
  rb_define_method(rb_cMASGN, "args", node_args, 0);
4432
4427
  rb_ary_push(members, rb_str_new2("args"));
4433
4428
 
4429
+ /* Document-method: head
4430
+ * TODO
4431
+ */
4432
+ rb_define_method(rb_cMASGN, "head", node_head, 0);
4433
+ rb_ary_push(members, rb_str_new2("head"));
4434
+
4434
4435
  /* Document-method: value
4435
4436
  * TODO
4436
4437
  */
@@ -4584,17 +4585,17 @@ void define_node_subclass_methods()
4584
4585
  rb_iv_set(rb_cMODULE, "__type__", INT2NUM(NODE_MODULE));
4585
4586
  rb_define_singleton_method(rb_cMODULE, "members", node_s_members, 0);
4586
4587
 
4587
- /* Document-method: body
4588
- * the body of the module definition
4589
- */
4590
- rb_define_method(rb_cMODULE, "body", node_body, 0);
4591
- rb_ary_push(members, rb_str_new2("body"));
4592
-
4593
4588
  /* Document-method: cpath
4594
4589
  * the name of the module to define
4595
4590
  */
4596
4591
  rb_define_method(rb_cMODULE, "cpath", node_cpath, 0);
4597
4592
  rb_ary_push(members, rb_str_new2("cpath"));
4593
+
4594
+ /* Document-method: body
4595
+ * the body of the module definition
4596
+ */
4597
+ rb_define_method(rb_cMODULE, "body", node_body, 0);
4598
+ rb_ary_push(members, rb_str_new2("body"));
4598
4599
  }
4599
4600
 
4600
4601
  /* Document-class: Node::NEXT
@@ -4636,17 +4637,17 @@ void define_node_subclass_methods()
4636
4637
  rb_iv_set(rb_cNTH_REF, "__type__", INT2NUM(NODE_NTH_REF));
4637
4638
  rb_define_singleton_method(rb_cNTH_REF, "members", node_s_members, 0);
4638
4639
 
4639
- /* Document-method: cnt
4640
- * the index into the local variable table where the match data is stored
4641
- */
4642
- rb_define_method(rb_cNTH_REF, "cnt", node_cnt, 0);
4643
- rb_ary_push(members, rb_str_new2("cnt"));
4644
-
4645
4640
  /* Document-method: nth
4646
4641
  * the index of the match data item to retrieve
4647
4642
  */
4648
4643
  rb_define_method(rb_cNTH_REF, "nth", node_nth, 0);
4649
4644
  rb_ary_push(members, rb_str_new2("nth"));
4645
+
4646
+ /* Document-method: cnt
4647
+ * the index into the local variable table where the match data is stored
4648
+ */
4649
+ rb_define_method(rb_cNTH_REF, "cnt", node_cnt, 0);
4650
+ rb_ary_push(members, rb_str_new2("cnt"));
4650
4651
  }
4651
4652
 
4652
4653
  /* Document-class: Node::OPT_N
@@ -4699,6 +4700,12 @@ void define_node_subclass_methods()
4699
4700
  rb_iv_set(rb_cOP_ASGN1, "__type__", INT2NUM(NODE_OP_ASGN1));
4700
4701
  rb_define_singleton_method(rb_cOP_ASGN1, "members", node_s_members, 0);
4701
4702
 
4703
+ /* Document-method: args
4704
+ * the arguments to the assigment
4705
+ */
4706
+ rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
4707
+ rb_ary_push(members, rb_str_new2("args"));
4708
+
4702
4709
  /* Document-method: mid
4703
4710
  * 0, 1, or the name a method to call to calculate the value of the
4704
4711
  * rhs
@@ -4711,12 +4718,6 @@ void define_node_subclass_methods()
4711
4718
  */
4712
4719
  rb_define_method(rb_cOP_ASGN1, "recv", node_recv, 0);
4713
4720
  rb_ary_push(members, rb_str_new2("recv"));
4714
-
4715
- /* Document-method: args
4716
- * the arguments to the assigment
4717
- */
4718
- rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
4719
- rb_ary_push(members, rb_str_new2("args"));
4720
4721
  }
4721
4722
 
4722
4723
  /* Document-class: Node::OP_ASGN2
@@ -4772,14 +4773,6 @@ void define_node_subclass_methods()
4772
4773
  rb_iv_set(rb_cOP_ASGN2_ARG, "__type__", INT2NUM(NODE_OP_ASGN2_ARG));
4773
4774
  rb_define_singleton_method(rb_cOP_ASGN2_ARG, "members", node_s_members, 0);
4774
4775
 
4775
- /* Document-method: mid
4776
- * The operation to apply to the attribute before setting it. May
4777
- * be 0 (false) to indicate "logical or" or 1 (nil) to indicate
4778
- * "logical and".
4779
- */
4780
- rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
4781
- rb_ary_push(members, rb_str_new2("mid"));
4782
-
4783
4776
  /* Document-method: vid
4784
4777
  * The method to call on the receiver to retrieve the attribute
4785
4778
  */
@@ -4791,6 +4784,14 @@ void define_node_subclass_methods()
4791
4784
  */
4792
4785
  rb_define_method(rb_cOP_ASGN2_ARG, "aid", node_aid, 0);
4793
4786
  rb_ary_push(members, rb_str_new2("aid"));
4787
+
4788
+ /* Document-method: mid
4789
+ * The operation to apply to the attribute before setting it. May
4790
+ * be 0 (false) to indicate "logical or" or 1 (nil) to indicate
4791
+ * "logical and".
4792
+ */
4793
+ rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
4794
+ rb_ary_push(members, rb_str_new2("mid"));
4794
4795
  }
4795
4796
 
4796
4797
  /* Document-class: Node::OP_ASGN_AND
@@ -4839,12 +4840,6 @@ void define_node_subclass_methods()
4839
4840
  rb_iv_set(rb_cOP_ASGN_OR, "__type__", INT2NUM(NODE_OP_ASGN_OR));
4840
4841
  rb_define_singleton_method(rb_cOP_ASGN_OR, "members", node_s_members, 0);
4841
4842
 
4842
- /* Document-method: recv
4843
- * the receiver of the assignment
4844
- */
4845
- rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
4846
- rb_ary_push(members, rb_str_new2("recv"));
4847
-
4848
4843
  /* Document-method: aid
4849
4844
  * if this indicator is nonzero, ruby will check to see if the
4850
4845
  * provided expression is defined, otherwise it will assume that
@@ -4858,6 +4853,12 @@ void define_node_subclass_methods()
4858
4853
  */
4859
4854
  rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
4860
4855
  rb_ary_push(members, rb_str_new2("value"));
4856
+
4857
+ /* Document-method: recv
4858
+ * the receiver of the assignment
4859
+ */
4860
+ rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
4861
+ rb_ary_push(members, rb_str_new2("recv"));
4861
4862
  }
4862
4863
 
4863
4864
  /* Document-class: Node::OR
@@ -5099,13 +5100,6 @@ void define_node_subclass_methods()
5099
5100
  rb_iv_set(rb_cSCOPE, "__type__", INT2NUM(NODE_SCOPE));
5100
5101
  rb_define_singleton_method(rb_cSCOPE, "members", node_s_members, 0);
5101
5102
 
5102
- /* Document-method: rval
5103
- * holds information about which class(es) to search for constants
5104
- * in this scope
5105
- */
5106
- rb_define_method(rb_cSCOPE, "rval", node_rval, 0);
5107
- rb_ary_push(members, rb_str_new2("rval"));
5108
-
5109
5103
  /* Document-method: tbl
5110
5104
  * the names of the local variables* next the first expression in
5111
5105
  * the scope
@@ -5113,6 +5107,13 @@ void define_node_subclass_methods()
5113
5107
  rb_define_method(rb_cSCOPE, "tbl", node_tbl, 0);
5114
5108
  rb_ary_push(members, rb_str_new2("tbl"));
5115
5109
 
5110
+ /* Document-method: rval
5111
+ * holds information about which class(es) to search for constants
5112
+ * in this scope
5113
+ */
5114
+ rb_define_method(rb_cSCOPE, "rval", node_rval, 0);
5115
+ rb_ary_push(members, rb_str_new2("rval"));
5116
+
5116
5117
  /* Document-method: next
5117
5118
  * the body of the lexical scope
5118
5119
  */
@@ -5259,8 +5260,6 @@ void define_node_subclass_methods()
5259
5260
  rb_iv_set(rb_cUNTIL, "__member__", members);
5260
5261
  rb_iv_set(rb_cUNTIL, "__type__", INT2NUM(NODE_UNTIL));
5261
5262
  rb_define_singleton_method(rb_cUNTIL, "members", node_s_members, 0);
5262
- rb_define_method(rb_cUNTIL, "state", node_state, 0);
5263
- rb_ary_push(members, rb_str_new2("state"));
5264
5263
 
5265
5264
  /* Document-method: body
5266
5265
  * the body of the loop
@@ -5273,6 +5272,8 @@ void define_node_subclass_methods()
5273
5272
  */
5274
5273
  rb_define_method(rb_cUNTIL, "cond", node_cond, 0);
5275
5274
  rb_ary_push(members, rb_str_new2("cond"));
5275
+ rb_define_method(rb_cUNTIL, "state", node_state, 0);
5276
+ rb_ary_push(members, rb_str_new2("state"));
5276
5277
  }
5277
5278
 
5278
5279
  /* Document-class: Node::VALIAS
@@ -5288,10 +5289,10 @@ void define_node_subclass_methods()
5288
5289
  rb_iv_set(rb_cVALIAS, "__member__", members);
5289
5290
  rb_iv_set(rb_cVALIAS, "__type__", INT2NUM(NODE_VALIAS));
5290
5291
  rb_define_singleton_method(rb_cVALIAS, "members", node_s_members, 0);
5291
- rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
5292
- rb_ary_push(members, rb_str_new2("second"));
5293
5292
  rb_define_method(rb_cVALIAS, "first", node_1st, 0);
5294
5293
  rb_ary_push(members, rb_str_new2("first"));
5294
+ rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
5295
+ rb_ary_push(members, rb_str_new2("second"));
5295
5296
  }
5296
5297
 
5297
5298
  /* Document-class: Node::VCALL
@@ -5383,8 +5384,6 @@ void define_node_subclass_methods()
5383
5384
  rb_iv_set(rb_cWHILE, "__member__", members);
5384
5385
  rb_iv_set(rb_cWHILE, "__type__", INT2NUM(NODE_WHILE));
5385
5386
  rb_define_singleton_method(rb_cWHILE, "members", node_s_members, 0);
5386
- rb_define_method(rb_cWHILE, "state", node_state, 0);
5387
- rb_ary_push(members, rb_str_new2("state"));
5388
5387
 
5389
5388
  /* Document-method: body
5390
5389
  * the body of the loop
@@ -5397,6 +5396,8 @@ void define_node_subclass_methods()
5397
5396
  */
5398
5397
  rb_define_method(rb_cWHILE, "cond", node_cond, 0);
5399
5398
  rb_ary_push(members, rb_str_new2("cond"));
5399
+ rb_define_method(rb_cWHILE, "state", node_state, 0);
5400
+ rb_ary_push(members, rb_str_new2("state"));
5400
5401
  }
5401
5402
 
5402
5403
  /* Document-class: Node::XSTR