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 global_entry rb_global_entry
7
8
  #define gvar_getter_t rb_gvar_getter_t
8
9
  #define gvar_setter_t rb_gvar_setter_t
@@ -25,6 +26,9 @@ struct global_variable {
25
26
  #define undef_getter rb_gvar_undef_getter
26
27
  #define undef_setter rb_gvar_undef_setter
27
28
  #define undef_marker rb_gvar_undef_marker
29
+ #define val_getter rb_gvar_val_getter
30
+ #define val_setter rb_gvar_val_setter
31
+ #define val_marker rb_gvar_val_marker
28
32
  struct global_entry*
29
33
  rb_global_entry(ID id)
30
34
  {
@@ -2,28 +2,28 @@
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_CFNC, NEN_CNT, 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_REST, NEN_OPT, "ARGS" },
11
- { NODE_ARGSCAT, NEN_BODY, NEN_HEAD, NEN_NONE, "ARGSCAT" },
12
- { NODE_ARGSPUSH, NEN_BODY, NEN_HEAD, NEN_NONE, "ARGSPUSH" },
13
- { NODE_ARRAY, NEN_ALEN, NEN_NEXT, NEN_HEAD, "ARRAY" },
14
- { NODE_ATTRASGN, NEN_RECV, NEN_MID, NEN_ARGS, "ATTRASGN" },
10
+ { NODE_ARGS, NEN_REST, NEN_OPT, NEN_CNT, "ARGS" },
11
+ { NODE_ARGSCAT, NEN_HEAD, NEN_BODY, NEN_NONE, "ARGSCAT" },
12
+ { NODE_ARGSPUSH, NEN_HEAD, NEN_BODY, NEN_NONE, "ARGSPUSH" },
13
+ { NODE_ARRAY, NEN_ALEN, NEN_HEAD, NEN_NEXT, "ARRAY" },
14
+ { NODE_ATTRASGN, NEN_RECV, NEN_ARGS, NEN_MID, "ATTRASGN" },
15
15
  { NODE_BACK_REF, NEN_NTH, NEN_CNT, NEN_NONE, "BACK_REF" },
16
16
  { NODE_BEGIN, NEN_BODY, NEN_NONE, NEN_NONE, "BEGIN" },
17
- { NODE_BLOCK, NEN_NEXT, NEN_HEAD, NEN_NONE, "BLOCK" },
17
+ { NODE_BLOCK, NEN_HEAD, NEN_NEXT, NEN_NONE, "BLOCK" },
18
18
  { NODE_BLOCK_ARG, NEN_CNT, NEN_NONE, NEN_NONE, "BLOCK_ARG" },
19
19
  { NODE_BLOCK_PASS, NEN_BODY, NEN_ITER, NEN_NONE, "BLOCK_PASS" },
20
20
  { NODE_BMETHOD, NEN_CVAL, NEN_NONE, NEN_NONE, "BMETHOD" },
21
21
  { NODE_BREAK, NEN_STTS, NEN_NONE, NEN_NONE, "BREAK" },
22
- { NODE_CALL, NEN_RECV, NEN_MID, NEN_ARGS, "CALL" },
23
- { NODE_CASE, NEN_BODY, NEN_NEXT, NEN_HEAD, "CASE" },
22
+ { NODE_CALL, NEN_ARGS, NEN_MID, NEN_RECV, "CALL" },
23
+ { NODE_CASE, NEN_HEAD, NEN_BODY, NEN_NEXT, "CASE" },
24
24
  { NODE_CDECL, NEN_VALUE, NEN_VID, NEN_NONE, "CDECL" },
25
- { NODE_CLASS, NEN_BODY, NEN_SUPER, NEN_CPATH, "CLASS" },
26
- { NODE_COLON2, NEN_MID, NEN_HEAD, NEN_NONE, "COLON2" },
25
+ { NODE_CLASS, NEN_SUPER, NEN_CPATH, NEN_BODY, "CLASS" },
26
+ { NODE_COLON2, NEN_HEAD, NEN_MID, NEN_NONE, "COLON2" },
27
27
  { NODE_COLON3, NEN_MID, NEN_NONE, NEN_NONE, "COLON3" },
28
28
  { NODE_CONST, NEN_VID, NEN_NONE, NEN_NONE, "CONST" },
29
29
  { NODE_CVAR, NEN_VID, NEN_NONE, NEN_NONE, "CVAR" },
@@ -32,54 +32,54 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
32
32
  { NODE_DASGN, NEN_VALUE, NEN_VID, NEN_NONE, "DASGN" },
33
33
  { NODE_DASGN_CURR, NEN_VALUE, NEN_VID, NEN_NONE, "DASGN_CURR" },
34
34
  { NODE_DEFINED, NEN_HEAD, NEN_NONE, NEN_NONE, "DEFINED" },
35
- { NODE_DEFN, NEN_DEFN, NEN_NOEX, NEN_MID, "DEFN" },
35
+ { NODE_DEFN, NEN_DEFN, NEN_MID, NEN_NOEX, "DEFN" },
36
36
  { NODE_DEFS, NEN_DEFN, NEN_RECV, NEN_MID, "DEFS" },
37
- { NODE_DOT2, NEN_END, NEN_STATE, NEN_BEG, "DOT2" },
38
- { NODE_DOT3, NEN_END, NEN_STATE, NEN_BEG, "DOT3" },
39
- { NODE_DREGX, NEN_CFLAG, NEN_LIT, NEN_NEXT, "DREGX" },
40
- { NODE_DREGX_ONCE, NEN_CFLAG, NEN_LIT, NEN_NEXT, "DREGX_ONCE" },
37
+ { NODE_DOT2, NEN_BEG, NEN_END, NEN_STATE, "DOT2" },
38
+ { NODE_DOT3, NEN_BEG, NEN_END, NEN_STATE, "DOT3" },
39
+ { NODE_DREGX, NEN_LIT, NEN_NEXT, NEN_CFLAG, "DREGX" },
40
+ { NODE_DREGX_ONCE, NEN_LIT, NEN_NEXT, NEN_CFLAG, "DREGX_ONCE" },
41
41
  { NODE_DSTR, NEN_LIT, NEN_NEXT, NEN_NONE, "DSTR" },
42
42
  { NODE_DSYM, NEN_LIT, NEN_NEXT, NEN_NONE, "DSYM" },
43
43
  { NODE_DVAR, NEN_VID, NEN_NONE, NEN_NONE, "DVAR" },
44
44
  { NODE_DXSTR, NEN_LIT, NEN_NEXT, NEN_NONE, "DXSTR" },
45
- { NODE_ENSURE, NEN_ENSR, NEN_HEAD, NEN_NONE, "ENSURE" },
45
+ { NODE_ENSURE, NEN_HEAD, NEN_ENSR, NEN_NONE, "ENSURE" },
46
46
  { NODE_EVSTR, NEN_BODY, NEN_NONE, NEN_NONE, "EVSTR" },
47
47
  { NODE_FALSE, NEN_NONE, NEN_NONE, NEN_NONE, "FALSE" },
48
- { NODE_FCALL, NEN_MID, NEN_ARGS, NEN_NONE, "FCALL" },
49
- { NODE_FLIP2, NEN_CNT, NEN_END, NEN_BEG, "FLIP2" },
50
- { NODE_FLIP3, NEN_CNT, NEN_END, NEN_BEG, "FLIP3" },
48
+ { NODE_FCALL, NEN_ARGS, NEN_MID, NEN_NONE, "FCALL" },
49
+ { NODE_FLIP2, NEN_CNT, NEN_BEG, NEN_END, "FLIP2" },
50
+ { NODE_FLIP3, NEN_CNT, NEN_BEG, NEN_END, "FLIP3" },
51
51
  { NODE_FOR, NEN_BODY, NEN_ITER, NEN_VAR, "FOR" },
52
- { NODE_GASGN, NEN_ENTRY, NEN_VALUE, NEN_VID, "GASGN" },
53
- { NODE_GVAR, NEN_ENTRY, NEN_VID, NEN_NONE, "GVAR" },
52
+ { NODE_GASGN, NEN_VALUE, NEN_VID, NEN_ENTRY, "GASGN" },
53
+ { NODE_GVAR, NEN_VID, NEN_ENTRY, NEN_NONE, "GVAR" },
54
54
  { NODE_HASH, NEN_HEAD, NEN_NONE, NEN_NONE, "HASH" },
55
55
  { NODE_IASGN, NEN_VALUE, NEN_VID, NEN_NONE, "IASGN" },
56
- { NODE_IF, NEN_BODY, NEN_COND, NEN_ELSE, "IF" },
57
- { NODE_IFUNC, NEN_CFNC, NEN_STATE, NEN_TVAL, "IFUNC" },
56
+ { NODE_IF, NEN_COND, NEN_BODY, NEN_ELSE, "IF" },
57
+ { NODE_IFUNC, NEN_CFNC, NEN_TVAL, NEN_STATE, "IFUNC" },
58
58
  { NODE_ITER, NEN_BODY, NEN_ITER, NEN_VAR, "ITER" },
59
59
  { NODE_IVAR, NEN_VID, NEN_NONE, NEN_NONE, "IVAR" },
60
- { NODE_LASGN, NEN_CNT, NEN_VALUE, NEN_VID, "LASGN" },
60
+ { NODE_LASGN, NEN_VALUE, NEN_VID, NEN_CNT, "LASGN" },
61
61
  { NODE_LIT, NEN_LIT, NEN_NONE, NEN_NONE, "LIT" },
62
- { NODE_LVAR, NEN_CNT, NEN_VID, NEN_NONE, "LVAR" },
63
- { NODE_MASGN, NEN_VALUE, NEN_ARGS, NEN_HEAD, "MASGN" },
62
+ { NODE_LVAR, NEN_VID, NEN_CNT, NEN_NONE, "LVAR" },
63
+ { NODE_MASGN, NEN_ARGS, NEN_HEAD, NEN_VALUE, "MASGN" },
64
64
  { NODE_MATCH, NEN_LIT, NEN_VALUE, NEN_NONE, "MATCH" },
65
65
  { NODE_MATCH2, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH2" },
66
66
  { NODE_MATCH3, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH3" },
67
67
  { NODE_MEMO, NEN_NONE, NEN_NONE, NEN_NONE, "MEMO" },
68
- { NODE_MODULE, NEN_BODY, NEN_CPATH, NEN_NONE, "MODULE" },
68
+ { NODE_MODULE, NEN_CPATH, NEN_BODY, NEN_NONE, "MODULE" },
69
69
  { NODE_NEXT, NEN_STTS, NEN_NONE, NEN_NONE, "NEXT" },
70
70
  { NODE_NIL, NEN_NONE, NEN_NONE, NEN_NONE, "NIL" },
71
71
  { NODE_NTH_REF, NEN_NTH, NEN_CNT, NEN_NONE, "NTH_REF" },
72
72
  { NODE_OPT_N, NEN_BODY, NEN_NONE, NEN_NONE, "OPT_N" },
73
- { NODE_OP_ASGN1, NEN_RECV, NEN_MID, NEN_ARGS, "OP_ASGN1" },
73
+ { NODE_OP_ASGN1, NEN_ARGS, NEN_MID, NEN_RECV, "OP_ASGN1" },
74
74
  { NODE_OP_ASGN2, NEN_RECV, NEN_NEXT, NEN_VALUE, "OP_ASGN2" },
75
- { NODE_OP_ASGN2_ARG, NEN_AID, NEN_MID, NEN_VID, "OP_ASGN2_ARG" },
75
+ { NODE_OP_ASGN2_ARG, NEN_VID, NEN_AID, NEN_MID, "OP_ASGN2_ARG" },
76
76
  { NODE_OP_ASGN_AND, NEN_RECV, NEN_VALUE, NEN_NONE, "OP_ASGN_AND" },
77
- { NODE_OP_ASGN_OR, NEN_RECV, NEN_AID, NEN_VALUE, "OP_ASGN_OR" },
77
+ { NODE_OP_ASGN_OR, NEN_AID, NEN_VALUE, NEN_RECV, "OP_ASGN_OR" },
78
78
  { NODE_OR, NEN_2ND, NEN_1ST, NEN_NONE, "OR" },
79
79
  { NODE_POSTEXE, NEN_NONE, NEN_NONE, NEN_NONE, "POSTEXE" },
80
80
  { NODE_REDO, NEN_NONE, NEN_NONE, NEN_NONE, "REDO" },
81
- { NODE_RESBODY, NEN_BODY, NEN_ARGS, NEN_HEAD, "RESBODY" },
82
- { NODE_RESCUE, NEN_RESQ, NEN_ELSE, NEN_HEAD, "RESCUE" },
81
+ { NODE_RESBODY, NEN_HEAD, NEN_BODY, NEN_ARGS, "RESBODY" },
82
+ { NODE_RESCUE, NEN_HEAD, NEN_RESQ, NEN_ELSE, "RESCUE" },
83
83
  { NODE_RETRY, NEN_NONE, NEN_NONE, NEN_NONE, "RETRY" },
84
84
  { NODE_RETURN, NEN_STTS, NEN_NONE, NEN_NONE, "RETURN" },
85
85
  { NODE_SCLASS, NEN_BODY, NEN_RECV, NEN_NONE, "SCLASS" },
@@ -92,12 +92,12 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
92
92
  { NODE_TRUE, NEN_NONE, NEN_NONE, NEN_NONE, "TRUE" },
93
93
  { NODE_UNDEF, NEN_BODY, NEN_NONE, NEN_NONE, "UNDEF" },
94
94
  { NODE_UNTIL, NEN_BODY, NEN_COND, NEN_STATE, "UNTIL" },
95
- { NODE_VALIAS, NEN_2ND, NEN_1ST, NEN_NONE, "VALIAS" },
95
+ { NODE_VALIAS, NEN_1ST, NEN_2ND, NEN_NONE, "VALIAS" },
96
96
  { NODE_VCALL, NEN_MID, NEN_NONE, NEN_NONE, "VCALL" },
97
- { NODE_WHEN, NEN_BODY, NEN_NEXT, NEN_HEAD, "WHEN" },
97
+ { NODE_WHEN, NEN_HEAD, NEN_BODY, NEN_NEXT, "WHEN" },
98
98
  { NODE_WHILE, NEN_BODY, NEN_COND, NEN_STATE, "WHILE" },
99
99
  { NODE_XSTR, NEN_LIT, NEN_NONE, NEN_NONE, "XSTR" },
100
- { NODE_YIELD, NEN_STATE, NEN_HEAD, NEN_NONE, "YIELD" },
100
+ { NODE_YIELD, NEN_HEAD, NEN_STATE, NEN_NONE, "YIELD" },
101
101
  { NODE_ZARRAY, NEN_NONE, NEN_NONE, NEN_NONE, "ZARRAY" },
102
102
  { NODE_ZSUPER, NEN_NONE, NEN_NONE, NEN_NONE, "ZSUPER" },
103
103
  { NODE_LAST, NEN_NONE, NEN_NONE, NEN_NONE, "LAST" },
@@ -2822,10 +2822,10 @@ void define_node_subclass_methods()
2822
2822
  rb_iv_set(rb_cALIAS, "__member__", members);
2823
2823
  rb_iv_set(rb_cALIAS, "__type__", INT2NUM(NODE_ALIAS));
2824
2824
  rb_define_singleton_method(rb_cALIAS, "members", node_s_members, 0);
2825
- rb_define_method(rb_cALIAS, "second", node_2nd, 0);
2826
- rb_ary_push(members, rb_str_new2("second"));
2827
2825
  rb_define_method(rb_cALIAS, "first", node_1st, 0);
2828
2826
  rb_ary_push(members, rb_str_new2("first"));
2827
+ rb_define_method(rb_cALIAS, "second", node_2nd, 0);
2828
+ rb_ary_push(members, rb_str_new2("second"));
2829
2829
  }
2830
2830
 
2831
2831
  /* Document-class: Node::ALLOCA
@@ -2849,17 +2849,17 @@ void define_node_subclass_methods()
2849
2849
  rb_define_method(rb_cALLOCA, "cfnc", node_cfnc, 0);
2850
2850
  rb_ary_push(members, rb_str_new2("cfnc"));
2851
2851
 
2852
- /* Document-method: cnt
2853
- * the number of bytes allocated
2854
- */
2855
- rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
2856
- rb_ary_push(members, rb_str_new2("cnt"));
2857
-
2858
2852
  /* Document-method: value
2859
2853
  * a pointer to the previously allocated temporary node
2860
2854
  */
2861
2855
  rb_define_method(rb_cALLOCA, "value", node_value, 0);
2862
2856
  rb_ary_push(members, rb_str_new2("value"));
2857
+
2858
+ /* Document-method: cnt
2859
+ * the number of bytes allocated
2860
+ */
2861
+ rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
2862
+ rb_ary_push(members, rb_str_new2("cnt"));
2863
2863
  }
2864
2864
  #endif
2865
2865
 
@@ -2902,12 +2902,6 @@ void define_node_subclass_methods()
2902
2902
  rb_iv_set(rb_cARGS, "__type__", INT2NUM(NODE_ARGS));
2903
2903
  rb_define_singleton_method(rb_cARGS, "members", node_s_members, 0);
2904
2904
 
2905
- /* Document-method: cnt
2906
- * the number of required arguments
2907
- */
2908
- rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
2909
- rb_ary_push(members, rb_str_new2("cnt"));
2910
-
2911
2905
  /* Document-method: rest
2912
2906
  * an assignment node to assign the rest arg, if it is present
2913
2907
  */
@@ -2920,6 +2914,12 @@ void define_node_subclass_methods()
2920
2914
  */
2921
2915
  rb_define_method(rb_cARGS, "opt", node_opt, 0);
2922
2916
  rb_ary_push(members, rb_str_new2("opt"));
2917
+
2918
+ /* Document-method: cnt
2919
+ * the number of required arguments
2920
+ */
2921
+ rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
2922
+ rb_ary_push(members, rb_str_new2("cnt"));
2923
2923
  }
2924
2924
 
2925
2925
  /* Document-class: Node::ARGSCAT
@@ -2939,18 +2939,18 @@ void define_node_subclass_methods()
2939
2939
  rb_iv_set(rb_cARGSCAT, "__type__", INT2NUM(NODE_ARGSCAT));
2940
2940
  rb_define_singleton_method(rb_cARGSCAT, "members", node_s_members, 0);
2941
2941
 
2942
+ /* Document-method: head
2943
+ * a list of fixed arguments
2944
+ */
2945
+ rb_define_method(rb_cARGSCAT, "head", node_head, 0);
2946
+ rb_ary_push(members, rb_str_new2("head"));
2947
+
2942
2948
  /* Document-method: body
2943
2949
  * the last argument, which will be splatted onto the end of the
2944
2950
  * fixed arguments
2945
2951
  */
2946
2952
  rb_define_method(rb_cARGSCAT, "body", node_body, 0);
2947
2953
  rb_ary_push(members, rb_str_new2("body"));
2948
-
2949
- /* Document-method: head
2950
- * a list of fixed arguments
2951
- */
2952
- rb_define_method(rb_cARGSCAT, "head", node_head, 0);
2953
- rb_ary_push(members, rb_str_new2("head"));
2954
2954
  }
2955
2955
 
2956
2956
  /* Document-class: Node::ARGSPUSH
@@ -2967,10 +2967,10 @@ void define_node_subclass_methods()
2967
2967
  rb_iv_set(rb_cARGSPUSH, "__member__", members);
2968
2968
  rb_iv_set(rb_cARGSPUSH, "__type__", INT2NUM(NODE_ARGSPUSH));
2969
2969
  rb_define_singleton_method(rb_cARGSPUSH, "members", node_s_members, 0);
2970
- rb_define_method(rb_cARGSPUSH, "body", node_body, 0);
2971
- rb_ary_push(members, rb_str_new2("body"));
2972
2970
  rb_define_method(rb_cARGSPUSH, "head", node_head, 0);
2973
2971
  rb_ary_push(members, rb_str_new2("head"));
2972
+ rb_define_method(rb_cARGSPUSH, "body", node_body, 0);
2973
+ rb_ary_push(members, rb_str_new2("body"));
2974
2974
  }
2975
2975
 
2976
2976
  /* Document-class: Node::ARRAY
@@ -2988,17 +2988,17 @@ void define_node_subclass_methods()
2988
2988
  rb_define_method(rb_cARRAY, "alen", node_alen, 0);
2989
2989
  rb_ary_push(members, rb_str_new2("alen"));
2990
2990
 
2991
- /* Document-method: next
2992
- * the tail of the array
2993
- */
2994
- rb_define_method(rb_cARRAY, "next", node_next, 0);
2995
- rb_ary_push(members, rb_str_new2("next"));
2996
-
2997
2991
  /* Document-method: head
2998
2992
  * the first element of the array
2999
2993
  */
3000
2994
  rb_define_method(rb_cARRAY, "head", node_head, 0);
3001
2995
  rb_ary_push(members, rb_str_new2("head"));
2996
+
2997
+ /* Document-method: next
2998
+ * the tail of the array
2999
+ */
3000
+ rb_define_method(rb_cARRAY, "next", node_next, 0);
3001
+ rb_ary_push(members, rb_str_new2("next"));
3002
3002
  }
3003
3003
 
3004
3004
  /* Document-class: Node::ATTRASGN
@@ -3021,17 +3021,17 @@ void define_node_subclass_methods()
3021
3021
  rb_define_method(rb_cATTRASGN, "recv", node_recv, 0);
3022
3022
  rb_ary_push(members, rb_str_new2("recv"));
3023
3023
 
3024
- /* Document-method: mid
3025
- * the id of the attribute, with a trailing '=' sign
3026
- */
3027
- rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
3028
- rb_ary_push(members, rb_str_new2("mid"));
3029
-
3030
3024
  /* Document-method: args
3031
3025
  * the arguments to the method
3032
3026
  */
3033
3027
  rb_define_method(rb_cATTRASGN, "args", node_args, 0);
3034
3028
  rb_ary_push(members, rb_str_new2("args"));
3029
+
3030
+ /* Document-method: mid
3031
+ * the id of the attribute, with a trailing '=' sign
3032
+ */
3033
+ rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
3034
+ rb_ary_push(members, rb_str_new2("mid"));
3035
3035
  }
3036
3036
 
3037
3037
  /* Document-class: Node::BACK_REF
@@ -3098,17 +3098,17 @@ void define_node_subclass_methods()
3098
3098
  rb_iv_set(rb_cBLOCK, "__type__", INT2NUM(NODE_BLOCK));
3099
3099
  rb_define_singleton_method(rb_cBLOCK, "members", node_s_members, 0);
3100
3100
 
3101
- /* Document-method: next
3102
- * the second expression in the block of code
3103
- */
3104
- rb_define_method(rb_cBLOCK, "next", node_next, 0);
3105
- rb_ary_push(members, rb_str_new2("next"));
3106
-
3107
3101
  /* Document-method: head
3108
3102
  * the first expression in the block of code
3109
3103
  */
3110
3104
  rb_define_method(rb_cBLOCK, "head", node_head, 0);
3111
3105
  rb_ary_push(members, rb_str_new2("head"));
3106
+
3107
+ /* Document-method: next
3108
+ * the second expression in the block of code
3109
+ */
3110
+ rb_define_method(rb_cBLOCK, "next", node_next, 0);
3111
+ rb_ary_push(members, rb_str_new2("next"));
3112
3112
  }
3113
3113
 
3114
3114
  /* Document-class: Node::BLOCK_ARG
@@ -3216,11 +3216,11 @@ void define_node_subclass_methods()
3216
3216
  rb_iv_set(rb_cCALL, "__type__", INT2NUM(NODE_CALL));
3217
3217
  rb_define_singleton_method(rb_cCALL, "members", node_s_members, 0);
3218
3218
 
3219
- /* Document-method: recv
3220
- * the receiver of the method
3219
+ /* Document-method: args
3220
+ * the arguments to the method
3221
3221
  */
3222
- rb_define_method(rb_cCALL, "recv", node_recv, 0);
3223
- rb_ary_push(members, rb_str_new2("recv"));
3222
+ rb_define_method(rb_cCALL, "args", node_args, 0);
3223
+ rb_ary_push(members, rb_str_new2("args"));
3224
3224
 
3225
3225
  /* Document-method: mid
3226
3226
  * the method id
@@ -3228,11 +3228,11 @@ void define_node_subclass_methods()
3228
3228
  rb_define_method(rb_cCALL, "mid", node_mid, 0);
3229
3229
  rb_ary_push(members, rb_str_new2("mid"));
3230
3230
 
3231
- /* Document-method: args
3232
- * the arguments to the method
3231
+ /* Document-method: recv
3232
+ * the receiver of the method
3233
3233
  */
3234
- rb_define_method(rb_cCALL, "args", node_args, 0);
3235
- rb_ary_push(members, rb_str_new2("args"));
3234
+ rb_define_method(rb_cCALL, "recv", node_recv, 0);
3235
+ rb_ary_push(members, rb_str_new2("recv"));
3236
3236
  }
3237
3237
 
3238
3238
  /* Document-class: Node::CASE
@@ -3250,6 +3250,12 @@ void define_node_subclass_methods()
3250
3250
  rb_iv_set(rb_cCASE, "__type__", INT2NUM(NODE_CASE));
3251
3251
  rb_define_singleton_method(rb_cCASE, "members", node_s_members, 0);
3252
3252
 
3253
+ /* Document-method: head
3254
+ * the value to select on
3255
+ */
3256
+ rb_define_method(rb_cCASE, "head", node_head, 0);
3257
+ rb_ary_push(members, rb_str_new2("head"));
3258
+
3253
3259
  /* Document-method: body
3254
3260
  * a linked list of nodes, each node representing a when
3255
3261
  * conditional
@@ -3258,12 +3264,6 @@ void define_node_subclass_methods()
3258
3264
  rb_ary_push(members, rb_str_new2("body"));
3259
3265
  rb_define_method(rb_cCASE, "next", node_next, 0);
3260
3266
  rb_ary_push(members, rb_str_new2("next"));
3261
-
3262
- /* Document-method: head
3263
- * the value to select on
3264
- */
3265
- rb_define_method(rb_cCASE, "head", node_head, 0);
3266
- rb_ary_push(members, rb_str_new2("head"));
3267
3267
  }
3268
3268
 
3269
3269
  /* Document-class: Node::CDECL
@@ -3315,12 +3315,6 @@ void define_node_subclass_methods()
3315
3315
  rb_iv_set(rb_cCLASS, "__type__", INT2NUM(NODE_CLASS));
3316
3316
  rb_define_singleton_method(rb_cCLASS, "members", node_s_members, 0);
3317
3317
 
3318
- /* Document-method: body
3319
- * the body of the class definition
3320
- */
3321
- rb_define_method(rb_cCLASS, "body", node_body, 0);
3322
- rb_ary_push(members, rb_str_new2("body"));
3323
-
3324
3318
  /* Document-method: super
3325
3319
  * an expression returning the base class, or false if there is no
3326
3320
  * base class specified
@@ -3333,6 +3327,12 @@ void define_node_subclass_methods()
3333
3327
  */
3334
3328
  rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
3335
3329
  rb_ary_push(members, rb_str_new2("cpath"));
3330
+
3331
+ /* Document-method: body
3332
+ * the body of the class definition
3333
+ */
3334
+ rb_define_method(rb_cCLASS, "body", node_body, 0);
3335
+ rb_ary_push(members, rb_str_new2("body"));
3336
3336
  }
3337
3337
 
3338
3338
  /* Document-class: Node::COLON2
@@ -3351,17 +3351,17 @@ void define_node_subclass_methods()
3351
3351
  rb_iv_set(rb_cCOLON2, "__type__", INT2NUM(NODE_COLON2));
3352
3352
  rb_define_singleton_method(rb_cCOLON2, "members", node_s_members, 0);
3353
3353
 
3354
- /* Document-method: mid
3355
- * the name of the method or constant to call/look up
3356
- */
3357
- rb_define_method(rb_cCOLON2, "mid", node_mid, 0);
3358
- rb_ary_push(members, rb_str_new2("mid"));
3359
-
3360
3354
  /* Document-method: head
3361
3355
  * an expression specifying the class in which to do the lookup
3362
3356
  */
3363
3357
  rb_define_method(rb_cCOLON2, "head", node_head, 0);
3364
3358
  rb_ary_push(members, rb_str_new2("head"));
3359
+
3360
+ /* Document-method: mid
3361
+ * the name of the method or constant to call/look up
3362
+ */
3363
+ rb_define_method(rb_cCOLON2, "mid", node_mid, 0);
3364
+ rb_ary_push(members, rb_str_new2("mid"));
3365
3365
  }
3366
3366
 
3367
3367
  /* Document-class: Node::COLON3
@@ -3572,17 +3572,17 @@ void define_node_subclass_methods()
3572
3572
  rb_define_method(rb_cDEFN, "defn", node_defn, 0);
3573
3573
  rb_ary_push(members, rb_str_new2("defn"));
3574
3574
 
3575
- /* Document-method: noex
3576
- * the flags which should be used to define the method
3577
- */
3578
- rb_define_method(rb_cDEFN, "noex", node_noex, 0);
3579
- rb_ary_push(members, rb_str_new2("noex"));
3580
-
3581
3575
  /* Document-method: mid
3582
3576
  * the name of the method* defn the body of the method
3583
3577
  */
3584
3578
  rb_define_method(rb_cDEFN, "mid", node_mid, 0);
3585
3579
  rb_ary_push(members, rb_str_new2("mid"));
3580
+
3581
+ /* Document-method: noex
3582
+ * the flags which should be used to define the method
3583
+ */
3584
+ rb_define_method(rb_cDEFN, "noex", node_noex, 0);
3585
+ rb_ary_push(members, rb_str_new2("noex"));
3586
3586
  }
3587
3587
 
3588
3588
  /* Document-class: Node::DEFS
@@ -3627,6 +3627,12 @@ void define_node_subclass_methods()
3627
3627
  rb_iv_set(rb_cDOT2, "__type__", INT2NUM(NODE_DOT2));
3628
3628
  rb_define_singleton_method(rb_cDOT2, "members", node_s_members, 0);
3629
3629
 
3630
+ /* Document-method: beg
3631
+ * the beginning of the range
3632
+ */
3633
+ rb_define_method(rb_cDOT2, "beg", node_beg, 0);
3634
+ rb_ary_push(members, rb_str_new2("beg"));
3635
+
3630
3636
  /* Document-method: end
3631
3637
  * the end of the range
3632
3638
  */
@@ -3634,12 +3640,6 @@ void define_node_subclass_methods()
3634
3640
  rb_ary_push(members, rb_str_new2("end"));
3635
3641
  rb_define_method(rb_cDOT2, "state", node_state, 0);
3636
3642
  rb_ary_push(members, rb_str_new2("state"));
3637
-
3638
- /* Document-method: beg
3639
- * the beginning of the range
3640
- */
3641
- rb_define_method(rb_cDOT2, "beg", node_beg, 0);
3642
- rb_ary_push(members, rb_str_new2("beg"));
3643
3643
  }
3644
3644
 
3645
3645
  /* Document-class: Node::DOT3
@@ -3655,6 +3655,12 @@ void define_node_subclass_methods()
3655
3655
  rb_iv_set(rb_cDOT3, "__type__", INT2NUM(NODE_DOT3));
3656
3656
  rb_define_singleton_method(rb_cDOT3, "members", node_s_members, 0);
3657
3657
 
3658
+ /* Document-method: beg
3659
+ * the beginning of the range
3660
+ */
3661
+ rb_define_method(rb_cDOT3, "beg", node_beg, 0);
3662
+ rb_ary_push(members, rb_str_new2("beg"));
3663
+
3658
3664
  /* Document-method: end
3659
3665
  * the end of the range
3660
3666
  */
@@ -3662,12 +3668,6 @@ void define_node_subclass_methods()
3662
3668
  rb_ary_push(members, rb_str_new2("end"));
3663
3669
  rb_define_method(rb_cDOT3, "state", node_state, 0);
3664
3670
  rb_ary_push(members, rb_str_new2("state"));
3665
-
3666
- /* Document-method: beg
3667
- * the beginning of the range
3668
- */
3669
- rb_define_method(rb_cDOT3, "beg", node_beg, 0);
3670
- rb_ary_push(members, rb_str_new2("beg"));
3671
3671
  }
3672
3672
 
3673
3673
  /* Document-class: Node::DREGX
@@ -3686,6 +3686,18 @@ void define_node_subclass_methods()
3686
3686
  rb_iv_set(rb_cDREGX, "__type__", INT2NUM(NODE_DREGX));
3687
3687
  rb_define_singleton_method(rb_cDREGX, "members", node_s_members, 0);
3688
3688
 
3689
+ /* Document-method: lit
3690
+ * a string
3691
+ */
3692
+ rb_define_method(rb_cDREGX, "lit", node_lit, 0);
3693
+ rb_ary_push(members, rb_str_new2("lit"));
3694
+
3695
+ /* Document-method: next
3696
+ * a list of expressions to be appended onto the string
3697
+ */
3698
+ rb_define_method(rb_cDREGX, "next", node_next, 0);
3699
+ rb_ary_push(members, rb_str_new2("next"));
3700
+
3689
3701
  /* Document-method: cflag
3690
3702
  * a bitfield containing the options used in the regular
3691
3703
  * expression. Valid values include:
@@ -3702,18 +3714,6 @@ void define_node_subclass_methods()
3702
3714
  */
3703
3715
  rb_define_method(rb_cDREGX, "cflag", node_cflag, 0);
3704
3716
  rb_ary_push(members, rb_str_new2("cflag"));
3705
-
3706
- /* Document-method: lit
3707
- * a string
3708
- */
3709
- rb_define_method(rb_cDREGX, "lit", node_lit, 0);
3710
- rb_ary_push(members, rb_str_new2("lit"));
3711
-
3712
- /* Document-method: next
3713
- * a list of expressions to be appended onto the string
3714
- */
3715
- rb_define_method(rb_cDREGX, "next", node_next, 0);
3716
- rb_ary_push(members, rb_str_new2("next"));
3717
3717
  }
3718
3718
 
3719
3719
  /* Document-class: Node::DREGX_ONCE
@@ -3729,13 +3729,6 @@ void define_node_subclass_methods()
3729
3729
  rb_iv_set(rb_cDREGX_ONCE, "__type__", INT2NUM(NODE_DREGX_ONCE));
3730
3730
  rb_define_singleton_method(rb_cDREGX_ONCE, "members", node_s_members, 0);
3731
3731
 
3732
- /* Document-method: cflag
3733
- * a bitfield containing the options used in the regular
3734
- * expression. See DREGX for a list of valid values.
3735
- */
3736
- rb_define_method(rb_cDREGX_ONCE, "cflag", node_cflag, 0);
3737
- rb_ary_push(members, rb_str_new2("cflag"));
3738
-
3739
3732
  /* Document-method: lit
3740
3733
  * a string
3741
3734
  */
@@ -3747,6 +3740,13 @@ void define_node_subclass_methods()
3747
3740
  */
3748
3741
  rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
3749
3742
  rb_ary_push(members, rb_str_new2("next"));
3743
+
3744
+ /* Document-method: cflag
3745
+ * a bitfield containing the options used in the regular
3746
+ * expression. See DREGX for a list of valid values.
3747
+ */
3748
+ rb_define_method(rb_cDREGX_ONCE, "cflag", node_cflag, 0);
3749
+ rb_ary_push(members, rb_str_new2("cflag"));
3750
3750
  }
3751
3751
 
3752
3752
  /* Document-class: Node::DSTR
@@ -3877,17 +3877,17 @@ void define_node_subclass_methods()
3877
3877
  rb_iv_set(rb_cENSURE, "__type__", INT2NUM(NODE_ENSURE));
3878
3878
  rb_define_singleton_method(rb_cENSURE, "members", node_s_members, 0);
3879
3879
 
3880
- /* Document-method: ensr
3881
- * the expression to evaluate after the head is evaluated
3882
- */
3883
- rb_define_method(rb_cENSURE, "ensr", node_ensr, 0);
3884
- rb_ary_push(members, rb_str_new2("ensr"));
3885
-
3886
3880
  /* Document-method: head
3887
3881
  * the expression to protect
3888
3882
  */
3889
3883
  rb_define_method(rb_cENSURE, "head", node_head, 0);
3890
3884
  rb_ary_push(members, rb_str_new2("head"));
3885
+
3886
+ /* Document-method: ensr
3887
+ * the expression to evaluate after the head is evaluated
3888
+ */
3889
+ rb_define_method(rb_cENSURE, "ensr", node_ensr, 0);
3890
+ rb_ary_push(members, rb_str_new2("ensr"));
3891
3891
  }
3892
3892
 
3893
3893
  /* Document-class: Node::EVSTR
@@ -3938,17 +3938,17 @@ void define_node_subclass_methods()
3938
3938
  rb_iv_set(rb_cFCALL, "__type__", INT2NUM(NODE_FCALL));
3939
3939
  rb_define_singleton_method(rb_cFCALL, "members", node_s_members, 0);
3940
3940
 
3941
- /* Document-method: mid
3942
- * the method id
3943
- */
3944
- rb_define_method(rb_cFCALL, "mid", node_mid, 0);
3945
- rb_ary_push(members, rb_str_new2("mid"));
3946
-
3947
3941
  /* Document-method: args
3948
3942
  * the arguments to the method
3949
3943
  */
3950
3944
  rb_define_method(rb_cFCALL, "args", node_args, 0);
3951
3945
  rb_ary_push(members, rb_str_new2("args"));
3946
+
3947
+ /* Document-method: mid
3948
+ * the method id
3949
+ */
3950
+ rb_define_method(rb_cFCALL, "mid", node_mid, 0);
3951
+ rb_ary_push(members, rb_str_new2("mid"));
3952
3952
  }
3953
3953
 
3954
3954
  /* Document-class: Node::FLIP2
@@ -3972,17 +3972,17 @@ void define_node_subclass_methods()
3972
3972
  rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
3973
3973
  rb_ary_push(members, rb_str_new2("cnt"));
3974
3974
 
3975
- /* Document-method: end
3976
- * the end of the range
3977
- */
3978
- rb_define_method(rb_cFLIP2, "end", node_end, 0);
3979
- rb_ary_push(members, rb_str_new2("end"));
3980
-
3981
3975
  /* Document-method: beg
3982
3976
  * the beginning of the range
3983
3977
  */
3984
3978
  rb_define_method(rb_cFLIP2, "beg", node_beg, 0);
3985
3979
  rb_ary_push(members, rb_str_new2("beg"));
3980
+
3981
+ /* Document-method: end
3982
+ * the end of the range
3983
+ */
3984
+ rb_define_method(rb_cFLIP2, "end", node_end, 0);
3985
+ rb_ary_push(members, rb_str_new2("end"));
3986
3986
  }
3987
3987
 
3988
3988
  /* Document-class: Node::FLIP3
@@ -4006,17 +4006,17 @@ void define_node_subclass_methods()
4006
4006
  rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
4007
4007
  rb_ary_push(members, rb_str_new2("cnt"));
4008
4008
 
4009
- /* Document-method: end
4010
- * the end of the range
4011
- */
4012
- rb_define_method(rb_cFLIP3, "end", node_end, 0);
4013
- rb_ary_push(members, rb_str_new2("end"));
4014
-
4015
4009
  /* Document-method: beg
4016
4010
  * the beginning of the range
4017
4011
  */
4018
4012
  rb_define_method(rb_cFLIP3, "beg", node_beg, 0);
4019
4013
  rb_ary_push(members, rb_str_new2("beg"));
4014
+
4015
+ /* Document-method: end
4016
+ * the end of the range
4017
+ */
4018
+ rb_define_method(rb_cFLIP3, "end", node_end, 0);
4019
+ rb_ary_push(members, rb_str_new2("end"));
4020
4020
  }
4021
4021
 
4022
4022
  /* Document-class: Node::FOR
@@ -4072,8 +4072,6 @@ void define_node_subclass_methods()
4072
4072
  rb_iv_set(rb_cGASGN, "__member__", members);
4073
4073
  rb_iv_set(rb_cGASGN, "__type__", INT2NUM(NODE_GASGN));
4074
4074
  rb_define_singleton_method(rb_cGASGN, "members", node_s_members, 0);
4075
- rb_define_method(rb_cGASGN, "entry", node_entry, 0);
4076
- rb_ary_push(members, rb_str_new2("entry"));
4077
4075
 
4078
4076
  /* Document-method: value
4079
4077
  * an expression whose result is the new value of the global variable
@@ -4086,6 +4084,8 @@ void define_node_subclass_methods()
4086
4084
  */
4087
4085
  rb_define_method(rb_cGASGN, "vid", node_vid, 0);
4088
4086
  rb_ary_push(members, rb_str_new2("vid"));
4087
+ rb_define_method(rb_cGASGN, "entry", node_entry, 0);
4088
+ rb_ary_push(members, rb_str_new2("entry"));
4089
4089
  }
4090
4090
 
4091
4091
  /* Document-class: Node::GVAR
@@ -4098,14 +4098,14 @@ void define_node_subclass_methods()
4098
4098
  rb_iv_set(rb_cGVAR, "__member__", members);
4099
4099
  rb_iv_set(rb_cGVAR, "__type__", INT2NUM(NODE_GVAR));
4100
4100
  rb_define_singleton_method(rb_cGVAR, "members", node_s_members, 0);
4101
- rb_define_method(rb_cGVAR, "entry", node_entry, 0);
4102
- rb_ary_push(members, rb_str_new2("entry"));
4103
4101
 
4104
4102
  /* Document-method: vid
4105
4103
  * the name of the global variable to retrieve, with a leading '$'
4106
4104
  */
4107
4105
  rb_define_method(rb_cGVAR, "vid", node_vid, 0);
4108
4106
  rb_ary_push(members, rb_str_new2("vid"));
4107
+ rb_define_method(rb_cGVAR, "entry", node_entry, 0);
4108
+ rb_ary_push(members, rb_str_new2("entry"));
4109
4109
  }
4110
4110
 
4111
4111
  /* Document-class: Node::HASH
@@ -4171,6 +4171,7 @@ void define_node_subclass_methods()
4171
4171
  *
4172
4172
  * A conditional block using elsif has another IF node as the else
4173
4173
  * expression.
4174
+ *
4174
4175
  */
4175
4176
  {
4176
4177
  VALUE rb_cIF = rb_define_class_under(rb_cNode, "IF", rb_cNode);
@@ -4180,6 +4181,12 @@ void define_node_subclass_methods()
4180
4181
  rb_iv_set(rb_cIF, "__type__", INT2NUM(NODE_IF));
4181
4182
  rb_define_singleton_method(rb_cIF, "members", node_s_members, 0);
4182
4183
 
4184
+ /* Document-method: cond
4185
+ * the condition to evaluate
4186
+ */
4187
+ rb_define_method(rb_cIF, "cond", node_cond, 0);
4188
+ rb_ary_push(members, rb_str_new2("cond"));
4189
+
4183
4190
  /* Document-method: body
4184
4191
  * the expression to evaluate if the expression is true, or false
4185
4192
  * if the expression is empty
@@ -4187,12 +4194,6 @@ void define_node_subclass_methods()
4187
4194
  rb_define_method(rb_cIF, "body", node_body, 0);
4188
4195
  rb_ary_push(members, rb_str_new2("body"));
4189
4196
 
4190
- /* Document-method: cond
4191
- * the condition to evaluate
4192
- */
4193
- rb_define_method(rb_cIF, "cond", node_cond, 0);
4194
- rb_ary_push(members, rb_str_new2("cond"));
4195
-
4196
4197
  /* Document-method: else
4197
4198
  * the expression to evaluate if the expression is false, or false
4198
4199
  * if the expression is empty
@@ -4218,18 +4219,18 @@ void define_node_subclass_methods()
4218
4219
  rb_define_method(rb_cIFUNC, "cfnc", node_cfnc, 0);
4219
4220
  rb_ary_push(members, rb_str_new2("cfnc"));
4220
4221
 
4221
- /* Document-method: state
4222
- * always 0
4223
- */
4224
- rb_define_method(rb_cIFUNC, "state", node_state, 0);
4225
- rb_ary_push(members, rb_str_new2("state"));
4226
-
4227
4222
  /* Document-method: tval
4228
4223
  * the user-specified data to be passed as the second argument to
4229
4224
  * cfnc
4230
4225
  */
4231
4226
  rb_define_method(rb_cIFUNC, "tval", node_tval, 0);
4232
4227
  rb_ary_push(members, rb_str_new2("tval"));
4228
+
4229
+ /* Document-method: state
4230
+ * always 0
4231
+ */
4232
+ rb_define_method(rb_cIFUNC, "state", node_state, 0);
4233
+ rb_ary_push(members, rb_str_new2("state"));
4233
4234
  }
4234
4235
 
4235
4236
  /* Document-class: Node::ITER
@@ -4306,8 +4307,6 @@ void define_node_subclass_methods()
4306
4307
  rb_iv_set(rb_cLASGN, "__member__", members);
4307
4308
  rb_iv_set(rb_cLASGN, "__type__", INT2NUM(NODE_LASGN));
4308
4309
  rb_define_singleton_method(rb_cLASGN, "members", node_s_members, 0);
4309
- rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
4310
- rb_ary_push(members, rb_str_new2("cnt"));
4311
4310
 
4312
4311
  /* Document-method: value
4313
4312
  * the value to assign to the local variable
@@ -4320,6 +4319,8 @@ void define_node_subclass_methods()
4320
4319
  */
4321
4320
  rb_define_method(rb_cLASGN, "vid", node_vid, 0);
4322
4321
  rb_ary_push(members, rb_str_new2("vid"));
4322
+ rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
4323
+ rb_ary_push(members, rb_str_new2("cnt"));
4323
4324
  }
4324
4325
 
4325
4326
  /* Document-class: Node::LIT
@@ -4351,14 +4352,14 @@ void define_node_subclass_methods()
4351
4352
  rb_iv_set(rb_cLVAR, "__member__", members);
4352
4353
  rb_iv_set(rb_cLVAR, "__type__", INT2NUM(NODE_LVAR));
4353
4354
  rb_define_singleton_method(rb_cLVAR, "members", node_s_members, 0);
4354
- rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
4355
- rb_ary_push(members, rb_str_new2("cnt"));
4356
4355
 
4357
4356
  /* Document-method: vid
4358
4357
  * the name of the local variable to retrieve.
4359
4358
  */
4360
4359
  rb_define_method(rb_cLVAR, "vid", node_vid, 0);
4361
4360
  rb_ary_push(members, rb_str_new2("vid"));
4361
+ rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
4362
+ rb_ary_push(members, rb_str_new2("cnt"));
4362
4363
  }
4363
4364
 
4364
4365
  /* Document-class: Node::MASGN
@@ -4372,12 +4373,6 @@ void define_node_subclass_methods()
4372
4373
  rb_iv_set(rb_cMASGN, "__type__", INT2NUM(NODE_MASGN));
4373
4374
  rb_define_singleton_method(rb_cMASGN, "members", node_s_members, 0);
4374
4375
 
4375
- /* Document-method: value
4376
- * TODO
4377
- */
4378
- rb_define_method(rb_cMASGN, "value", node_value, 0);
4379
- rb_ary_push(members, rb_str_new2("value"));
4380
-
4381
4376
  /* Document-method: args
4382
4377
  * TODO
4383
4378
  */
@@ -4389,6 +4384,12 @@ void define_node_subclass_methods()
4389
4384
  */
4390
4385
  rb_define_method(rb_cMASGN, "head", node_head, 0);
4391
4386
  rb_ary_push(members, rb_str_new2("head"));
4387
+
4388
+ /* Document-method: value
4389
+ * TODO
4390
+ */
4391
+ rb_define_method(rb_cMASGN, "value", node_value, 0);
4392
+ rb_ary_push(members, rb_str_new2("value"));
4392
4393
  }
4393
4394
 
4394
4395
  /* Document-class: Node::MATCH
@@ -4537,17 +4538,17 @@ void define_node_subclass_methods()
4537
4538
  rb_iv_set(rb_cMODULE, "__type__", INT2NUM(NODE_MODULE));
4538
4539
  rb_define_singleton_method(rb_cMODULE, "members", node_s_members, 0);
4539
4540
 
4540
- /* Document-method: body
4541
- * the body of the module definition
4542
- */
4543
- rb_define_method(rb_cMODULE, "body", node_body, 0);
4544
- rb_ary_push(members, rb_str_new2("body"));
4545
-
4546
4541
  /* Document-method: cpath
4547
4542
  * the name of the module to define
4548
4543
  */
4549
4544
  rb_define_method(rb_cMODULE, "cpath", node_cpath, 0);
4550
4545
  rb_ary_push(members, rb_str_new2("cpath"));
4546
+
4547
+ /* Document-method: body
4548
+ * the body of the module definition
4549
+ */
4550
+ rb_define_method(rb_cMODULE, "body", node_body, 0);
4551
+ rb_ary_push(members, rb_str_new2("body"));
4551
4552
  }
4552
4553
 
4553
4554
  /* Document-class: Node::NEXT
@@ -4652,11 +4653,11 @@ void define_node_subclass_methods()
4652
4653
  rb_iv_set(rb_cOP_ASGN1, "__type__", INT2NUM(NODE_OP_ASGN1));
4653
4654
  rb_define_singleton_method(rb_cOP_ASGN1, "members", node_s_members, 0);
4654
4655
 
4655
- /* Document-method: recv
4656
- * the receiver of the assignment
4656
+ /* Document-method: args
4657
+ * the arguments to the assigment
4657
4658
  */
4658
- rb_define_method(rb_cOP_ASGN1, "recv", node_recv, 0);
4659
- rb_ary_push(members, rb_str_new2("recv"));
4659
+ rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
4660
+ rb_ary_push(members, rb_str_new2("args"));
4660
4661
 
4661
4662
  /* Document-method: mid
4662
4663
  * 0, 1, or the name a method to call to calculate the value of the
@@ -4665,11 +4666,11 @@ void define_node_subclass_methods()
4665
4666
  rb_define_method(rb_cOP_ASGN1, "mid", node_mid, 0);
4666
4667
  rb_ary_push(members, rb_str_new2("mid"));
4667
4668
 
4668
- /* Document-method: args
4669
- * the arguments to the assigment
4669
+ /* Document-method: recv
4670
+ * the receiver of the assignment
4670
4671
  */
4671
- rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
4672
- rb_ary_push(members, rb_str_new2("args"));
4672
+ rb_define_method(rb_cOP_ASGN1, "recv", node_recv, 0);
4673
+ rb_ary_push(members, rb_str_new2("recv"));
4673
4674
  }
4674
4675
 
4675
4676
  /* Document-class: Node::OP_ASGN2
@@ -4725,6 +4726,12 @@ void define_node_subclass_methods()
4725
4726
  rb_iv_set(rb_cOP_ASGN2_ARG, "__type__", INT2NUM(NODE_OP_ASGN2_ARG));
4726
4727
  rb_define_singleton_method(rb_cOP_ASGN2_ARG, "members", node_s_members, 0);
4727
4728
 
4729
+ /* Document-method: vid
4730
+ * The method to call on the receiver to retrieve the attribute
4731
+ */
4732
+ rb_define_method(rb_cOP_ASGN2_ARG, "vid", node_vid, 0);
4733
+ rb_ary_push(members, rb_str_new2("vid"));
4734
+
4728
4735
  /* Document-method: aid
4729
4736
  * The method to call on the receiver to set the attribute
4730
4737
  */
@@ -4738,12 +4745,6 @@ void define_node_subclass_methods()
4738
4745
  */
4739
4746
  rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
4740
4747
  rb_ary_push(members, rb_str_new2("mid"));
4741
-
4742
- /* Document-method: vid
4743
- * The method to call on the receiver to retrieve the attribute
4744
- */
4745
- rb_define_method(rb_cOP_ASGN2_ARG, "vid", node_vid, 0);
4746
- rb_ary_push(members, rb_str_new2("vid"));
4747
4748
  }
4748
4749
 
4749
4750
  /* Document-class: Node::OP_ASGN_AND
@@ -4792,12 +4793,6 @@ void define_node_subclass_methods()
4792
4793
  rb_iv_set(rb_cOP_ASGN_OR, "__type__", INT2NUM(NODE_OP_ASGN_OR));
4793
4794
  rb_define_singleton_method(rb_cOP_ASGN_OR, "members", node_s_members, 0);
4794
4795
 
4795
- /* Document-method: recv
4796
- * the receiver of the assignment
4797
- */
4798
- rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
4799
- rb_ary_push(members, rb_str_new2("recv"));
4800
-
4801
4796
  /* Document-method: aid
4802
4797
  * if this indicator is nonzero, ruby will check to see if the
4803
4798
  * provided expression is defined, otherwise it will assume that
@@ -4811,6 +4806,12 @@ void define_node_subclass_methods()
4811
4806
  */
4812
4807
  rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
4813
4808
  rb_ary_push(members, rb_str_new2("value"));
4809
+
4810
+ /* Document-method: recv
4811
+ * the receiver of the assignment
4812
+ */
4813
+ rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
4814
+ rb_ary_push(members, rb_str_new2("recv"));
4814
4815
  }
4815
4816
 
4816
4817
  /* Document-class: Node::OR
@@ -4890,6 +4891,12 @@ void define_node_subclass_methods()
4890
4891
  rb_iv_set(rb_cRESBODY, "__type__", INT2NUM(NODE_RESBODY));
4891
4892
  rb_define_singleton_method(rb_cRESBODY, "members", node_s_members, 0);
4892
4893
 
4894
+ /* Document-method: head
4895
+ * the next rescue
4896
+ */
4897
+ rb_define_method(rb_cRESBODY, "head", node_head, 0);
4898
+ rb_ary_push(members, rb_str_new2("head"));
4899
+
4893
4900
  /* Document-method: body
4894
4901
  * the expresion to evaluate if the exception type matches
4895
4902
  */
@@ -4901,12 +4908,6 @@ void define_node_subclass_methods()
4901
4908
  */
4902
4909
  rb_define_method(rb_cRESBODY, "args", node_args, 0);
4903
4910
  rb_ary_push(members, rb_str_new2("args"));
4904
-
4905
- /* Document-method: head
4906
- * the next rescue
4907
- */
4908
- rb_define_method(rb_cRESBODY, "head", node_head, 0);
4909
- rb_ary_push(members, rb_str_new2("head"));
4910
4911
  }
4911
4912
 
4912
4913
  /* Document-class: Node::RESCUE
@@ -4946,6 +4947,12 @@ void define_node_subclass_methods()
4946
4947
  rb_iv_set(rb_cRESCUE, "__type__", INT2NUM(NODE_RESCUE));
4947
4948
  rb_define_singleton_method(rb_cRESCUE, "members", node_s_members, 0);
4948
4949
 
4950
+ /* Document-method: head
4951
+ * the body of the block to evaluate
4952
+ */
4953
+ rb_define_method(rb_cRESCUE, "head", node_head, 0);
4954
+ rb_ary_push(members, rb_str_new2("head"));
4955
+
4949
4956
  /* Document-method: resq
4950
4957
  * the expression to be evaluated if an exception is raised
4951
4958
  */
@@ -4957,12 +4964,6 @@ void define_node_subclass_methods()
4957
4964
  */
4958
4965
  rb_define_method(rb_cRESCUE, "else", node_else, 0);
4959
4966
  rb_ary_push(members, rb_str_new2("else"));
4960
-
4961
- /* Document-method: head
4962
- * the body of the block to evaluate
4963
- */
4964
- rb_define_method(rb_cRESCUE, "head", node_head, 0);
4965
- rb_ary_push(members, rb_str_new2("head"));
4966
4967
  }
4967
4968
 
4968
4969
  /* Document-class: Node::RETRY
@@ -5241,10 +5242,10 @@ void define_node_subclass_methods()
5241
5242
  rb_iv_set(rb_cVALIAS, "__member__", members);
5242
5243
  rb_iv_set(rb_cVALIAS, "__type__", INT2NUM(NODE_VALIAS));
5243
5244
  rb_define_singleton_method(rb_cVALIAS, "members", node_s_members, 0);
5244
- rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
5245
- rb_ary_push(members, rb_str_new2("second"));
5246
5245
  rb_define_method(rb_cVALIAS, "first", node_1st, 0);
5247
5246
  rb_ary_push(members, rb_str_new2("first"));
5247
+ rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
5248
+ rb_ary_push(members, rb_str_new2("second"));
5248
5249
  }
5249
5250
 
5250
5251
  /* Document-class: Node::VCALL
@@ -5304,6 +5305,12 @@ void define_node_subclass_methods()
5304
5305
  rb_iv_set(rb_cWHEN, "__type__", INT2NUM(NODE_WHEN));
5305
5306
  rb_define_singleton_method(rb_cWHEN, "members", node_s_members, 0);
5306
5307
 
5308
+ /* Document-method: head
5309
+ * a value to compare against, or a condition to be tested
5310
+ */
5311
+ rb_define_method(rb_cWHEN, "head", node_head, 0);
5312
+ rb_ary_push(members, rb_str_new2("head"));
5313
+
5307
5314
  /* Document-method: body
5308
5315
  * an expression to evaluate if the condition evaluates to true
5309
5316
  */
@@ -5315,12 +5322,6 @@ void define_node_subclass_methods()
5315
5322
  */
5316
5323
  rb_define_method(rb_cWHEN, "next", node_next, 0);
5317
5324
  rb_ary_push(members, rb_str_new2("next"));
5318
-
5319
- /* Document-method: head
5320
- * a value to compare against, or a condition to be tested
5321
- */
5322
- rb_define_method(rb_cWHEN, "head", node_head, 0);
5323
- rb_ary_push(members, rb_str_new2("head"));
5324
5325
  }
5325
5326
 
5326
5327
  /* Document-class: Node::WHILE
@@ -5386,17 +5387,17 @@ void define_node_subclass_methods()
5386
5387
  rb_iv_set(rb_cYIELD, "__type__", INT2NUM(NODE_YIELD));
5387
5388
  rb_define_singleton_method(rb_cYIELD, "members", node_s_members, 0);
5388
5389
 
5389
- /* Document-method: state
5390
- * if nonzero, splats the value before yielding
5391
- */
5392
- rb_define_method(rb_cYIELD, "state", node_state, 0);
5393
- rb_ary_push(members, rb_str_new2("state"));
5394
-
5395
5390
  /* Document-method: head
5396
5391
  * the value to yield
5397
5392
  */
5398
5393
  rb_define_method(rb_cYIELD, "head", node_head, 0);
5399
5394
  rb_ary_push(members, rb_str_new2("head"));
5395
+
5396
+ /* Document-method: state
5397
+ * if nonzero, splats the value before yielding
5398
+ */
5399
+ rb_define_method(rb_cYIELD, "state", node_state, 0);
5400
+ rb_ary_push(members, rb_str_new2("state"));
5400
5401
  }
5401
5402
 
5402
5403
  /* Document-class: Node::ZARRAY