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
@@ -4,44 +4,44 @@
4
4
  Node_Type_Descrip node_type_descrips_unsorted[] = {
5
5
  { NODE_ALIAS, NEN_1ST, NEN_2ND, NEN_NONE, "ALIAS" },
6
6
  #ifdef HAVE_NODE_ALLOCA
7
- { NODE_ALLOCA, NEN_VALUE, NEN_CFNC, NEN_CNT, "ALLOCA" },
7
+ { NODE_ALLOCA, NEN_CFNC, NEN_VALUE, NEN_CNT, "ALLOCA" },
8
8
  #endif
9
- { NODE_AND, NEN_1ST, NEN_2ND, NEN_NONE, "AND" },
9
+ { NODE_AND, NEN_2ND, NEN_1ST, NEN_NONE, "AND" },
10
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_ALEN, NEN_NEXT, NEN_HEAD, "ARRAY" },
14
- { NODE_ATTRASGN, NEN_RECV, NEN_MID, 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
16
  { NODE_BACK_REF, NEN_NTH, NEN_CNT, NEN_NONE, "BACK_REF" },
17
17
  { NODE_BEGIN, NEN_BODY, NEN_NONE, NEN_NONE, "BEGIN" },
18
- { NODE_BLOCK, NEN_NEXT, NEN_HEAD, NEN_NONE, "BLOCK" },
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" },
24
- { NODE_CASE, NEN_NEXT, NEN_HEAD, NEN_BODY, "CASE" },
25
- { NODE_CDECL, NEN_VID, NEN_VALUE, NEN_NONE, "CDECL" },
26
- { NODE_CFUNC, NEN_ARGC, NEN_CFNC, NEN_NONE, "CFUNC" },
27
- { NODE_CLASS, NEN_CPATH, NEN_SUPER, NEN_BODY, "CLASS" },
28
- { NODE_COLON2, NEN_MID, NEN_HEAD, NEN_NONE, "COLON2" },
23
+ { NODE_CALL, NEN_ARGS, NEN_MID, NEN_RECV, "CALL" },
24
+ { NODE_CASE, NEN_HEAD, NEN_BODY, NEN_NEXT, "CASE" },
25
+ { NODE_CDECL, NEN_VALUE, NEN_VID, NEN_NONE, "CDECL" },
26
+ { NODE_CFUNC, NEN_CFNC, NEN_ARGC, NEN_NONE, "CFUNC" },
27
+ { NODE_CLASS, NEN_SUPER, NEN_CPATH, NEN_BODY, "CLASS" },
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
- { NODE_CREF, NEN_CLSS, NEN_NEXT, NEN_BODY, "CREF" },
31
+ { NODE_CREF, NEN_CLSS, NEN_BODY, NEN_NEXT, "CREF" },
32
32
  { NODE_CVAR, NEN_VID, NEN_NONE, NEN_NONE, "CVAR" },
33
- { NODE_CVASGN, NEN_VID, NEN_VALUE, NEN_NONE, "CVASGN" },
34
- { NODE_CVDECL, NEN_VID, NEN_VALUE, NEN_NONE, "CVDECL" },
35
- { NODE_DASGN, NEN_VID, NEN_VALUE, NEN_NONE, "DASGN" },
36
- { NODE_DASGN_CURR, NEN_VID, NEN_VALUE, NEN_NONE, "DASGN_CURR" },
33
+ { NODE_CVASGN, NEN_VALUE, NEN_VID, NEN_NONE, "CVASGN" },
34
+ { NODE_CVDECL, NEN_VALUE, NEN_VID, NEN_NONE, "CVDECL" },
35
+ { NODE_DASGN, NEN_VALUE, NEN_VID, NEN_NONE, "DASGN" },
36
+ { NODE_DASGN_CURR, NEN_VALUE, NEN_VID, NEN_NONE, "DASGN_CURR" },
37
37
  { NODE_DEFINED, NEN_HEAD, NEN_NONE, NEN_NONE, "DEFINED" },
38
38
  { NODE_DEFN, NEN_DEFN, NEN_MID, NEN_NOEX, "DEFN" },
39
39
  { NODE_DEFS, NEN_DEFN, NEN_RECV, NEN_MID, "DEFS" },
40
40
  { NODE_DMETHOD, NEN_CVAL, NEN_NONE, NEN_NONE, "DMETHOD" },
41
- { NODE_DOT2, NEN_END, NEN_BEG, NEN_STATE, "DOT2" },
42
- { NODE_DOT3, NEN_END, NEN_BEG, NEN_STATE, "DOT3" },
43
- { NODE_DREGX, NEN_LIT, NEN_CFLAG, NEN_NEXT, "DREGX" },
44
- { NODE_DREGX_ONCE, NEN_LIT, NEN_CFLAG, NEN_NEXT, "DREGX_ONCE" },
41
+ { NODE_DOT2, NEN_BEG, NEN_END, NEN_STATE, "DOT2" },
42
+ { NODE_DOT3, NEN_BEG, NEN_END, NEN_STATE, "DOT3" },
43
+ { NODE_DREGX, NEN_LIT, NEN_NEXT, NEN_CFLAG, "DREGX" },
44
+ { NODE_DREGX_ONCE, NEN_LIT, NEN_NEXT, NEN_CFLAG, "DREGX_ONCE" },
45
45
  { NODE_DSTR, NEN_LIT, NEN_NEXT, NEN_NONE, "DSTR" },
46
46
  { NODE_DSYM, NEN_LIT, NEN_NEXT, NEN_NONE, "DSYM" },
47
47
  { NODE_DVAR, NEN_VID, NEN_NONE, NEN_NONE, "DVAR" },
@@ -49,23 +49,23 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
49
49
  { NODE_ENSURE, NEN_HEAD, NEN_ENSR, NEN_NONE, "ENSURE" },
50
50
  { NODE_EVSTR, NEN_BODY, NEN_NONE, NEN_NONE, "EVSTR" },
51
51
  { NODE_FALSE, NEN_NONE, NEN_NONE, NEN_NONE, "FALSE" },
52
- { NODE_FBODY, NEN_MID, NEN_ORIG, NEN_HEAD, "FBODY" },
53
- { NODE_FCALL, NEN_MID, NEN_ARGS, NEN_NONE, "FCALL" },
54
- { NODE_FLIP2, NEN_END, NEN_BEG, NEN_CNT, "FLIP2" },
55
- { NODE_FLIP3, NEN_END, NEN_BEG, NEN_CNT, "FLIP3" },
56
- { NODE_FOR, NEN_ITER, NEN_VAR, NEN_BODY, "FOR" },
57
- { NODE_GASGN, NEN_VID, NEN_ENTRY, NEN_VALUE, "GASGN" },
52
+ { NODE_FBODY, NEN_ORIG, NEN_MID, NEN_HEAD, "FBODY" },
53
+ { NODE_FCALL, NEN_ARGS, NEN_MID, NEN_NONE, "FCALL" },
54
+ { NODE_FLIP2, NEN_CNT, NEN_BEG, NEN_END, "FLIP2" },
55
+ { NODE_FLIP3, NEN_CNT, NEN_BEG, NEN_END, "FLIP3" },
56
+ { NODE_FOR, NEN_BODY, NEN_ITER, NEN_VAR, "FOR" },
57
+ { NODE_GASGN, NEN_VALUE, NEN_VID, NEN_ENTRY, "GASGN" },
58
58
  { NODE_GVAR, NEN_VID, NEN_ENTRY, NEN_NONE, "GVAR" },
59
59
  { NODE_HASH, NEN_HEAD, NEN_NONE, NEN_NONE, "HASH" },
60
- { NODE_IASGN, NEN_VID, NEN_VALUE, NEN_NONE, "IASGN" },
60
+ { NODE_IASGN, NEN_VALUE, NEN_VID, NEN_NONE, "IASGN" },
61
61
  { NODE_IF, NEN_COND, NEN_BODY, NEN_ELSE, "IF" },
62
- { NODE_IFUNC, NEN_STATE, NEN_TVAL, NEN_CFNC, "IFUNC" },
63
- { NODE_ITER, NEN_ITER, NEN_VAR, NEN_BODY, "ITER" },
62
+ { NODE_IFUNC, NEN_CFNC, NEN_TVAL, NEN_STATE, "IFUNC" },
63
+ { NODE_ITER, NEN_BODY, NEN_ITER, NEN_VAR, "ITER" },
64
64
  { NODE_IVAR, NEN_VID, NEN_NONE, NEN_NONE, "IVAR" },
65
- { NODE_LASGN, NEN_VID, NEN_VALUE, NEN_CNT, "LASGN" },
65
+ { NODE_LASGN, NEN_VALUE, NEN_VID, NEN_CNT, "LASGN" },
66
66
  { NODE_LIT, NEN_LIT, NEN_NONE, NEN_NONE, "LIT" },
67
67
  { NODE_LVAR, NEN_VID, NEN_CNT, NEN_NONE, "LVAR" },
68
- { NODE_MASGN, NEN_ARGS, NEN_VALUE, NEN_HEAD, "MASGN" },
68
+ { NODE_MASGN, NEN_ARGS, NEN_HEAD, NEN_VALUE, "MASGN" },
69
69
  { NODE_MATCH, NEN_LIT, NEN_VALUE, NEN_NONE, "MATCH" },
70
70
  { NODE_MATCH2, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH2" },
71
71
  { NODE_MATCH3, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH3" },
@@ -78,19 +78,19 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
78
78
  { NODE_NOT, NEN_BODY, NEN_NONE, NEN_NONE, "NOT" },
79
79
  { NODE_NTH_REF, NEN_NTH, NEN_CNT, NEN_NONE, "NTH_REF" },
80
80
  { NODE_OPT_N, NEN_BODY, NEN_NONE, NEN_NONE, "OPT_N" },
81
- { NODE_OP_ASGN1, NEN_MID, NEN_RECV, NEN_ARGS, "OP_ASGN1" },
81
+ { NODE_OP_ASGN1, NEN_ARGS, NEN_MID, NEN_RECV, "OP_ASGN1" },
82
82
  { NODE_OP_ASGN2, NEN_RECV, NEN_NEXT, NEN_VALUE, "OP_ASGN2" },
83
- { NODE_OP_ASGN2_ARG, NEN_MID, NEN_VID, NEN_AID, "OP_ASGN2_ARG" },
83
+ { NODE_OP_ASGN2_ARG, NEN_VID, NEN_AID, NEN_MID, "OP_ASGN2_ARG" },
84
84
  { NODE_OP_ASGN_AND, NEN_RECV, NEN_VALUE, NEN_NONE, "OP_ASGN_AND" },
85
- { NODE_OP_ASGN_OR, NEN_RECV, NEN_AID, NEN_VALUE, "OP_ASGN_OR" },
86
- { NODE_OR, NEN_1ST, NEN_2ND, NEN_NONE, "OR" },
85
+ { NODE_OP_ASGN_OR, NEN_AID, NEN_VALUE, NEN_RECV, "OP_ASGN_OR" },
86
+ { NODE_OR, NEN_2ND, NEN_1ST, NEN_NONE, "OR" },
87
87
  { NODE_POSTEXE, NEN_NONE, NEN_NONE, NEN_NONE, "POSTEXE" },
88
88
  { NODE_REDO, NEN_NONE, NEN_NONE, NEN_NONE, "REDO" },
89
- { NODE_RESBODY, NEN_ARGS, NEN_HEAD, NEN_BODY, "RESBODY" },
90
- { NODE_RESCUE, NEN_RESQ, NEN_HEAD, NEN_ELSE, "RESCUE" },
89
+ { NODE_RESBODY, NEN_HEAD, NEN_BODY, NEN_ARGS, "RESBODY" },
90
+ { NODE_RESCUE, NEN_HEAD, NEN_RESQ, NEN_ELSE, "RESCUE" },
91
91
  { NODE_RETRY, NEN_NONE, NEN_NONE, NEN_NONE, "RETRY" },
92
92
  { NODE_RETURN, NEN_STTS, NEN_NONE, NEN_NONE, "RETURN" },
93
- { NODE_SCLASS, NEN_RECV, NEN_BODY, NEN_NONE, "SCLASS" },
93
+ { NODE_SCLASS, NEN_BODY, NEN_RECV, NEN_NONE, "SCLASS" },
94
94
  { NODE_SCOPE, NEN_TBL, NEN_RVAL, NEN_NEXT, "SCOPE" },
95
95
  { NODE_SELF, NEN_NONE, NEN_NONE, NEN_NONE, "SELF" },
96
96
  { NODE_SPLAT, NEN_HEAD, NEN_NONE, NEN_NONE, "SPLAT" },
@@ -100,13 +100,13 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
100
100
  { NODE_TO_ARY, NEN_HEAD, NEN_NONE, NEN_NONE, "TO_ARY" },
101
101
  { NODE_TRUE, NEN_NONE, NEN_NONE, NEN_NONE, "TRUE" },
102
102
  { NODE_UNDEF, NEN_BODY, NEN_NONE, NEN_NONE, "UNDEF" },
103
- { NODE_UNTIL, NEN_COND, NEN_STATE, NEN_BODY, "UNTIL" },
103
+ { NODE_UNTIL, NEN_BODY, NEN_COND, NEN_STATE, "UNTIL" },
104
104
  { NODE_VALIAS, NEN_1ST, NEN_2ND, NEN_NONE, "VALIAS" },
105
105
  { NODE_VCALL, NEN_MID, NEN_NONE, NEN_NONE, "VCALL" },
106
- { NODE_WHEN, NEN_NEXT, NEN_HEAD, NEN_BODY, "WHEN" },
107
- { NODE_WHILE, NEN_COND, NEN_STATE, NEN_BODY, "WHILE" },
106
+ { NODE_WHEN, NEN_HEAD, NEN_BODY, NEN_NEXT, "WHEN" },
107
+ { NODE_WHILE, NEN_BODY, NEN_COND, NEN_STATE, "WHILE" },
108
108
  { NODE_XSTR, NEN_LIT, NEN_NONE, NEN_NONE, "XSTR" },
109
- { NODE_YIELD, NEN_STATE, NEN_HEAD, NEN_NONE, "YIELD" },
109
+ { NODE_YIELD, NEN_HEAD, NEN_STATE, NEN_NONE, "YIELD" },
110
110
  { NODE_ZARRAY, NEN_NONE, NEN_NONE, NEN_NONE, "ZARRAY" },
111
111
  { NODE_ZSUPER, NEN_NONE, NEN_NONE, NEN_NONE, "ZSUPER" },
112
112
  { NODE_LAST, NEN_NONE, NEN_NONE, NEN_NONE, "LAST" },
@@ -2946,18 +2946,18 @@ void define_node_subclass_methods()
2946
2946
  rb_iv_set(rb_cALLOCA, "__type__", INT2NUM(NODE_ALLOCA));
2947
2947
  rb_define_singleton_method(rb_cALLOCA, "members", node_s_members, 0);
2948
2948
 
2949
- /* Document-method: value
2950
- * a pointer to the previously allocated temporary node
2951
- */
2952
- rb_define_method(rb_cALLOCA, "value", node_value, 0);
2953
- rb_ary_push(members, rb_str_new2("value"));
2954
-
2955
2949
  /* Document-method: cfnc
2956
2950
  * a pointer to the allocated memory
2957
2951
  */
2958
2952
  rb_define_method(rb_cALLOCA, "cfnc", node_cfnc, 0);
2959
2953
  rb_ary_push(members, rb_str_new2("cfnc"));
2960
2954
 
2955
+ /* Document-method: value
2956
+ * a pointer to the previously allocated temporary node
2957
+ */
2958
+ rb_define_method(rb_cALLOCA, "value", node_value, 0);
2959
+ rb_ary_push(members, rb_str_new2("value"));
2960
+
2961
2961
  /* Document-method: cnt
2962
2962
  * the number of bytes allocated
2963
2963
  */
@@ -2981,17 +2981,17 @@ void define_node_subclass_methods()
2981
2981
  rb_iv_set(rb_cAND, "__type__", INT2NUM(NODE_AND));
2982
2982
  rb_define_singleton_method(rb_cAND, "members", node_s_members, 0);
2983
2983
 
2984
- /* Document-method: first
2985
- * the expression on the left hand side
2986
- */
2987
- rb_define_method(rb_cAND, "first", node_1st, 0);
2988
- rb_ary_push(members, rb_str_new2("first"));
2989
-
2990
2984
  /* Document-method: second
2991
2985
  * the expression on the right hand side
2992
2986
  */
2993
2987
  rb_define_method(rb_cAND, "second", node_2nd, 0);
2994
2988
  rb_ary_push(members, rb_str_new2("second"));
2989
+
2990
+ /* Document-method: first
2991
+ * the expression on the left hand side
2992
+ */
2993
+ rb_define_method(rb_cAND, "first", node_1st, 0);
2994
+ rb_ary_push(members, rb_str_new2("first"));
2995
2995
  }
2996
2996
 
2997
2997
  /* Document-class: Node::ARGS
@@ -3091,17 +3091,17 @@ void define_node_subclass_methods()
3091
3091
  rb_define_method(rb_cARRAY, "alen", node_alen, 0);
3092
3092
  rb_ary_push(members, rb_str_new2("alen"));
3093
3093
 
3094
- /* Document-method: next
3095
- * the tail of the array
3096
- */
3097
- rb_define_method(rb_cARRAY, "next", node_next, 0);
3098
- rb_ary_push(members, rb_str_new2("next"));
3099
-
3100
3094
  /* Document-method: head
3101
3095
  * the first element of the array
3102
3096
  */
3103
3097
  rb_define_method(rb_cARRAY, "head", node_head, 0);
3104
3098
  rb_ary_push(members, rb_str_new2("head"));
3099
+
3100
+ /* Document-method: next
3101
+ * the tail of the array
3102
+ */
3103
+ rb_define_method(rb_cARRAY, "next", node_next, 0);
3104
+ rb_ary_push(members, rb_str_new2("next"));
3105
3105
  }
3106
3106
 
3107
3107
  /* Document-class: Node::ATTRASGN
@@ -3124,17 +3124,17 @@ void define_node_subclass_methods()
3124
3124
  rb_define_method(rb_cATTRASGN, "recv", node_recv, 0);
3125
3125
  rb_ary_push(members, rb_str_new2("recv"));
3126
3126
 
3127
- /* Document-method: mid
3128
- * the id of the attribute, with a trailing '=' sign
3129
- */
3130
- rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
3131
- rb_ary_push(members, rb_str_new2("mid"));
3132
-
3133
3127
  /* Document-method: args
3134
3128
  * the arguments to the method
3135
3129
  */
3136
3130
  rb_define_method(rb_cATTRASGN, "args", node_args, 0);
3137
3131
  rb_ary_push(members, rb_str_new2("args"));
3132
+
3133
+ /* Document-method: mid
3134
+ * the id of the attribute, with a trailing '=' sign
3135
+ */
3136
+ rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
3137
+ rb_ary_push(members, rb_str_new2("mid"));
3138
3138
  }
3139
3139
 
3140
3140
  /* Document-class: Node::ATTRSET
@@ -3222,17 +3222,17 @@ void define_node_subclass_methods()
3222
3222
  rb_iv_set(rb_cBLOCK, "__type__", INT2NUM(NODE_BLOCK));
3223
3223
  rb_define_singleton_method(rb_cBLOCK, "members", node_s_members, 0);
3224
3224
 
3225
- /* Document-method: next
3226
- * the second expression in the block of code
3227
- */
3228
- rb_define_method(rb_cBLOCK, "next", node_next, 0);
3229
- rb_ary_push(members, rb_str_new2("next"));
3230
-
3231
3225
  /* Document-method: head
3232
3226
  * the first expression in the block of code
3233
3227
  */
3234
3228
  rb_define_method(rb_cBLOCK, "head", node_head, 0);
3235
3229
  rb_ary_push(members, rb_str_new2("head"));
3230
+
3231
+ /* Document-method: next
3232
+ * the second expression in the block of code
3233
+ */
3234
+ rb_define_method(rb_cBLOCK, "next", node_next, 0);
3235
+ rb_ary_push(members, rb_str_new2("next"));
3236
3236
  }
3237
3237
 
3238
3238
  /* Document-class: Node::BLOCK_ARG
@@ -3273,17 +3273,17 @@ void define_node_subclass_methods()
3273
3273
  rb_iv_set(rb_cBLOCK_PASS, "__type__", INT2NUM(NODE_BLOCK_PASS));
3274
3274
  rb_define_singleton_method(rb_cBLOCK_PASS, "members", node_s_members, 0);
3275
3275
 
3276
- /* Document-method: iter
3277
- * an expression which calls a method
3278
- */
3279
- rb_define_method(rb_cBLOCK_PASS, "iter", node_iter, 0);
3280
- rb_ary_push(members, rb_str_new2("iter"));
3281
-
3282
3276
  /* Document-method: body
3283
3277
  * the object to pass as a block
3284
3278
  */
3285
3279
  rb_define_method(rb_cBLOCK_PASS, "body", node_body, 0);
3286
3280
  rb_ary_push(members, rb_str_new2("body"));
3281
+
3282
+ /* Document-method: iter
3283
+ * an expression which calls a method
3284
+ */
3285
+ rb_define_method(rb_cBLOCK_PASS, "iter", node_iter, 0);
3286
+ rb_ary_push(members, rb_str_new2("iter"));
3287
3287
  }
3288
3288
 
3289
3289
  /* Document-class: Node::BMETHOD
@@ -3340,6 +3340,12 @@ void define_node_subclass_methods()
3340
3340
  rb_iv_set(rb_cCALL, "__type__", INT2NUM(NODE_CALL));
3341
3341
  rb_define_singleton_method(rb_cCALL, "members", node_s_members, 0);
3342
3342
 
3343
+ /* Document-method: args
3344
+ * the arguments to the method
3345
+ */
3346
+ rb_define_method(rb_cCALL, "args", node_args, 0);
3347
+ rb_ary_push(members, rb_str_new2("args"));
3348
+
3343
3349
  /* Document-method: mid
3344
3350
  * the method id
3345
3351
  */
@@ -3351,12 +3357,6 @@ void define_node_subclass_methods()
3351
3357
  */
3352
3358
  rb_define_method(rb_cCALL, "recv", node_recv, 0);
3353
3359
  rb_ary_push(members, rb_str_new2("recv"));
3354
-
3355
- /* Document-method: args
3356
- * the arguments to the method
3357
- */
3358
- rb_define_method(rb_cCALL, "args", node_args, 0);
3359
- rb_ary_push(members, rb_str_new2("args"));
3360
3360
  }
3361
3361
 
3362
3362
  /* Document-class: Node::CASE
@@ -3373,8 +3373,6 @@ void define_node_subclass_methods()
3373
3373
  rb_iv_set(rb_cCASE, "__member__", members);
3374
3374
  rb_iv_set(rb_cCASE, "__type__", INT2NUM(NODE_CASE));
3375
3375
  rb_define_singleton_method(rb_cCASE, "members", node_s_members, 0);
3376
- rb_define_method(rb_cCASE, "next", node_next, 0);
3377
- rb_ary_push(members, rb_str_new2("next"));
3378
3376
 
3379
3377
  /* Document-method: head
3380
3378
  * the value to select on
@@ -3388,6 +3386,8 @@ void define_node_subclass_methods()
3388
3386
  */
3389
3387
  rb_define_method(rb_cCASE, "body", node_body, 0);
3390
3388
  rb_ary_push(members, rb_str_new2("body"));
3389
+ rb_define_method(rb_cCASE, "next", node_next, 0);
3390
+ rb_ary_push(members, rb_str_new2("next"));
3391
3391
  }
3392
3392
 
3393
3393
  /* Document-class: Node::CDECL
@@ -3402,17 +3402,17 @@ void define_node_subclass_methods()
3402
3402
  rb_iv_set(rb_cCDECL, "__type__", INT2NUM(NODE_CDECL));
3403
3403
  rb_define_singleton_method(rb_cCDECL, "members", node_s_members, 0);
3404
3404
 
3405
- /* Document-method: vid
3406
- * the name of the constant to be assigned, all uppercase
3407
- */
3408
- rb_define_method(rb_cCDECL, "vid", node_vid, 0);
3409
- rb_ary_push(members, rb_str_new2("vid"));
3410
-
3411
3405
  /* Document-method: value
3412
3406
  * the value to be assigned to the constant
3413
3407
  */
3414
3408
  rb_define_method(rb_cCDECL, "value", node_value, 0);
3415
3409
  rb_ary_push(members, rb_str_new2("value"));
3410
+
3411
+ /* Document-method: vid
3412
+ * the name of the constant to be assigned, all uppercase
3413
+ */
3414
+ rb_define_method(rb_cCDECL, "vid", node_vid, 0);
3415
+ rb_ary_push(members, rb_str_new2("vid"));
3416
3416
  }
3417
3417
 
3418
3418
  /* Document-class: Node::CFUNC
@@ -3425,10 +3425,10 @@ void define_node_subclass_methods()
3425
3425
  rb_iv_set(rb_cCFUNC, "__member__", members);
3426
3426
  rb_iv_set(rb_cCFUNC, "__type__", INT2NUM(NODE_CFUNC));
3427
3427
  rb_define_singleton_method(rb_cCFUNC, "members", node_s_members, 0);
3428
- rb_define_method(rb_cCFUNC, "argc", node_argc, 0);
3429
- rb_ary_push(members, rb_str_new2("argc"));
3430
3428
  rb_define_method(rb_cCFUNC, "cfnc", node_cfnc, 0);
3431
3429
  rb_ary_push(members, rb_str_new2("cfnc"));
3430
+ rb_define_method(rb_cCFUNC, "argc", node_argc, 0);
3431
+ rb_ary_push(members, rb_str_new2("argc"));
3432
3432
  }
3433
3433
 
3434
3434
  /* Document-class: Node::CLASS
@@ -3455,12 +3455,6 @@ void define_node_subclass_methods()
3455
3455
  rb_iv_set(rb_cCLASS, "__type__", INT2NUM(NODE_CLASS));
3456
3456
  rb_define_singleton_method(rb_cCLASS, "members", node_s_members, 0);
3457
3457
 
3458
- /* Document-method: cpath
3459
- * the name of the class to define
3460
- */
3461
- rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
3462
- rb_ary_push(members, rb_str_new2("cpath"));
3463
-
3464
3458
  /* Document-method: super
3465
3459
  * an expression returning the base class, or false if there is no
3466
3460
  * base class specified
@@ -3468,6 +3462,12 @@ void define_node_subclass_methods()
3468
3462
  rb_define_method(rb_cCLASS, "super", node_super, 0);
3469
3463
  rb_ary_push(members, rb_str_new2("super"));
3470
3464
 
3465
+ /* Document-method: cpath
3466
+ * the name of the class to define
3467
+ */
3468
+ rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
3469
+ rb_ary_push(members, rb_str_new2("cpath"));
3470
+
3471
3471
  /* Document-method: body
3472
3472
  * the body of the class definition
3473
3473
  */
@@ -3491,17 +3491,17 @@ void define_node_subclass_methods()
3491
3491
  rb_iv_set(rb_cCOLON2, "__type__", INT2NUM(NODE_COLON2));
3492
3492
  rb_define_singleton_method(rb_cCOLON2, "members", node_s_members, 0);
3493
3493
 
3494
- /* Document-method: mid
3495
- * the name of the method or constant to call/look up
3496
- */
3497
- rb_define_method(rb_cCOLON2, "mid", node_mid, 0);
3498
- rb_ary_push(members, rb_str_new2("mid"));
3499
-
3500
3494
  /* Document-method: head
3501
3495
  * an expression specifying the class in which to do the lookup
3502
3496
  */
3503
3497
  rb_define_method(rb_cCOLON2, "head", node_head, 0);
3504
3498
  rb_ary_push(members, rb_str_new2("head"));
3499
+
3500
+ /* Document-method: mid
3501
+ * the name of the method or constant to call/look up
3502
+ */
3503
+ rb_define_method(rb_cCOLON2, "mid", node_mid, 0);
3504
+ rb_ary_push(members, rb_str_new2("mid"));
3505
3505
  }
3506
3506
 
3507
3507
  /* Document-class: Node::COLON3
@@ -3566,17 +3566,17 @@ void define_node_subclass_methods()
3566
3566
  rb_define_method(rb_cCREF, "clss", node_clss, 0);
3567
3567
  rb_ary_push(members, rb_str_new2("clss"));
3568
3568
 
3569
- /* Document-method: next
3570
- * the previous value of ruby_cref or ruby_top_cref
3571
- */
3572
- rb_define_method(rb_cCREF, "next", node_next, 0);
3573
- rb_ary_push(members, rb_str_new2("next"));
3574
-
3575
3569
  /* Document-method: body
3576
3570
  * always 0 (false)
3577
3571
  */
3578
3572
  rb_define_method(rb_cCREF, "body", node_body, 0);
3579
3573
  rb_ary_push(members, rb_str_new2("body"));
3574
+
3575
+ /* Document-method: next
3576
+ * the previous value of ruby_cref or ruby_top_cref
3577
+ */
3578
+ rb_define_method(rb_cCREF, "next", node_next, 0);
3579
+ rb_ary_push(members, rb_str_new2("next"));
3580
3580
  }
3581
3581
 
3582
3582
  /* Document-class: Node::CVAR
@@ -3609,18 +3609,18 @@ void define_node_subclass_methods()
3609
3609
  rb_iv_set(rb_cCVASGN, "__type__", INT2NUM(NODE_CVASGN));
3610
3610
  rb_define_singleton_method(rb_cCVASGN, "members", node_s_members, 0);
3611
3611
 
3612
- /* Document-method: vid
3613
- * the name of the class variable to assign
3614
- */
3615
- rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
3616
- rb_ary_push(members, rb_str_new2("vid"));
3617
-
3618
3612
  /* Document-method: value
3619
3613
  * an expression whose result is the new value of the class
3620
3614
  * variable
3621
3615
  */
3622
3616
  rb_define_method(rb_cCVASGN, "value", node_value, 0);
3623
3617
  rb_ary_push(members, rb_str_new2("value"));
3618
+
3619
+ /* Document-method: vid
3620
+ * the name of the class variable to assign
3621
+ */
3622
+ rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
3623
+ rb_ary_push(members, rb_str_new2("vid"));
3624
3624
  }
3625
3625
 
3626
3626
  /* Document-class: Node::CVDECL
@@ -3636,18 +3636,18 @@ void define_node_subclass_methods()
3636
3636
  rb_iv_set(rb_cCVDECL, "__type__", INT2NUM(NODE_CVDECL));
3637
3637
  rb_define_singleton_method(rb_cCVDECL, "members", node_s_members, 0);
3638
3638
 
3639
- /* Document-method: vid
3640
- * the name of the class variable to assign
3641
- */
3642
- rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
3643
- rb_ary_push(members, rb_str_new2("vid"));
3644
-
3645
3639
  /* Document-method: value
3646
3640
  * an expression whose result is the new value of the class
3647
3641
  * variable
3648
3642
  */
3649
3643
  rb_define_method(rb_cCVDECL, "value", node_value, 0);
3650
3644
  rb_ary_push(members, rb_str_new2("value"));
3645
+
3646
+ /* Document-method: vid
3647
+ * the name of the class variable to assign
3648
+ */
3649
+ rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
3650
+ rb_ary_push(members, rb_str_new2("vid"));
3651
3651
  }
3652
3652
 
3653
3653
  /* Document-class: Node::DASGN
@@ -3670,17 +3670,17 @@ void define_node_subclass_methods()
3670
3670
  rb_iv_set(rb_cDASGN, "__type__", INT2NUM(NODE_DASGN));
3671
3671
  rb_define_singleton_method(rb_cDASGN, "members", node_s_members, 0);
3672
3672
 
3673
- /* Document-method: vid
3674
- * the name of the local variable
3675
- */
3676
- rb_define_method(rb_cDASGN, "vid", node_vid, 0);
3677
- rb_ary_push(members, rb_str_new2("vid"));
3678
-
3679
3673
  /* Document-method: value
3680
3674
  * the value to assign to the local variable
3681
3675
  */
3682
3676
  rb_define_method(rb_cDASGN, "value", node_value, 0);
3683
3677
  rb_ary_push(members, rb_str_new2("value"));
3678
+
3679
+ /* Document-method: vid
3680
+ * the name of the local variable
3681
+ */
3682
+ rb_define_method(rb_cDASGN, "vid", node_vid, 0);
3683
+ rb_ary_push(members, rb_str_new2("vid"));
3684
3684
  }
3685
3685
 
3686
3686
  /* Document-class: Node::DASGN_CURR
@@ -3695,17 +3695,17 @@ void define_node_subclass_methods()
3695
3695
  rb_iv_set(rb_cDASGN_CURR, "__type__", INT2NUM(NODE_DASGN_CURR));
3696
3696
  rb_define_singleton_method(rb_cDASGN_CURR, "members", node_s_members, 0);
3697
3697
 
3698
- /* Document-method: vid
3699
- * the name of the local variable
3700
- */
3701
- rb_define_method(rb_cDASGN_CURR, "vid", node_vid, 0);
3702
- rb_ary_push(members, rb_str_new2("vid"));
3703
-
3704
3698
  /* Document-method: value
3705
3699
  * the value to assign to the local variable
3706
3700
  */
3707
3701
  rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
3708
3702
  rb_ary_push(members, rb_str_new2("value"));
3703
+
3704
+ /* Document-method: vid
3705
+ * the name of the local variable
3706
+ */
3707
+ rb_define_method(rb_cDASGN_CURR, "vid", node_vid, 0);
3708
+ rb_ary_push(members, rb_str_new2("vid"));
3709
3709
  }
3710
3710
 
3711
3711
  /* Document-class: Node::DEFINED
@@ -3825,17 +3825,17 @@ void define_node_subclass_methods()
3825
3825
  rb_iv_set(rb_cDOT2, "__type__", INT2NUM(NODE_DOT2));
3826
3826
  rb_define_singleton_method(rb_cDOT2, "members", node_s_members, 0);
3827
3827
 
3828
- /* Document-method: end
3829
- * the end of the range
3830
- */
3831
- rb_define_method(rb_cDOT2, "end", node_end, 0);
3832
- rb_ary_push(members, rb_str_new2("end"));
3833
-
3834
3828
  /* Document-method: beg
3835
3829
  * the beginning of the range
3836
3830
  */
3837
3831
  rb_define_method(rb_cDOT2, "beg", node_beg, 0);
3838
3832
  rb_ary_push(members, rb_str_new2("beg"));
3833
+
3834
+ /* Document-method: end
3835
+ * the end of the range
3836
+ */
3837
+ rb_define_method(rb_cDOT2, "end", node_end, 0);
3838
+ rb_ary_push(members, rb_str_new2("end"));
3839
3839
  rb_define_method(rb_cDOT2, "state", node_state, 0);
3840
3840
  rb_ary_push(members, rb_str_new2("state"));
3841
3841
  }
@@ -3853,17 +3853,17 @@ void define_node_subclass_methods()
3853
3853
  rb_iv_set(rb_cDOT3, "__type__", INT2NUM(NODE_DOT3));
3854
3854
  rb_define_singleton_method(rb_cDOT3, "members", node_s_members, 0);
3855
3855
 
3856
- /* Document-method: end
3857
- * the end of the range
3858
- */
3859
- rb_define_method(rb_cDOT3, "end", node_end, 0);
3860
- rb_ary_push(members, rb_str_new2("end"));
3861
-
3862
3856
  /* Document-method: beg
3863
3857
  * the beginning of the range
3864
3858
  */
3865
3859
  rb_define_method(rb_cDOT3, "beg", node_beg, 0);
3866
3860
  rb_ary_push(members, rb_str_new2("beg"));
3861
+
3862
+ /* Document-method: end
3863
+ * the end of the range
3864
+ */
3865
+ rb_define_method(rb_cDOT3, "end", node_end, 0);
3866
+ rb_ary_push(members, rb_str_new2("end"));
3867
3867
  rb_define_method(rb_cDOT3, "state", node_state, 0);
3868
3868
  rb_ary_push(members, rb_str_new2("state"));
3869
3869
  }
@@ -3890,6 +3890,12 @@ void define_node_subclass_methods()
3890
3890
  rb_define_method(rb_cDREGX, "lit", node_lit, 0);
3891
3891
  rb_ary_push(members, rb_str_new2("lit"));
3892
3892
 
3893
+ /* Document-method: next
3894
+ * a list of expressions to be appended onto the string
3895
+ */
3896
+ rb_define_method(rb_cDREGX, "next", node_next, 0);
3897
+ rb_ary_push(members, rb_str_new2("next"));
3898
+
3893
3899
  /* Document-method: cflag
3894
3900
  * a bitfield containing the options used in the regular
3895
3901
  * expression. Valid values include:
@@ -3906,12 +3912,6 @@ void define_node_subclass_methods()
3906
3912
  */
3907
3913
  rb_define_method(rb_cDREGX, "cflag", node_cflag, 0);
3908
3914
  rb_ary_push(members, rb_str_new2("cflag"));
3909
-
3910
- /* Document-method: next
3911
- * a list of expressions to be appended onto the string
3912
- */
3913
- rb_define_method(rb_cDREGX, "next", node_next, 0);
3914
- rb_ary_push(members, rb_str_new2("next"));
3915
3915
  }
3916
3916
 
3917
3917
  /* Document-class: Node::DREGX_ONCE
@@ -3933,18 +3933,18 @@ void define_node_subclass_methods()
3933
3933
  rb_define_method(rb_cDREGX_ONCE, "lit", node_lit, 0);
3934
3934
  rb_ary_push(members, rb_str_new2("lit"));
3935
3935
 
3936
+ /* Document-method: next
3937
+ * a list of expressions to be appended onto the string
3938
+ */
3939
+ rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
3940
+ rb_ary_push(members, rb_str_new2("next"));
3941
+
3936
3942
  /* Document-method: cflag
3937
3943
  * a bitfield containing the options used in the regular
3938
3944
  * expression. See DREGX for a list of valid values.
3939
3945
  */
3940
3946
  rb_define_method(rb_cDREGX_ONCE, "cflag", node_cflag, 0);
3941
3947
  rb_ary_push(members, rb_str_new2("cflag"));
3942
-
3943
- /* Document-method: next
3944
- * a list of expressions to be appended onto the string
3945
- */
3946
- rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
3947
- rb_ary_push(members, rb_str_new2("next"));
3948
3948
  }
3949
3949
 
3950
3950
  /* Document-class: Node::DSTR
@@ -4134,18 +4134,18 @@ void define_node_subclass_methods()
4134
4134
  rb_iv_set(rb_cFBODY, "__type__", INT2NUM(NODE_FBODY));
4135
4135
  rb_define_singleton_method(rb_cFBODY, "members", node_s_members, 0);
4136
4136
 
4137
- /* Document-method: mid
4138
- * the name of the method
4139
- */
4140
- rb_define_method(rb_cFBODY, "mid", node_mid, 0);
4141
- rb_ary_push(members, rb_str_new2("mid"));
4142
-
4143
4137
  /* Document-method: orig
4144
4138
  * the origin class
4145
4139
  */
4146
4140
  rb_define_method(rb_cFBODY, "orig", node_orig, 0);
4147
4141
  rb_ary_push(members, rb_str_new2("orig"));
4148
4142
 
4143
+ /* Document-method: mid
4144
+ * the name of the method
4145
+ */
4146
+ rb_define_method(rb_cFBODY, "mid", node_mid, 0);
4147
+ rb_ary_push(members, rb_str_new2("mid"));
4148
+
4149
4149
  /* Document-method: head
4150
4150
  * the method body
4151
4151
  */
@@ -4168,17 +4168,17 @@ void define_node_subclass_methods()
4168
4168
  rb_iv_set(rb_cFCALL, "__type__", INT2NUM(NODE_FCALL));
4169
4169
  rb_define_singleton_method(rb_cFCALL, "members", node_s_members, 0);
4170
4170
 
4171
- /* Document-method: mid
4172
- * the method id
4173
- */
4174
- rb_define_method(rb_cFCALL, "mid", node_mid, 0);
4175
- rb_ary_push(members, rb_str_new2("mid"));
4176
-
4177
4171
  /* Document-method: args
4178
4172
  * the arguments to the method
4179
4173
  */
4180
4174
  rb_define_method(rb_cFCALL, "args", node_args, 0);
4181
4175
  rb_ary_push(members, rb_str_new2("args"));
4176
+
4177
+ /* Document-method: mid
4178
+ * the method id
4179
+ */
4180
+ rb_define_method(rb_cFCALL, "mid", node_mid, 0);
4181
+ rb_ary_push(members, rb_str_new2("mid"));
4182
4182
  }
4183
4183
 
4184
4184
  /* Document-class: Node::FLIP2
@@ -4195,11 +4195,12 @@ void define_node_subclass_methods()
4195
4195
  rb_iv_set(rb_cFLIP2, "__type__", INT2NUM(NODE_FLIP2));
4196
4196
  rb_define_singleton_method(rb_cFLIP2, "members", node_s_members, 0);
4197
4197
 
4198
- /* Document-method: end
4199
- * the end of the range
4198
+ /* Document-method: cnt
4199
+ * the index into the local variable table of the special variable
4200
+ * to use in the flip-flop expression (usually 2 for $_)
4200
4201
  */
4201
- rb_define_method(rb_cFLIP2, "end", node_end, 0);
4202
- rb_ary_push(members, rb_str_new2("end"));
4202
+ rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
4203
+ rb_ary_push(members, rb_str_new2("cnt"));
4203
4204
 
4204
4205
  /* Document-method: beg
4205
4206
  * the beginning of the range
@@ -4207,12 +4208,11 @@ void define_node_subclass_methods()
4207
4208
  rb_define_method(rb_cFLIP2, "beg", node_beg, 0);
4208
4209
  rb_ary_push(members, rb_str_new2("beg"));
4209
4210
 
4210
- /* Document-method: cnt
4211
- * the index into the local variable table of the special variable
4212
- * to use in the flip-flop expression (usually 2 for $_)
4211
+ /* Document-method: end
4212
+ * the end of the range
4213
4213
  */
4214
- rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
4215
- rb_ary_push(members, rb_str_new2("cnt"));
4214
+ rb_define_method(rb_cFLIP2, "end", node_end, 0);
4215
+ rb_ary_push(members, rb_str_new2("end"));
4216
4216
  }
4217
4217
 
4218
4218
  /* Document-class: Node::FLIP3
@@ -4229,11 +4229,12 @@ void define_node_subclass_methods()
4229
4229
  rb_iv_set(rb_cFLIP3, "__type__", INT2NUM(NODE_FLIP3));
4230
4230
  rb_define_singleton_method(rb_cFLIP3, "members", node_s_members, 0);
4231
4231
 
4232
- /* Document-method: end
4233
- * the end of the range
4232
+ /* Document-method: cnt
4233
+ * the index into the local variable table of the special variable
4234
+ * to use in the flip-flop expression (usually 2 for $_)
4234
4235
  */
4235
- rb_define_method(rb_cFLIP3, "end", node_end, 0);
4236
- rb_ary_push(members, rb_str_new2("end"));
4236
+ rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
4237
+ rb_ary_push(members, rb_str_new2("cnt"));
4237
4238
 
4238
4239
  /* Document-method: beg
4239
4240
  * the beginning of the range
@@ -4241,12 +4242,11 @@ void define_node_subclass_methods()
4241
4242
  rb_define_method(rb_cFLIP3, "beg", node_beg, 0);
4242
4243
  rb_ary_push(members, rb_str_new2("beg"));
4243
4244
 
4244
- /* Document-method: cnt
4245
- * the index into the local variable table of the special variable
4246
- * to use in the flip-flop expression (usually 2 for $_)
4245
+ /* Document-method: end
4246
+ * the end of the range
4247
4247
  */
4248
- rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
4249
- rb_ary_push(members, rb_str_new2("cnt"));
4248
+ rb_define_method(rb_cFLIP3, "end", node_end, 0);
4249
+ rb_ary_push(members, rb_str_new2("end"));
4250
4250
  }
4251
4251
 
4252
4252
  /* Document-class: Node::FOR
@@ -4271,6 +4271,12 @@ void define_node_subclass_methods()
4271
4271
  rb_iv_set(rb_cFOR, "__type__", INT2NUM(NODE_FOR));
4272
4272
  rb_define_singleton_method(rb_cFOR, "members", node_s_members, 0);
4273
4273
 
4274
+ /* Document-method: body
4275
+ * the body of the loop
4276
+ */
4277
+ rb_define_method(rb_cFOR, "body", node_body, 0);
4278
+ rb_ary_push(members, rb_str_new2("body"));
4279
+
4274
4280
  /* Document-method: iter
4275
4281
  * the sequence over which to iterate
4276
4282
  */
@@ -4284,12 +4290,6 @@ void define_node_subclass_methods()
4284
4290
  */
4285
4291
  rb_define_method(rb_cFOR, "var", node_var, 0);
4286
4292
  rb_ary_push(members, rb_str_new2("var"));
4287
-
4288
- /* Document-method: body
4289
- * the body of the loop
4290
- */
4291
- rb_define_method(rb_cFOR, "body", node_body, 0);
4292
- rb_ary_push(members, rb_str_new2("body"));
4293
4293
  }
4294
4294
 
4295
4295
  /* Document-class: Node::GASGN
@@ -4303,6 +4303,12 @@ void define_node_subclass_methods()
4303
4303
  rb_iv_set(rb_cGASGN, "__type__", INT2NUM(NODE_GASGN));
4304
4304
  rb_define_singleton_method(rb_cGASGN, "members", node_s_members, 0);
4305
4305
 
4306
+ /* Document-method: value
4307
+ * an expression whose result is the new value of the global variable
4308
+ */
4309
+ rb_define_method(rb_cGASGN, "value", node_value, 0);
4310
+ rb_ary_push(members, rb_str_new2("value"));
4311
+
4306
4312
  /* Document-method: vid
4307
4313
  * the name of the global variable, with a leading '$' character.
4308
4314
  */
@@ -4310,12 +4316,6 @@ void define_node_subclass_methods()
4310
4316
  rb_ary_push(members, rb_str_new2("vid"));
4311
4317
  rb_define_method(rb_cGASGN, "entry", node_entry, 0);
4312
4318
  rb_ary_push(members, rb_str_new2("entry"));
4313
-
4314
- /* Document-method: value
4315
- * an expression whose result is the new value of the global variable
4316
- */
4317
- rb_define_method(rb_cGASGN, "value", node_value, 0);
4318
- rb_ary_push(members, rb_str_new2("value"));
4319
4319
  }
4320
4320
 
4321
4321
  /* Document-class: Node::GVAR
@@ -4368,17 +4368,17 @@ void define_node_subclass_methods()
4368
4368
  rb_iv_set(rb_cIASGN, "__type__", INT2NUM(NODE_IASGN));
4369
4369
  rb_define_singleton_method(rb_cIASGN, "members", node_s_members, 0);
4370
4370
 
4371
- /* Document-method: vid
4372
- * the name of the instance variable, with a leading '@' sign
4373
- */
4374
- rb_define_method(rb_cIASGN, "vid", node_vid, 0);
4375
- rb_ary_push(members, rb_str_new2("vid"));
4376
-
4377
4371
  /* Document-method: value
4378
4372
  * the value to assign to the instance variable
4379
4373
  */
4380
4374
  rb_define_method(rb_cIASGN, "value", node_value, 0);
4381
4375
  rb_ary_push(members, rb_str_new2("value"));
4376
+
4377
+ /* Document-method: vid
4378
+ * the name of the instance variable, with a leading '@' sign
4379
+ */
4380
+ rb_define_method(rb_cIASGN, "vid", node_vid, 0);
4381
+ rb_ary_push(members, rb_str_new2("vid"));
4382
4382
  }
4383
4383
 
4384
4384
  /* Document-class: Node::IF
@@ -4401,6 +4401,7 @@ void define_node_subclass_methods()
4401
4401
  *
4402
4402
  * A conditional block using elsif has another IF node as the else
4403
4403
  * expression.
4404
+ *
4404
4405
  */
4405
4406
  {
4406
4407
  VALUE rb_cIF = rb_define_class_under(rb_cNode, "IF", rb_cNode);
@@ -4442,11 +4443,11 @@ void define_node_subclass_methods()
4442
4443
  rb_iv_set(rb_cIFUNC, "__type__", INT2NUM(NODE_IFUNC));
4443
4444
  rb_define_singleton_method(rb_cIFUNC, "members", node_s_members, 0);
4444
4445
 
4445
- /* Document-method: state
4446
- * always 0
4446
+ /* Document-method: cfnc
4447
+ * a pointer to the C function to which to yield
4447
4448
  */
4448
- rb_define_method(rb_cIFUNC, "state", node_state, 0);
4449
- rb_ary_push(members, rb_str_new2("state"));
4449
+ rb_define_method(rb_cIFUNC, "cfnc", node_cfnc, 0);
4450
+ rb_ary_push(members, rb_str_new2("cfnc"));
4450
4451
 
4451
4452
  /* Document-method: tval
4452
4453
  * the user-specified data to be passed as the second argument to
@@ -4455,11 +4456,11 @@ void define_node_subclass_methods()
4455
4456
  rb_define_method(rb_cIFUNC, "tval", node_tval, 0);
4456
4457
  rb_ary_push(members, rb_str_new2("tval"));
4457
4458
 
4458
- /* Document-method: cfnc
4459
- * a pointer to the C function to which to yield
4459
+ /* Document-method: state
4460
+ * always 0
4460
4461
  */
4461
- rb_define_method(rb_cIFUNC, "cfnc", node_cfnc, 0);
4462
- rb_ary_push(members, rb_str_new2("cfnc"));
4462
+ rb_define_method(rb_cIFUNC, "state", node_state, 0);
4463
+ rb_ary_push(members, rb_str_new2("state"));
4463
4464
  }
4464
4465
 
4465
4466
  /* Document-class: Node::ITER
@@ -4483,6 +4484,12 @@ void define_node_subclass_methods()
4483
4484
  rb_iv_set(rb_cITER, "__type__", INT2NUM(NODE_ITER));
4484
4485
  rb_define_singleton_method(rb_cITER, "members", node_s_members, 0);
4485
4486
 
4487
+ /* Document-method: body
4488
+ * the body of the loop
4489
+ */
4490
+ rb_define_method(rb_cITER, "body", node_body, 0);
4491
+ rb_ary_push(members, rb_str_new2("body"));
4492
+
4486
4493
  /* Document-method: iter
4487
4494
  * an expression which calls the desired iteration method, usually
4488
4495
  * recv.each
@@ -4497,12 +4504,6 @@ void define_node_subclass_methods()
4497
4504
  */
4498
4505
  rb_define_method(rb_cITER, "var", node_var, 0);
4499
4506
  rb_ary_push(members, rb_str_new2("var"));
4500
-
4501
- /* Document-method: body
4502
- * the body of the loop
4503
- */
4504
- rb_define_method(rb_cITER, "body", node_body, 0);
4505
- rb_ary_push(members, rb_str_new2("body"));
4506
4507
  }
4507
4508
 
4508
4509
  /* Document-class: Node::IVAR
@@ -4537,17 +4538,17 @@ void define_node_subclass_methods()
4537
4538
  rb_iv_set(rb_cLASGN, "__type__", INT2NUM(NODE_LASGN));
4538
4539
  rb_define_singleton_method(rb_cLASGN, "members", node_s_members, 0);
4539
4540
 
4540
- /* Document-method: vid
4541
- * the name of the local variable
4542
- */
4543
- rb_define_method(rb_cLASGN, "vid", node_vid, 0);
4544
- rb_ary_push(members, rb_str_new2("vid"));
4545
-
4546
4541
  /* Document-method: value
4547
4542
  * the value to assign to the local variable
4548
4543
  */
4549
4544
  rb_define_method(rb_cLASGN, "value", node_value, 0);
4550
4545
  rb_ary_push(members, rb_str_new2("value"));
4546
+
4547
+ /* Document-method: vid
4548
+ * the name of the local variable
4549
+ */
4550
+ rb_define_method(rb_cLASGN, "vid", node_vid, 0);
4551
+ rb_ary_push(members, rb_str_new2("vid"));
4551
4552
  rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
4552
4553
  rb_ary_push(members, rb_str_new2("cnt"));
4553
4554
  }
@@ -4608,17 +4609,17 @@ void define_node_subclass_methods()
4608
4609
  rb_define_method(rb_cMASGN, "args", node_args, 0);
4609
4610
  rb_ary_push(members, rb_str_new2("args"));
4610
4611
 
4611
- /* Document-method: value
4612
- * TODO
4613
- */
4614
- rb_define_method(rb_cMASGN, "value", node_value, 0);
4615
- rb_ary_push(members, rb_str_new2("value"));
4616
-
4617
4612
  /* Document-method: head
4618
4613
  * TODO
4619
4614
  */
4620
4615
  rb_define_method(rb_cMASGN, "head", node_head, 0);
4621
4616
  rb_ary_push(members, rb_str_new2("head"));
4617
+
4618
+ /* Document-method: value
4619
+ * TODO
4620
+ */
4621
+ rb_define_method(rb_cMASGN, "value", node_value, 0);
4622
+ rb_ary_push(members, rb_str_new2("value"));
4622
4623
  }
4623
4624
 
4624
4625
  /* Document-class: Node::MATCH
@@ -4943,6 +4944,12 @@ void define_node_subclass_methods()
4943
4944
  rb_iv_set(rb_cOP_ASGN1, "__type__", INT2NUM(NODE_OP_ASGN1));
4944
4945
  rb_define_singleton_method(rb_cOP_ASGN1, "members", node_s_members, 0);
4945
4946
 
4947
+ /* Document-method: args
4948
+ * the arguments to the assigment
4949
+ */
4950
+ rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
4951
+ rb_ary_push(members, rb_str_new2("args"));
4952
+
4946
4953
  /* Document-method: mid
4947
4954
  * 0, 1, or the name a method to call to calculate the value of the
4948
4955
  * rhs
@@ -4955,12 +4962,6 @@ void define_node_subclass_methods()
4955
4962
  */
4956
4963
  rb_define_method(rb_cOP_ASGN1, "recv", node_recv, 0);
4957
4964
  rb_ary_push(members, rb_str_new2("recv"));
4958
-
4959
- /* Document-method: args
4960
- * the arguments to the assigment
4961
- */
4962
- rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
4963
- rb_ary_push(members, rb_str_new2("args"));
4964
4965
  }
4965
4966
 
4966
4967
  /* Document-class: Node::OP_ASGN2
@@ -5016,14 +5017,6 @@ void define_node_subclass_methods()
5016
5017
  rb_iv_set(rb_cOP_ASGN2_ARG, "__type__", INT2NUM(NODE_OP_ASGN2_ARG));
5017
5018
  rb_define_singleton_method(rb_cOP_ASGN2_ARG, "members", node_s_members, 0);
5018
5019
 
5019
- /* Document-method: mid
5020
- * The operation to apply to the attribute before setting it. May
5021
- * be 0 (false) to indicate "logical or" or 1 (nil) to indicate
5022
- * "logical and".
5023
- */
5024
- rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
5025
- rb_ary_push(members, rb_str_new2("mid"));
5026
-
5027
5020
  /* Document-method: vid
5028
5021
  * The method to call on the receiver to retrieve the attribute
5029
5022
  */
@@ -5035,6 +5028,14 @@ void define_node_subclass_methods()
5035
5028
  */
5036
5029
  rb_define_method(rb_cOP_ASGN2_ARG, "aid", node_aid, 0);
5037
5030
  rb_ary_push(members, rb_str_new2("aid"));
5031
+
5032
+ /* Document-method: mid
5033
+ * The operation to apply to the attribute before setting it. May
5034
+ * be 0 (false) to indicate "logical or" or 1 (nil) to indicate
5035
+ * "logical and".
5036
+ */
5037
+ rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
5038
+ rb_ary_push(members, rb_str_new2("mid"));
5038
5039
  }
5039
5040
 
5040
5041
  /* Document-class: Node::OP_ASGN_AND
@@ -5083,12 +5084,6 @@ void define_node_subclass_methods()
5083
5084
  rb_iv_set(rb_cOP_ASGN_OR, "__type__", INT2NUM(NODE_OP_ASGN_OR));
5084
5085
  rb_define_singleton_method(rb_cOP_ASGN_OR, "members", node_s_members, 0);
5085
5086
 
5086
- /* Document-method: recv
5087
- * the receiver of the assignment
5088
- */
5089
- rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
5090
- rb_ary_push(members, rb_str_new2("recv"));
5091
-
5092
5087
  /* Document-method: aid
5093
5088
  * if this indicator is nonzero, ruby will check to see if the
5094
5089
  * provided expression is defined, otherwise it will assume that
@@ -5102,6 +5097,12 @@ void define_node_subclass_methods()
5102
5097
  */
5103
5098
  rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
5104
5099
  rb_ary_push(members, rb_str_new2("value"));
5100
+
5101
+ /* Document-method: recv
5102
+ * the receiver of the assignment
5103
+ */
5104
+ rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
5105
+ rb_ary_push(members, rb_str_new2("recv"));
5105
5106
  }
5106
5107
 
5107
5108
  /* Document-class: Node::OR
@@ -5119,17 +5120,17 @@ void define_node_subclass_methods()
5119
5120
  rb_iv_set(rb_cOR, "__type__", INT2NUM(NODE_OR));
5120
5121
  rb_define_singleton_method(rb_cOR, "members", node_s_members, 0);
5121
5122
 
5122
- /* Document-method: first
5123
- * the expression on the left hand side
5124
- */
5125
- rb_define_method(rb_cOR, "first", node_1st, 0);
5126
- rb_ary_push(members, rb_str_new2("first"));
5127
-
5128
5123
  /* Document-method: second
5129
5124
  * the expression on the right hand side
5130
5125
  */
5131
5126
  rb_define_method(rb_cOR, "second", node_2nd, 0);
5132
5127
  rb_ary_push(members, rb_str_new2("second"));
5128
+
5129
+ /* Document-method: first
5130
+ * the expression on the left hand side
5131
+ */
5132
+ rb_define_method(rb_cOR, "first", node_1st, 0);
5133
+ rb_ary_push(members, rb_str_new2("first"));
5133
5134
  }
5134
5135
 
5135
5136
  /* Document-class: Node::POSTEXE
@@ -5181,12 +5182,6 @@ void define_node_subclass_methods()
5181
5182
  rb_iv_set(rb_cRESBODY, "__type__", INT2NUM(NODE_RESBODY));
5182
5183
  rb_define_singleton_method(rb_cRESBODY, "members", node_s_members, 0);
5183
5184
 
5184
- /* Document-method: args
5185
- * the expression type to match against
5186
- */
5187
- rb_define_method(rb_cRESBODY, "args", node_args, 0);
5188
- rb_ary_push(members, rb_str_new2("args"));
5189
-
5190
5185
  /* Document-method: head
5191
5186
  * the next rescue
5192
5187
  */
@@ -5198,6 +5193,12 @@ void define_node_subclass_methods()
5198
5193
  */
5199
5194
  rb_define_method(rb_cRESBODY, "body", node_body, 0);
5200
5195
  rb_ary_push(members, rb_str_new2("body"));
5196
+
5197
+ /* Document-method: args
5198
+ * the expression type to match against
5199
+ */
5200
+ rb_define_method(rb_cRESBODY, "args", node_args, 0);
5201
+ rb_ary_push(members, rb_str_new2("args"));
5201
5202
  }
5202
5203
 
5203
5204
  /* Document-class: Node::RESCUE
@@ -5237,18 +5238,18 @@ void define_node_subclass_methods()
5237
5238
  rb_iv_set(rb_cRESCUE, "__type__", INT2NUM(NODE_RESCUE));
5238
5239
  rb_define_singleton_method(rb_cRESCUE, "members", node_s_members, 0);
5239
5240
 
5240
- /* Document-method: resq
5241
- * the expression to be evaluated if an exception is raised
5242
- */
5243
- rb_define_method(rb_cRESCUE, "resq", node_resq, 0);
5244
- rb_ary_push(members, rb_str_new2("resq"));
5245
-
5246
5241
  /* Document-method: head
5247
5242
  * the body of the block to evaluate
5248
5243
  */
5249
5244
  rb_define_method(rb_cRESCUE, "head", node_head, 0);
5250
5245
  rb_ary_push(members, rb_str_new2("head"));
5251
5246
 
5247
+ /* Document-method: resq
5248
+ * the expression to be evaluated if an exception is raised
5249
+ */
5250
+ rb_define_method(rb_cRESCUE, "resq", node_resq, 0);
5251
+ rb_ary_push(members, rb_str_new2("resq"));
5252
+
5252
5253
  /* Document-method: else
5253
5254
  * the expression to be evaluated if no exception is raised
5254
5255
  */
@@ -5308,17 +5309,17 @@ void define_node_subclass_methods()
5308
5309
  rb_iv_set(rb_cSCLASS, "__type__", INT2NUM(NODE_SCLASS));
5309
5310
  rb_define_singleton_method(rb_cSCLASS, "members", node_s_members, 0);
5310
5311
 
5311
- /* Document-method: recv
5312
- * the object whose singleton class is to be modified
5313
- */
5314
- rb_define_method(rb_cSCLASS, "recv", node_recv, 0);
5315
- rb_ary_push(members, rb_str_new2("recv"));
5316
-
5317
5312
  /* Document-method: body
5318
5313
  * the body of the class definition
5319
5314
  */
5320
5315
  rb_define_method(rb_cSCLASS, "body", node_body, 0);
5321
5316
  rb_ary_push(members, rb_str_new2("body"));
5317
+
5318
+ /* Document-method: recv
5319
+ * the object whose singleton class is to be modified
5320
+ */
5321
+ rb_define_method(rb_cSCLASS, "recv", node_recv, 0);
5322
+ rb_ary_push(members, rb_str_new2("recv"));
5322
5323
  }
5323
5324
 
5324
5325
  /* Document-class: Node::SCOPE
@@ -5529,6 +5530,12 @@ void define_node_subclass_methods()
5529
5530
  rb_iv_set(rb_cUNTIL, "__type__", INT2NUM(NODE_UNTIL));
5530
5531
  rb_define_singleton_method(rb_cUNTIL, "members", node_s_members, 0);
5531
5532
 
5533
+ /* Document-method: body
5534
+ * the body of the loop
5535
+ */
5536
+ rb_define_method(rb_cUNTIL, "body", node_body, 0);
5537
+ rb_ary_push(members, rb_str_new2("body"));
5538
+
5532
5539
  /* Document-method: cond
5533
5540
  * a condition to terminate the loop when it becomes true
5534
5541
  */
@@ -5536,12 +5543,6 @@ void define_node_subclass_methods()
5536
5543
  rb_ary_push(members, rb_str_new2("cond"));
5537
5544
  rb_define_method(rb_cUNTIL, "state", node_state, 0);
5538
5545
  rb_ary_push(members, rb_str_new2("state"));
5539
-
5540
- /* Document-method: body
5541
- * the body of the loop
5542
- */
5543
- rb_define_method(rb_cUNTIL, "body", node_body, 0);
5544
- rb_ary_push(members, rb_str_new2("body"));
5545
5546
  }
5546
5547
 
5547
5548
  /* Document-class: Node::VALIAS
@@ -5620,12 +5621,6 @@ void define_node_subclass_methods()
5620
5621
  rb_iv_set(rb_cWHEN, "__type__", INT2NUM(NODE_WHEN));
5621
5622
  rb_define_singleton_method(rb_cWHEN, "members", node_s_members, 0);
5622
5623
 
5623
- /* Document-method: next
5624
- * the next expression to be evaluated if the condition is false
5625
- */
5626
- rb_define_method(rb_cWHEN, "next", node_next, 0);
5627
- rb_ary_push(members, rb_str_new2("next"));
5628
-
5629
5624
  /* Document-method: head
5630
5625
  * a value to compare against, or a condition to be tested
5631
5626
  */
@@ -5637,6 +5632,12 @@ void define_node_subclass_methods()
5637
5632
  */
5638
5633
  rb_define_method(rb_cWHEN, "body", node_body, 0);
5639
5634
  rb_ary_push(members, rb_str_new2("body"));
5635
+
5636
+ /* Document-method: next
5637
+ * the next expression to be evaluated if the condition is false
5638
+ */
5639
+ rb_define_method(rb_cWHEN, "next", node_next, 0);
5640
+ rb_ary_push(members, rb_str_new2("next"));
5640
5641
  }
5641
5642
 
5642
5643
  /* Document-class: Node::WHILE
@@ -5653,6 +5654,12 @@ void define_node_subclass_methods()
5653
5654
  rb_iv_set(rb_cWHILE, "__type__", INT2NUM(NODE_WHILE));
5654
5655
  rb_define_singleton_method(rb_cWHILE, "members", node_s_members, 0);
5655
5656
 
5657
+ /* Document-method: body
5658
+ * the body of the loop
5659
+ */
5660
+ rb_define_method(rb_cWHILE, "body", node_body, 0);
5661
+ rb_ary_push(members, rb_str_new2("body"));
5662
+
5656
5663
  /* Document-method: cond
5657
5664
  * a condition to terminate the loop when it becomes false
5658
5665
  */
@@ -5660,12 +5667,6 @@ void define_node_subclass_methods()
5660
5667
  rb_ary_push(members, rb_str_new2("cond"));
5661
5668
  rb_define_method(rb_cWHILE, "state", node_state, 0);
5662
5669
  rb_ary_push(members, rb_str_new2("state"));
5663
-
5664
- /* Document-method: body
5665
- * the body of the loop
5666
- */
5667
- rb_define_method(rb_cWHILE, "body", node_body, 0);
5668
- rb_ary_push(members, rb_str_new2("body"));
5669
5670
  }
5670
5671
 
5671
5672
  /* Document-class: Node::XSTR
@@ -5702,17 +5703,17 @@ void define_node_subclass_methods()
5702
5703
  rb_iv_set(rb_cYIELD, "__type__", INT2NUM(NODE_YIELD));
5703
5704
  rb_define_singleton_method(rb_cYIELD, "members", node_s_members, 0);
5704
5705
 
5705
- /* Document-method: state
5706
- * if nonzero, splats the value before yielding
5707
- */
5708
- rb_define_method(rb_cYIELD, "state", node_state, 0);
5709
- rb_ary_push(members, rb_str_new2("state"));
5710
-
5711
5706
  /* Document-method: head
5712
5707
  * the value to yield
5713
5708
  */
5714
5709
  rb_define_method(rb_cYIELD, "head", node_head, 0);
5715
5710
  rb_ary_push(members, rb_str_new2("head"));
5711
+
5712
+ /* Document-method: state
5713
+ * if nonzero, splats the value before yielding
5714
+ */
5715
+ rb_define_method(rb_cYIELD, "state", node_state, 0);
5716
+ rb_ary_push(members, rb_str_new2("state"));
5716
5717
  }
5717
5718
 
5718
5719
  /* Document-class: Node::ZARRAY