ruby-internal 0.7.3 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. data/bin/ruby-internal-node-dump +1 -1
  2. data/bin/ruby-internal-obfuscate +1 -1
  3. data/ext/cached/ruby-1.8.4/internal/method/{method.h → internal_method.h} +12 -0
  4. data/ext/cached/ruby-1.8.4/internal/module/getcfp.h +13 -0
  5. data/ext/cached/ruby-1.8.4/internal/node/global_entry.h +94 -0
  6. data/ext/cached/ruby-1.8.4/internal/node/node_type_descrip.c +41 -41
  7. data/ext/cached/ruby-1.8.4/internal/node/nodeinfo.c +288 -273
  8. data/ext/cached/ruby-1.8.4/internal/vm/instruction/insns_info.c +3 -0
  9. data/ext/cached/ruby-1.8.4/internal/vm/iseq/iseq_load.inc +21 -2
  10. data/ext/cached/{ruby-1.8.3/internal/method/method.h → ruby-1.8.5/internal/method/internal_method.h} +12 -0
  11. data/ext/cached/ruby-1.8.5/internal/module/getcfp.h +13 -0
  12. data/ext/cached/ruby-1.8.5/internal/node/global_entry.h +94 -0
  13. data/ext/cached/ruby-1.8.5/internal/node/node_type_descrip.c +45 -45
  14. data/ext/cached/ruby-1.8.5/internal/node/nodeinfo.c +310 -295
  15. data/ext/cached/ruby-1.8.5/internal/vm/instruction/insns_info.c +3 -0
  16. data/ext/cached/ruby-1.8.5/internal/vm/iseq/iseq_load.inc +21 -2
  17. data/ext/cached/{ruby-1.8.5/internal/method/method.h → ruby-1.8.6/internal/method/internal_method.h} +12 -0
  18. data/ext/cached/ruby-1.8.6/internal/module/getcfp.h +13 -0
  19. data/ext/cached/ruby-1.8.6/internal/node/global_entry.h +94 -0
  20. data/ext/cached/ruby-1.8.6/internal/node/node_type_descrip.c +48 -48
  21. data/ext/cached/ruby-1.8.6/internal/node/nodeinfo.c +323 -308
  22. data/ext/cached/ruby-1.8.6/internal/vm/instruction/insns_info.c +3 -0
  23. data/ext/cached/ruby-1.8.6/internal/vm/iseq/iseq_load.inc +21 -2
  24. data/ext/cached/{ruby-1.8.6/internal/method/method.h → ruby-1.8.7/internal/method/internal_method.h} +12 -0
  25. data/ext/cached/ruby-1.8.7/internal/module/getcfp.h +13 -0
  26. data/ext/cached/ruby-1.8.7/internal/node/global_entry.h +98 -0
  27. data/ext/cached/ruby-1.8.7/internal/node/node_type_descrip.c +42 -42
  28. data/ext/cached/ruby-1.8.7/internal/node/nodeinfo.c +276 -261
  29. data/ext/cached/ruby-1.8.7/internal/vm/instruction/insns_info.c +3 -0
  30. data/ext/cached/ruby-1.8.7/internal/vm/iseq/iseq_load.inc +21 -2
  31. data/ext/cached/{ruby-1.9.0/internal/method/method.h → ruby-1.9.1/internal/method/internal_method.h} +12 -0
  32. data/ext/cached/ruby-1.9.1/internal/module/classpath.c +12 -14
  33. data/ext/cached/ruby-1.9.1/internal/module/getcfp.h +25 -0
  34. data/ext/cached/ruby-1.9.1/internal/node/global_entry.h +86 -0
  35. data/ext/cached/ruby-1.9.1/internal/node/node_type_descrip.c +46 -48
  36. data/ext/cached/ruby-1.9.1/internal/node/nodeinfo.c +311 -412
  37. data/ext/cached/ruby-1.9.1/internal/vm/instruction/insns_info.c +3 -0
  38. data/ext/cached/ruby-1.9.1/internal/vm/iseq/iseq_load.inc +28 -6
  39. data/ext/cached/ruby-1.9.1/internal/yarv-headers/iseq.h +1 -0
  40. data/ext/cached/ruby-1.9.1/internal/yarv-headers/parse.h +6 -6
  41. data/ext/cached/ruby-1.9.1/internal/yarv-headers/revision.h +1 -1
  42. data/ext/cached/ruby-1.9.1/internal/yarv-headers/version.h +6 -5
  43. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_core.h +3 -2
  44. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_insnhelper.h +1 -0
  45. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/binding/block.h +0 -0
  46. data/ext/cached/{ruby-1.9.1/internal/method/method.h → ruby-1.9.2/internal/method/internal_method.h} +16 -5
  47. data/ext/cached/ruby-1.9.2/internal/module/classpath.c +40 -0
  48. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/module/classpath.h +0 -0
  49. data/ext/cached/ruby-1.9.2/internal/module/getcfp.h +25 -0
  50. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/block.h +0 -0
  51. data/ext/cached/ruby-1.9.2/internal/node/global_entry.h +93 -0
  52. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/node_type_descrip.c +44 -48
  53. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/nodeinfo.c +291 -439
  54. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/nodeinfo.h +0 -0
  55. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/proc/block.h +0 -0
  56. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/tag/tag.h +0 -0
  57. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/instruction/insns_info.c +141 -64
  58. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/instruction/insns_info.h +88 -80
  59. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/iseq/insns_info.inc +77 -70
  60. data/ext/cached/ruby-1.9.2/internal/vm/iseq/iseq_load.inc +426 -0
  61. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/debug.h +1 -1
  62. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/dln.h +3 -3
  63. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/encdb.h +18 -2
  64. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/eval_intern.h +39 -28
  65. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/gc.h +7 -5
  66. data/ext/cached/ruby-1.9.2/internal/yarv-headers/id.h +170 -0
  67. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/iseq.h +20 -10
  68. data/ext/cached/ruby-1.9.2/internal/yarv-headers/method.h +103 -0
  69. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/node.h +14 -47
  70. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/parse.h +31 -148
  71. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regenc.h +7 -3
  72. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regint.h +16 -17
  73. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regparse.h +4 -1
  74. data/ext/cached/ruby-1.9.2/internal/yarv-headers/revision.h +1 -0
  75. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/thread_pthread.h +4 -1
  76. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/thread_win32.h +1 -1
  77. data/ext/cached/ruby-1.9.2/internal/yarv-headers/timev.h +21 -0
  78. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/transcode_data.h +20 -10
  79. data/ext/cached/ruby-1.9.2/internal/yarv-headers/transdb.h +179 -0
  80. data/ext/cached/ruby-1.9.2/internal/yarv-headers/version.h +55 -0
  81. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_core.h +127 -84
  82. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_exec.h +4 -7
  83. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_insnhelper.h +53 -36
  84. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_opts.h +1 -1
  85. data/ext/cached/ruby-1.9.3/internal/binding/block.h +12 -0
  86. data/ext/cached/ruby-1.9.3/internal/method/internal_method.h +32 -0
  87. data/ext/cached/ruby-1.9.3/internal/module/classpath.c +40 -0
  88. data/ext/cached/{ruby-1.8.0 → ruby-1.9.3}/internal/module/classpath.h +5 -2
  89. data/ext/cached/ruby-1.9.3/internal/module/getcfp.h +25 -0
  90. data/ext/cached/ruby-1.9.3/internal/node/block.h +12 -0
  91. data/ext/cached/ruby-1.9.3/internal/node/global_entry.h +93 -0
  92. data/ext/cached/{ruby-1.8.3 → ruby-1.9.3}/internal/node/node_type_descrip.c +48 -57
  93. data/ext/cached/{ruby-1.6.8 → ruby-1.9.3}/internal/node/nodeinfo.c +589 -740
  94. data/ext/cached/{ruby-1.8.0 → ruby-1.9.3}/internal/node/nodeinfo.h +4 -3
  95. data/ext/cached/ruby-1.9.3/internal/proc/block.h +12 -0
  96. data/ext/cached/ruby-1.9.3/internal/tag/tag.h +6 -0
  97. data/ext/cached/ruby-1.9.3/internal/vm/instruction/insns_info.c +6013 -0
  98. data/ext/cached/ruby-1.9.3/internal/vm/instruction/insns_info.h +899 -0
  99. data/ext/cached/ruby-1.9.3/internal/vm/iseq/insns_info.inc +707 -0
  100. data/ext/cached/ruby-1.9.3/internal/vm/iseq/iseq_load.inc +423 -0
  101. data/ext/cached/ruby-1.9.3/internal/yarv-headers/addr2line.h +21 -0
  102. data/ext/cached/ruby-1.9.3/internal/yarv-headers/atomic.h +56 -0
  103. data/ext/cached/ruby-1.9.3/internal/yarv-headers/constant.h +34 -0
  104. data/ext/cached/ruby-1.9.3/internal/yarv-headers/debug.h +41 -0
  105. data/ext/cached/ruby-1.9.3/internal/yarv-headers/dln.h +50 -0
  106. data/ext/cached/ruby-1.9.3/internal/yarv-headers/encdb.h +167 -0
  107. data/ext/cached/ruby-1.9.3/internal/yarv-headers/eval_intern.h +234 -0
  108. data/ext/cached/ruby-1.9.3/internal/yarv-headers/gc.h +98 -0
  109. data/ext/cached/ruby-1.9.3/internal/yarv-headers/id.h +175 -0
  110. data/ext/cached/ruby-1.9.3/internal/yarv-headers/internal.h +232 -0
  111. data/ext/cached/ruby-1.9.3/internal/yarv-headers/iseq.h +125 -0
  112. data/ext/cached/ruby-1.9.3/internal/yarv-headers/method.h +105 -0
  113. data/ext/cached/ruby-1.9.3/internal/yarv-headers/node.h +503 -0
  114. data/ext/cached/ruby-1.9.3/internal/yarv-headers/parse.h +186 -0
  115. data/ext/cached/ruby-1.9.3/internal/yarv-headers/regenc.h +219 -0
  116. data/ext/cached/ruby-1.9.3/internal/yarv-headers/regint.h +850 -0
  117. data/ext/cached/ruby-1.9.3/internal/yarv-headers/regparse.h +362 -0
  118. data/ext/cached/ruby-1.9.3/internal/yarv-headers/revision.h +1 -0
  119. data/ext/cached/ruby-1.9.3/internal/yarv-headers/thread_pthread.h +51 -0
  120. data/ext/cached/ruby-1.9.3/internal/yarv-headers/thread_win32.h +40 -0
  121. data/ext/cached/ruby-1.9.3/internal/yarv-headers/timev.h +21 -0
  122. data/ext/cached/ruby-1.9.3/internal/yarv-headers/transcode_data.h +117 -0
  123. data/ext/cached/ruby-1.9.3/internal/yarv-headers/transdb.h +189 -0
  124. data/ext/cached/ruby-1.9.3/internal/yarv-headers/version.h +52 -0
  125. data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_core.h +756 -0
  126. data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_exec.h +184 -0
  127. data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_insnhelper.h +220 -0
  128. data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_opts.h +51 -0
  129. data/ext/internal/binding/block.h +20 -0
  130. data/ext/internal/method/internal_method.h +5 -38
  131. data/ext/internal/method/internal_method.h.rpp +0 -7
  132. data/ext/internal/method/method.c +52 -32
  133. data/ext/internal/module/classpath.c +18 -13
  134. data/ext/internal/module/classpath.h +3 -3
  135. data/ext/internal/module/extconf.rb +3 -2
  136. data/ext/internal/module/getcfp.h +13 -0
  137. data/ext/internal/module/getcfp.h.rpp +44 -0
  138. data/ext/internal/module/module.c +58 -21
  139. data/ext/internal/node/block.h +20 -0
  140. data/ext/internal/node/extconf.rb +2 -0
  141. data/ext/internal/node/global_entry.h +69 -13
  142. data/ext/internal/node/global_entry.h.rpp +11 -2
  143. data/ext/internal/node/node.c +30 -3
  144. data/ext/internal/node/node_type_descrip.c +47 -38
  145. data/ext/internal/node/nodeinfo.c +622 -306
  146. data/ext/internal/node/nodeinfo.h +1 -4
  147. data/ext/internal/proc/block.h +20 -0
  148. data/ext/internal/tag/tag.h +10 -0
  149. data/ext/internal/thread/thread.c +9 -3
  150. data/ext/internal/vm/extconf.rb +1 -0
  151. data/ext/internal/vm/instruction/insns_info.c +3 -5974
  152. data/ext/internal/vm/instruction/insns_info.h +0 -878
  153. data/ext/internal/vm/iseq/extconf.rb +1 -0
  154. data/ext/internal/vm/iseq/iseq.c +38 -4
  155. data/ext/internal/vm/iseq/iseq_load.inc.rpp +23 -5
  156. data/ext/internal/vm/vm.c +28 -0
  157. data/lib/internal/classtree.rb +28 -0
  158. data/lib/internal/debug.rb +10 -2
  159. data/lib/internal/method/as_code.rb +25 -0
  160. data/lib/internal/method/as_expression.rb +2 -3
  161. data/lib/internal/method/origin.rb +29 -0
  162. data/lib/internal/method/signature.rb +5 -300
  163. data/lib/internal/method/signature/argument.rb +102 -0
  164. data/lib/internal/method/signature/iseq.rb +52 -0
  165. data/lib/internal/method/signature/node.rb +160 -0
  166. data/lib/internal/method/signature/signature.rb +23 -0
  167. data/lib/internal/proc/as_code.rb +2 -0
  168. data/lib/internal/proc/as_expression.rb +2 -0
  169. data/lib/internal/vm/bytedecoder.rb +5 -5
  170. data/lib/internal/vm/iseq/as_code.rb +2 -2
  171. data/lib/internal/vm/iseq/as_expression.rb +2 -2
  172. data/test/test_dump_method.rb +1 -1
  173. data/test/test_method.rb +21 -3
  174. data/test/test_node.rb +20 -4
  175. metadata +152 -155
  176. data/ext/cached/ruby-1.6.8/internal/binding/block.h +0 -35
  177. data/ext/cached/ruby-1.6.8/internal/method/method.h +0 -19
  178. data/ext/cached/ruby-1.6.8/internal/module/classpath.c +0 -3
  179. data/ext/cached/ruby-1.6.8/internal/module/classpath.h +0 -8
  180. data/ext/cached/ruby-1.6.8/internal/node/block.h +0 -35
  181. data/ext/cached/ruby-1.6.8/internal/node/global_entry.h +0 -15
  182. data/ext/cached/ruby-1.6.8/internal/node/node_type_descrip.c +0 -149
  183. data/ext/cached/ruby-1.6.8/internal/node/nodeinfo.h +0 -69
  184. data/ext/cached/ruby-1.6.8/internal/proc/block.h +0 -35
  185. data/ext/cached/ruby-1.6.8/internal/tag/tag.h +0 -15
  186. data/ext/cached/ruby-1.6.8/internal/vm/instruction/insns_info.c +0 -39
  187. data/ext/cached/ruby-1.6.8/internal/vm/instruction/insns_info.h +0 -21
  188. data/ext/cached/ruby-1.6.8/internal/vm/iseq/insns_info.inc +0 -12
  189. data/ext/cached/ruby-1.6.8/internal/vm/iseq/iseq_load.inc +0 -9
  190. data/ext/cached/ruby-1.8.0/internal/binding/block.h +0 -37
  191. data/ext/cached/ruby-1.8.0/internal/method/method.h +0 -19
  192. data/ext/cached/ruby-1.8.0/internal/module/classpath.c +0 -27
  193. data/ext/cached/ruby-1.8.0/internal/node/block.h +0 -37
  194. data/ext/cached/ruby-1.8.0/internal/node/global_entry.h +0 -10
  195. data/ext/cached/ruby-1.8.0/internal/node/node_type_descrip.c +0 -155
  196. data/ext/cached/ruby-1.8.0/internal/node/nodeinfo.c +0 -5744
  197. data/ext/cached/ruby-1.8.0/internal/proc/block.h +0 -37
  198. data/ext/cached/ruby-1.8.0/internal/tag/tag.h +0 -15
  199. data/ext/cached/ruby-1.8.0/internal/vm/instruction/insns_info.c +0 -39
  200. data/ext/cached/ruby-1.8.0/internal/vm/instruction/insns_info.h +0 -21
  201. data/ext/cached/ruby-1.8.0/internal/vm/iseq/insns_info.inc +0 -12
  202. data/ext/cached/ruby-1.8.0/internal/vm/iseq/iseq_load.inc +0 -9
  203. data/ext/cached/ruby-1.8.1/internal/binding/block.h +0 -31
  204. data/ext/cached/ruby-1.8.1/internal/method/method.h +0 -19
  205. data/ext/cached/ruby-1.8.1/internal/module/classpath.c +0 -27
  206. data/ext/cached/ruby-1.8.1/internal/module/classpath.h +0 -14
  207. data/ext/cached/ruby-1.8.1/internal/node/block.h +0 -31
  208. data/ext/cached/ruby-1.8.1/internal/node/global_entry.h +0 -10
  209. data/ext/cached/ruby-1.8.1/internal/node/node_type_descrip.c +0 -154
  210. data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.c +0 -5736
  211. data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.h +0 -69
  212. data/ext/cached/ruby-1.8.1/internal/proc/block.h +0 -31
  213. data/ext/cached/ruby-1.8.1/internal/tag/tag.h +0 -16
  214. data/ext/cached/ruby-1.8.1/internal/vm/instruction/insns_info.c +0 -39
  215. data/ext/cached/ruby-1.8.1/internal/vm/instruction/insns_info.h +0 -21
  216. data/ext/cached/ruby-1.8.1/internal/vm/iseq/insns_info.inc +0 -12
  217. data/ext/cached/ruby-1.8.1/internal/vm/iseq/iseq_load.inc +0 -9
  218. data/ext/cached/ruby-1.8.2/internal/binding/block.h +0 -32
  219. data/ext/cached/ruby-1.8.2/internal/method/method.h +0 -19
  220. data/ext/cached/ruby-1.8.2/internal/module/classpath.c +0 -45
  221. data/ext/cached/ruby-1.8.2/internal/module/classpath.h +0 -17
  222. data/ext/cached/ruby-1.8.2/internal/node/block.h +0 -32
  223. data/ext/cached/ruby-1.8.2/internal/node/global_entry.h +0 -10
  224. data/ext/cached/ruby-1.8.2/internal/node/node_type_descrip.c +0 -154
  225. data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.c +0 -5736
  226. data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.h +0 -69
  227. data/ext/cached/ruby-1.8.2/internal/proc/block.h +0 -32
  228. data/ext/cached/ruby-1.8.2/internal/tag/tag.h +0 -16
  229. data/ext/cached/ruby-1.8.2/internal/vm/instruction/insns_info.c +0 -39
  230. data/ext/cached/ruby-1.8.2/internal/vm/instruction/insns_info.h +0 -21
  231. data/ext/cached/ruby-1.8.2/internal/vm/iseq/insns_info.inc +0 -12
  232. data/ext/cached/ruby-1.8.2/internal/vm/iseq/iseq_load.inc +0 -9
  233. data/ext/cached/ruby-1.8.3/internal/binding/block.h +0 -32
  234. data/ext/cached/ruby-1.8.3/internal/module/classpath.c +0 -45
  235. data/ext/cached/ruby-1.8.3/internal/module/classpath.h +0 -17
  236. data/ext/cached/ruby-1.8.3/internal/node/block.h +0 -32
  237. data/ext/cached/ruby-1.8.3/internal/node/global_entry.h +0 -10
  238. data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.c +0 -5736
  239. data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.h +0 -69
  240. data/ext/cached/ruby-1.8.3/internal/proc/block.h +0 -32
  241. data/ext/cached/ruby-1.8.3/internal/tag/tag.h +0 -16
  242. data/ext/cached/ruby-1.8.3/internal/vm/instruction/insns_info.c +0 -39
  243. data/ext/cached/ruby-1.8.3/internal/vm/instruction/insns_info.h +0 -21
  244. data/ext/cached/ruby-1.8.3/internal/vm/iseq/insns_info.inc +0 -12
  245. data/ext/cached/ruby-1.8.3/internal/vm/iseq/iseq_load.inc +0 -9
  246. data/ext/cached/ruby-1.8.7/internal/method/method.h +0 -20
  247. data/ext/cached/ruby-1.9.0/internal/module/classpath.c +0 -42
  248. data/ext/cached/ruby-1.9.0/internal/node/global_entry.h +0 -10
  249. data/ext/cached/ruby-1.9.0/internal/vm/iseq/iseq_load.inc +0 -13
  250. data/ext/cached/ruby-1.9.0/internal/yarv-headers/id.h +0 -83
  251. data/ext/cached/ruby-1.9.0/internal/yarv-headers/revision.h +0 -1
  252. data/ext/cached/ruby-1.9.0/internal/yarv-headers/transdb.h +0 -67
  253. data/ext/cached/ruby-1.9.0/internal/yarv-headers/version.h +0 -57
  254. data/ext/internal/module/cfp.h +0 -13
@@ -228,7 +228,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
228
228
  else
229
229
  {
230
230
  path = rb_class_path(klass);
231
- if(STR2CSTR(path)[0] == '#')
231
+ if(StringValuePtr(path)[0] == '#')
232
232
  {
233
233
  rb_raise(rb_eArgError, "cannot dump anonymous class");
234
234
  }
@@ -250,19 +250,6 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
250
250
  INT2NUM(TYPE((VALUE)n->nd_clss)),
251
251
  (VALUE)n->nd_clss);
252
252
  }
253
- case NEN_CNAME:
254
- if(n->nd_cname == 0)
255
- {
256
- return Qfalse;
257
- }
258
- else if(n->nd_cname == 1)
259
- {
260
- return Qtrue;
261
- }
262
- else
263
- {
264
- return ID2SYM(n->nd_cname);
265
- }
266
253
  case NEN_CNT:
267
254
  {
268
255
  return LONG2NUM((long)n->nd_cnt);
@@ -291,6 +278,30 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
291
278
  {
292
279
  return Qnil;
293
280
  }
281
+ case NEN_CPATH:
282
+ if(n->nd_cpath)
283
+ {
284
+ int node_type;
285
+ if(0 && nd_type(n) == NODE_OP_ASGN2)
286
+ {
287
+ /* All children of NODE_OP_ASGN2 are NODE_OP_ASGN2_ARG */
288
+ node_type = NODE_OP_ASGN2_ARG;
289
+ }
290
+ else
291
+ {
292
+ node_type = nd_type(n->nd_cpath);
293
+ }
294
+
295
+ dump_node_or_iseq_to_hash(
296
+ (VALUE)n->nd_cpath,
297
+ node_type,
298
+ node_hash);
299
+ return node_id(n->nd_cpath);
300
+ }
301
+ else
302
+ {
303
+ return Qnil;
304
+ }
294
305
  case NEN_CVAL:
295
306
  switch(TYPE(n->nd_cval))
296
307
  {
@@ -311,7 +322,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
311
322
  else
312
323
  {
313
324
  path = rb_class_path(klass);
314
- if(STR2CSTR(path)[0] == '#')
325
+ if(StringValuePtr(path)[0] == '#')
315
326
  {
316
327
  rb_raise(rb_eArgError, "cannot dump anonymous class");
317
328
  }
@@ -439,28 +450,8 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
439
450
  return ID2SYM(n->nd_entry->id);
440
451
  }
441
452
  case NEN_FRML:
442
- if(n->nd_frml)
443
- {
444
- int node_type;
445
- if(0 && nd_type(n) == NODE_OP_ASGN2)
446
- {
447
- /* All children of NODE_OP_ASGN2 are NODE_OP_ASGN2_ARG */
448
- node_type = NODE_OP_ASGN2_ARG;
449
- }
450
- else
451
- {
452
- node_type = nd_type(n->nd_frml);
453
- }
454
-
455
- dump_node_or_iseq_to_hash(
456
- (VALUE)n->nd_frml,
457
- node_type,
458
- node_hash);
459
- return node_id(n->nd_frml);
460
- }
461
- else
462
453
  {
463
- return Qnil;
454
+ return LONG2NUM((long)n->nd_frml);
464
455
  }
465
456
  case NEN_HEAD:
466
457
  if(n->nd_head)
@@ -486,30 +477,6 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
486
477
  {
487
478
  return Qnil;
488
479
  }
489
- case NEN_IBDY:
490
- if(n->nd_ibdy)
491
- {
492
- int node_type;
493
- if(0 && nd_type(n) == NODE_OP_ASGN2)
494
- {
495
- /* All children of NODE_OP_ASGN2 are NODE_OP_ASGN2_ARG */
496
- node_type = NODE_OP_ASGN2_ARG;
497
- }
498
- else
499
- {
500
- node_type = nd_type(n->nd_ibdy);
501
- }
502
-
503
- dump_node_or_iseq_to_hash(
504
- (VALUE)n->nd_ibdy,
505
- node_type,
506
- node_hash);
507
- return node_id(n->nd_ibdy);
508
- }
509
- else
510
- {
511
- return Qnil;
512
- }
513
480
  case NEN_ITER:
514
481
  if(n->nd_iter)
515
482
  {
@@ -554,7 +521,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
554
521
  else
555
522
  {
556
523
  path = rb_class_path(klass);
557
- if(STR2CSTR(path)[0] == '#')
524
+ if(StringValuePtr(path)[0] == '#')
558
525
  {
559
526
  rb_raise(rb_eArgError, "cannot dump anonymous class");
560
527
  }
@@ -602,19 +569,6 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
602
569
  {
603
570
  return ID2SYM(n->nd_modl);
604
571
  }
605
- case NEN_NEW:
606
- if(n->nd_new == 0)
607
- {
608
- return Qfalse;
609
- }
610
- else if(n->nd_new == 1)
611
- {
612
- return Qtrue;
613
- }
614
- else
615
- {
616
- return ID2SYM(n->nd_new);
617
- }
618
572
  case NEN_NEXT:
619
573
  if(n->nd_next)
620
574
  {
@@ -647,18 +601,18 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
647
601
  {
648
602
  return LONG2NUM((long)n->nd_nth);
649
603
  }
650
- case NEN_OLD:
651
- if(n->nd_old == 0)
604
+ case NEN_OID:
605
+ if(n->nd_oid == 0)
652
606
  {
653
607
  return Qfalse;
654
608
  }
655
- else if(n->nd_old == 1)
609
+ else if(n->nd_oid == 1)
656
610
  {
657
611
  return Qtrue;
658
612
  }
659
613
  else
660
614
  {
661
- return ID2SYM(n->nd_old);
615
+ return ID2SYM(n->nd_oid);
662
616
  }
663
617
  case NEN_OPT:
664
618
  if(n->nd_opt)
@@ -704,7 +658,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
704
658
  else
705
659
  {
706
660
  path = rb_class_path(klass);
707
- if(STR2CSTR(path)[0] == '#')
661
+ if(StringValuePtr(path)[0] == '#')
708
662
  {
709
663
  rb_raise(rb_eArgError, "cannot dump anonymous class");
710
664
  }
@@ -726,6 +680,23 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
726
680
  INT2NUM(TYPE((VALUE)n->nd_orig)),
727
681
  (VALUE)n->nd_orig);
728
682
  }
683
+ case NEN_PID:
684
+ if(n->nd_pid == 0)
685
+ {
686
+ return Qfalse;
687
+ }
688
+ else if(n->nd_pid == 1)
689
+ {
690
+ return Qtrue;
691
+ }
692
+ else
693
+ {
694
+ return ID2SYM(n->nd_pid);
695
+ }
696
+ case NEN_PLEN:
697
+ {
698
+ return LONG2NUM((long)n->nd_plen);
699
+ }
729
700
  case NEN_RECV:
730
701
  if(n->nd_recv)
731
702
  {
@@ -775,8 +746,17 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
775
746
  return Qnil;
776
747
  }
777
748
  case NEN_REST:
749
+ if(n->nd_rest == 0)
750
+ {
751
+ return Qfalse;
752
+ }
753
+ else if(n->nd_rest == 1)
754
+ {
755
+ return Qtrue;
756
+ }
757
+ else
778
758
  {
779
- return LONG2NUM((long)n->nd_rest);
759
+ return ID2SYM(n->nd_rest);
780
760
  }
781
761
  case NEN_RVAL:
782
762
  if(n->nd_2nd)
@@ -892,7 +872,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
892
872
  else
893
873
  {
894
874
  path = rb_class_path(klass);
895
- if(STR2CSTR(path)[0] == '#')
875
+ if(StringValuePtr(path)[0] == '#')
896
876
  {
897
877
  rb_raise(rb_eArgError, "cannot dump anonymous class");
898
878
  }
@@ -975,6 +955,10 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
975
955
  {
976
956
  return ID2SYM(n->nd_vid);
977
957
  }
958
+ case NEN_VISI:
959
+ {
960
+ return LONG2NUM((long)n->nd_visi);
961
+ }
978
962
  }
979
963
  rb_raise(rb_eArgError, "Invalid Node_Elem_Name %d", nen);
980
964
  }
@@ -1147,20 +1131,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1147
1131
  }
1148
1132
  case NEN_CLSS:
1149
1133
  {
1134
+ int flags;
1150
1135
  Check_Type(v, T_ARRAY);
1151
1136
  if(RARRAY_LEN(v) != 2)
1152
1137
  {
1153
1138
  rb_raise(rb_eArgError, "wrong size for array");
1154
1139
  }
1155
- int flags = NUM2INT(RARRAY_PTR(v)[0]);
1140
+ flags = NUM2INT(RARRAY_PTR(v)[0]);
1156
1141
  switch(flags & T_MASK)
1157
1142
  {
1158
1143
  case T_CLASS:
1159
1144
  case T_MODULE:
1160
1145
  {
1161
- VALUE str = RARRAY_PTR(v)[1];
1146
+ VALUE str, klass;
1147
+
1148
+ str = RARRAY_PTR(v)[1];
1162
1149
  Check_Type(str, T_STRING);
1163
- VALUE klass = rb_path2class(STR2CSTR(str));
1150
+ klass = rb_path2class(StringValuePtr(str));
1164
1151
  if(flags & FL_SINGLETON)
1165
1152
  {
1166
1153
  *(VALUE *)(&n->nd_clss) =
@@ -1179,39 +1166,48 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1179
1166
  }
1180
1167
  return;
1181
1168
  }
1182
- case NEN_CNAME:
1169
+ case NEN_CNT:
1183
1170
  {
1184
- if(v == Qfalse)
1185
- {
1186
- n->nd_cname = 0;
1171
+ n->nd_cnt = NUM2LONG(v);
1172
+ return;
1187
1173
  }
1188
- else if(v == Qfalse)
1174
+ case NEN_COND:
1175
+ {
1176
+ if(v == Qnil)
1189
1177
  {
1190
- n->nd_cname = 1;
1178
+ n->nd_cond = 0;
1191
1179
  }
1192
1180
  else
1193
1181
  {
1194
- n->nd_cname = SYM2ID(v);
1195
- }
1196
- return;
1182
+ VALUE nid = rb_hash_aref(id_hash, v);
1183
+ if(RTEST(nid))
1184
+ {
1185
+ n->nd_cond = id_to_node(nid);
1186
+ }
1187
+ else
1188
+ {
1189
+ n->u1.node = (NODE *)load_node_or_iseq_from_hash(
1190
+ v, node_hash, id_hash);
1191
+ if(nd_type(n->u1.node) == NODE_OP_ASGN2_ARG)
1192
+ {
1193
+ nd_set_type(n->u1.node, NODE_OP_ASGN2);
1194
+ }
1195
+ }
1197
1196
  }
1198
- case NEN_CNT:
1199
- {
1200
- n->nd_cnt = NUM2LONG(v);
1201
1197
  return;
1202
1198
  }
1203
- case NEN_COND:
1199
+ case NEN_CPATH:
1204
1200
  {
1205
1201
  if(v == Qnil)
1206
1202
  {
1207
- n->nd_cond = 0;
1203
+ n->nd_cpath = 0;
1208
1204
  }
1209
1205
  else
1210
1206
  {
1211
1207
  VALUE nid = rb_hash_aref(id_hash, v);
1212
1208
  if(RTEST(nid))
1213
1209
  {
1214
- n->nd_cond = id_to_node(nid);
1210
+ n->nd_cpath = id_to_node(nid);
1215
1211
  }
1216
1212
  else
1217
1213
  {
@@ -1227,20 +1223,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1227
1223
  }
1228
1224
  case NEN_CVAL:
1229
1225
  {
1226
+ int flags;
1230
1227
  Check_Type(v, T_ARRAY);
1231
1228
  if(RARRAY_LEN(v) != 2)
1232
1229
  {
1233
1230
  rb_raise(rb_eArgError, "wrong size for array");
1234
1231
  }
1235
- int flags = NUM2INT(RARRAY_PTR(v)[0]);
1232
+ flags = NUM2INT(RARRAY_PTR(v)[0]);
1236
1233
  switch(flags & T_MASK)
1237
1234
  {
1238
1235
  case T_CLASS:
1239
1236
  case T_MODULE:
1240
1237
  {
1241
- VALUE str = RARRAY_PTR(v)[1];
1238
+ VALUE str, klass;
1239
+
1240
+ str = RARRAY_PTR(v)[1];
1242
1241
  Check_Type(str, T_STRING);
1243
- VALUE klass = rb_path2class(STR2CSTR(str));
1242
+ klass = rb_path2class(StringValuePtr(str));
1244
1243
  if(flags & FL_SINGLETON)
1245
1244
  {
1246
1245
  *(VALUE *)(&n->nd_cval) =
@@ -1366,27 +1365,7 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1366
1365
  }
1367
1366
  case NEN_FRML:
1368
1367
  {
1369
- if(v == Qnil)
1370
- {
1371
- n->nd_frml = 0;
1372
- }
1373
- else
1374
- {
1375
- VALUE nid = rb_hash_aref(id_hash, v);
1376
- if(RTEST(nid))
1377
- {
1378
- n->nd_frml = id_to_node(nid);
1379
- }
1380
- else
1381
- {
1382
- n->u1.node = (NODE *)load_node_or_iseq_from_hash(
1383
- v, node_hash, id_hash);
1384
- if(nd_type(n->u1.node) == NODE_OP_ASGN2_ARG)
1385
- {
1386
- nd_set_type(n->u1.node, NODE_OP_ASGN2);
1387
- }
1388
- }
1389
- }
1368
+ n->nd_frml = NUM2LONG(v);
1390
1369
  return;
1391
1370
  }
1392
1371
  case NEN_HEAD:
@@ -1414,31 +1393,6 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1414
1393
  }
1415
1394
  return;
1416
1395
  }
1417
- case NEN_IBDY:
1418
- {
1419
- if(v == Qnil)
1420
- {
1421
- n->nd_ibdy = 0;
1422
- }
1423
- else
1424
- {
1425
- VALUE nid = rb_hash_aref(id_hash, v);
1426
- if(RTEST(nid))
1427
- {
1428
- n->nd_ibdy = id_to_node(nid);
1429
- }
1430
- else
1431
- {
1432
- n->u2.node = (NODE *)load_node_or_iseq_from_hash(
1433
- v, node_hash, id_hash);
1434
- if(nd_type(n->u2.node) == NODE_OP_ASGN2_ARG)
1435
- {
1436
- nd_set_type(n->u2.node, NODE_OP_ASGN2);
1437
- }
1438
- }
1439
- }
1440
- return;
1441
- }
1442
1396
  case NEN_ITER:
1443
1397
  {
1444
1398
  if(v == Qnil)
@@ -1466,20 +1420,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1466
1420
  }
1467
1421
  case NEN_LIT:
1468
1422
  {
1423
+ int flags;
1469
1424
  Check_Type(v, T_ARRAY);
1470
1425
  if(RARRAY_LEN(v) != 2)
1471
1426
  {
1472
1427
  rb_raise(rb_eArgError, "wrong size for array");
1473
1428
  }
1474
- int flags = NUM2INT(RARRAY_PTR(v)[0]);
1429
+ flags = NUM2INT(RARRAY_PTR(v)[0]);
1475
1430
  switch(flags & T_MASK)
1476
1431
  {
1477
1432
  case T_CLASS:
1478
1433
  case T_MODULE:
1479
1434
  {
1480
- VALUE str = RARRAY_PTR(v)[1];
1435
+ VALUE str, klass;
1436
+
1437
+ str = RARRAY_PTR(v)[1];
1481
1438
  Check_Type(str, T_STRING);
1482
- VALUE klass = rb_path2class(STR2CSTR(str));
1439
+ klass = rb_path2class(StringValuePtr(str));
1483
1440
  if(flags & FL_SINGLETON)
1484
1441
  {
1485
1442
  *(VALUE *)(&n->nd_lit) =
@@ -1530,22 +1487,6 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1530
1487
  }
1531
1488
  return;
1532
1489
  }
1533
- case NEN_NEW:
1534
- {
1535
- if(v == Qfalse)
1536
- {
1537
- n->nd_new = 0;
1538
- }
1539
- else if(v == Qfalse)
1540
- {
1541
- n->nd_new = 1;
1542
- }
1543
- else
1544
- {
1545
- n->nd_new = SYM2ID(v);
1546
- }
1547
- return;
1548
- }
1549
1490
  case NEN_NEXT:
1550
1491
  {
1551
1492
  if(v == Qnil)
@@ -1581,19 +1522,19 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1581
1522
  n->nd_nth = NUM2LONG(v);
1582
1523
  return;
1583
1524
  }
1584
- case NEN_OLD:
1525
+ case NEN_OID:
1585
1526
  {
1586
1527
  if(v == Qfalse)
1587
1528
  {
1588
- n->nd_old = 0;
1529
+ n->nd_oid = 0;
1589
1530
  }
1590
1531
  else if(v == Qfalse)
1591
1532
  {
1592
- n->nd_old = 1;
1533
+ n->nd_oid = 1;
1593
1534
  }
1594
1535
  else
1595
1536
  {
1596
- n->nd_old = SYM2ID(v);
1537
+ n->nd_oid = SYM2ID(v);
1597
1538
  }
1598
1539
  return;
1599
1540
  }
@@ -1624,20 +1565,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1624
1565
  }
1625
1566
  case NEN_ORIG:
1626
1567
  {
1568
+ int flags;
1627
1569
  Check_Type(v, T_ARRAY);
1628
1570
  if(RARRAY_LEN(v) != 2)
1629
1571
  {
1630
1572
  rb_raise(rb_eArgError, "wrong size for array");
1631
1573
  }
1632
- int flags = NUM2INT(RARRAY_PTR(v)[0]);
1574
+ flags = NUM2INT(RARRAY_PTR(v)[0]);
1633
1575
  switch(flags & T_MASK)
1634
1576
  {
1635
1577
  case T_CLASS:
1636
1578
  case T_MODULE:
1637
1579
  {
1638
- VALUE str = RARRAY_PTR(v)[1];
1580
+ VALUE str, klass;
1581
+
1582
+ str = RARRAY_PTR(v)[1];
1639
1583
  Check_Type(str, T_STRING);
1640
- VALUE klass = rb_path2class(STR2CSTR(str));
1584
+ klass = rb_path2class(StringValuePtr(str));
1641
1585
  if(flags & FL_SINGLETON)
1642
1586
  {
1643
1587
  *(VALUE *)(&n->nd_orig) =
@@ -1656,6 +1600,27 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1656
1600
  }
1657
1601
  return;
1658
1602
  }
1603
+ case NEN_PID:
1604
+ {
1605
+ if(v == Qfalse)
1606
+ {
1607
+ n->nd_pid = 0;
1608
+ }
1609
+ else if(v == Qfalse)
1610
+ {
1611
+ n->nd_pid = 1;
1612
+ }
1613
+ else
1614
+ {
1615
+ n->nd_pid = SYM2ID(v);
1616
+ }
1617
+ return;
1618
+ }
1619
+ case NEN_PLEN:
1620
+ {
1621
+ n->nd_plen = NUM2LONG(v);
1622
+ return;
1623
+ }
1659
1624
  case NEN_RECV:
1660
1625
  {
1661
1626
  if(v == Qnil)
@@ -1708,7 +1673,18 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1708
1673
  }
1709
1674
  case NEN_REST:
1710
1675
  {
1711
- n->nd_rest = NUM2LONG(v);
1676
+ if(v == Qfalse)
1677
+ {
1678
+ n->nd_rest = 0;
1679
+ }
1680
+ else if(v == Qfalse)
1681
+ {
1682
+ n->nd_rest = 1;
1683
+ }
1684
+ else
1685
+ {
1686
+ n->nd_rest = SYM2ID(v);
1687
+ }
1712
1688
  return;
1713
1689
  }
1714
1690
  case NEN_RVAL:
@@ -1844,20 +1820,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1844
1820
  }
1845
1821
  case NEN_TVAL:
1846
1822
  {
1823
+ int flags;
1847
1824
  Check_Type(v, T_ARRAY);
1848
1825
  if(RARRAY_LEN(v) != 2)
1849
1826
  {
1850
1827
  rb_raise(rb_eArgError, "wrong size for array");
1851
1828
  }
1852
- int flags = NUM2INT(RARRAY_PTR(v)[0]);
1829
+ flags = NUM2INT(RARRAY_PTR(v)[0]);
1853
1830
  switch(flags & T_MASK)
1854
1831
  {
1855
1832
  case T_CLASS:
1856
1833
  case T_MODULE:
1857
1834
  {
1858
- VALUE str = RARRAY_PTR(v)[1];
1835
+ VALUE str, klass;
1836
+
1837
+ str = RARRAY_PTR(v)[1];
1859
1838
  Check_Type(str, T_STRING);
1860
- VALUE klass = rb_path2class(STR2CSTR(str));
1839
+ klass = rb_path2class(StringValuePtr(str));
1861
1840
  if(flags & FL_SINGLETON)
1862
1841
  {
1863
1842
  *(VALUE *)(&n->nd_tval) =
@@ -1942,6 +1921,11 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
1942
1921
  }
1943
1922
  return;
1944
1923
  }
1924
+ case NEN_VISI:
1925
+ {
1926
+ n->nd_visi = NUM2LONG(v);
1927
+ return;
1928
+ }
1945
1929
  }
1946
1930
  rb_raise(rb_eRuntimeError, "Internal error: invalid Node_Elem_Name %d", nen);
1947
1931
  }
@@ -2031,16 +2015,6 @@ static VALUE node_alen(VALUE self)
2031
2015
  Data_Get_Struct(self, NODE, n);
2032
2016
  return LONG2NUM(n->nd_alen);
2033
2017
  }
2034
- /*
2035
- * Return the Node's _argc_ member. The return type is an
2036
- * Integer.
2037
- */
2038
- static VALUE node_argc(VALUE self)
2039
- {
2040
- NODE * n;
2041
- Data_Get_Struct(self, NODE, n);
2042
- return LONG2NUM(n->nd_argc);
2043
- }
2044
2018
  /*
2045
2019
  * Return the Node's _args_ member. The return type is
2046
2020
  * either a Node or an Object.
@@ -2138,54 +2112,6 @@ static VALUE node_cfnc(VALUE self)
2138
2112
  Data_Get_Struct(self, NODE, n);
2139
2113
  return LONG2NUM((long)(n->nd_cfnc));
2140
2114
  }
2141
- /*
2142
- * Return the Node's _clss_ member. The return type is
2143
- * either a Node or an Object.
2144
- */
2145
- static VALUE node_clss(VALUE self)
2146
- {
2147
- NODE * n;
2148
- Data_Get_Struct(self, NODE, n);
2149
-
2150
- if(TYPE(n->nd_clss) == T_NODE)
2151
- {
2152
- if(0 && nd_type(n) == NODE_OP_ASGN2)
2153
- {
2154
- return wrap_node_as(
2155
- (NODE *)n->nd_clss,
2156
- rb_cNodeSubclass[NODE_OP_ASGN2_ARG]);
2157
- }
2158
- else
2159
- {
2160
- return wrap_node((NODE *)n->nd_clss);
2161
- }
2162
- }
2163
- else
2164
- {
2165
- return (VALUE)n->nd_clss;
2166
- }
2167
- }
2168
- /*
2169
- * Return the Node's _cname_ member. The return type is a
2170
- * Symbol.
2171
- */
2172
- static VALUE node_cname(VALUE self)
2173
- {
2174
- NODE * n;
2175
- Data_Get_Struct(self, NODE, n);
2176
- if(n->nd_cname == 0)
2177
- {
2178
- return Qfalse;
2179
- }
2180
- else if(n->nd_cname == 1)
2181
- {
2182
- return Qtrue;
2183
- }
2184
- else
2185
- {
2186
- return ID2SYM(n->nd_cname);
2187
- }
2188
- }
2189
2115
  /*
2190
2116
  * Return the Node's _cnt_ member. The return type is an
2191
2117
  * Integer.
@@ -2224,10 +2150,37 @@ static VALUE node_cond(VALUE self)
2224
2150
  }
2225
2151
  }
2226
2152
  /*
2227
- * Return the Node's _cval_ member. The return type is
2153
+ * Return the Node's _cpath_ member. The return type is
2228
2154
  * either a Node or an Object.
2229
2155
  */
2230
- static VALUE node_cval(VALUE self)
2156
+ static VALUE node_cpath(VALUE self)
2157
+ {
2158
+ NODE * n;
2159
+ Data_Get_Struct(self, NODE, n);
2160
+
2161
+ if(TYPE(n->nd_cpath) == T_NODE)
2162
+ {
2163
+ if(0 && nd_type(n) == NODE_OP_ASGN2)
2164
+ {
2165
+ return wrap_node_as(
2166
+ (NODE *)n->nd_cpath,
2167
+ rb_cNodeSubclass[NODE_OP_ASGN2_ARG]);
2168
+ }
2169
+ else
2170
+ {
2171
+ return wrap_node((NODE *)n->nd_cpath);
2172
+ }
2173
+ }
2174
+ else
2175
+ {
2176
+ return (VALUE)n->nd_cpath;
2177
+ }
2178
+ }
2179
+ /*
2180
+ * Return the Node's _cval_ member. The return type is
2181
+ * either a Node or an Object.
2182
+ */
2183
+ static VALUE node_cval(VALUE self)
2231
2184
  {
2232
2185
  NODE * n;
2233
2186
  Data_Get_Struct(self, NODE, n);
@@ -2551,33 +2504,6 @@ static VALUE node_opt(VALUE self)
2551
2504
  return (VALUE)n->nd_opt;
2552
2505
  }
2553
2506
  }
2554
- /*
2555
- * Return the Node's _orig_ member. The return type is
2556
- * either a Node or an Object.
2557
- */
2558
- static VALUE node_orig(VALUE self)
2559
- {
2560
- NODE * n;
2561
- Data_Get_Struct(self, NODE, n);
2562
-
2563
- if(TYPE(n->nd_orig) == T_NODE)
2564
- {
2565
- if(0 && nd_type(n) == NODE_OP_ASGN2)
2566
- {
2567
- return wrap_node_as(
2568
- (NODE *)n->nd_orig,
2569
- rb_cNodeSubclass[NODE_OP_ASGN2_ARG]);
2570
- }
2571
- else
2572
- {
2573
- return wrap_node((NODE *)n->nd_orig);
2574
- }
2575
- }
2576
- else
2577
- {
2578
- return (VALUE)n->nd_orig;
2579
- }
2580
- }
2581
2507
  /*
2582
2508
  * Return the Node's _recv_ member. The return type is
2583
2509
  * either a Node or an Object.
@@ -2633,14 +2559,25 @@ static VALUE node_resq(VALUE self)
2633
2559
  }
2634
2560
  }
2635
2561
  /*
2636
- * Return the Node's _rest_ member. The return type is an
2637
- * Integer.
2562
+ * Return the Node's _rest_ member. The return type is a
2563
+ * Symbol.
2638
2564
  */
2639
2565
  static VALUE node_rest(VALUE self)
2640
2566
  {
2641
2567
  NODE * n;
2642
2568
  Data_Get_Struct(self, NODE, n);
2643
- return LONG2NUM(n->nd_rest);
2569
+ if(n->nd_rest == 0)
2570
+ {
2571
+ return Qfalse;
2572
+ }
2573
+ else if(n->nd_rest == 1)
2574
+ {
2575
+ return Qtrue;
2576
+ }
2577
+ else
2578
+ {
2579
+ return ID2SYM(n->nd_rest);
2580
+ }
2644
2581
  }
2645
2582
  /*
2646
2583
  * Return the Node's _rval_ member. The return type is
@@ -2885,10 +2822,10 @@ void define_node_subclass_methods()
2885
2822
  rb_iv_set(rb_cALIAS, "__member__", members);
2886
2823
  rb_iv_set(rb_cALIAS, "__type__", INT2NUM(NODE_ALIAS));
2887
2824
  rb_define_singleton_method(rb_cALIAS, "members", node_s_members, 0);
2888
- rb_define_method(rb_cALIAS, "first", node_1st, 0);
2889
- rb_ary_push(members, rb_str_new2("first"));
2890
2825
  rb_define_method(rb_cALIAS, "second", node_2nd, 0);
2891
2826
  rb_ary_push(members, rb_str_new2("second"));
2827
+ rb_define_method(rb_cALIAS, "first", node_1st, 0);
2828
+ rb_ary_push(members, rb_str_new2("first"));
2892
2829
  }
2893
2830
 
2894
2831
  /* Document-class: Node::ALLOCA
@@ -2912,17 +2849,17 @@ void define_node_subclass_methods()
2912
2849
  rb_define_method(rb_cALLOCA, "cfnc", node_cfnc, 0);
2913
2850
  rb_ary_push(members, rb_str_new2("cfnc"));
2914
2851
 
2915
- /* Document-method: value
2916
- * a pointer to the previously allocated temporary node
2917
- */
2918
- rb_define_method(rb_cALLOCA, "value", node_value, 0);
2919
- rb_ary_push(members, rb_str_new2("value"));
2920
-
2921
2852
  /* Document-method: cnt
2922
2853
  * the number of bytes allocated
2923
2854
  */
2924
2855
  rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
2925
2856
  rb_ary_push(members, rb_str_new2("cnt"));
2857
+
2858
+ /* Document-method: value
2859
+ * a pointer to the previously allocated temporary node
2860
+ */
2861
+ rb_define_method(rb_cALLOCA, "value", node_value, 0);
2862
+ rb_ary_push(members, rb_str_new2("value"));
2926
2863
  }
2927
2864
  #endif
2928
2865
 
@@ -2941,17 +2878,17 @@ void define_node_subclass_methods()
2941
2878
  rb_iv_set(rb_cAND, "__type__", INT2NUM(NODE_AND));
2942
2879
  rb_define_singleton_method(rb_cAND, "members", node_s_members, 0);
2943
2880
 
2944
- /* Document-method: first
2945
- * the expression on the left hand side
2946
- */
2947
- rb_define_method(rb_cAND, "first", node_1st, 0);
2948
- rb_ary_push(members, rb_str_new2("first"));
2949
-
2950
2881
  /* Document-method: second
2951
2882
  * the expression on the right hand side
2952
2883
  */
2953
2884
  rb_define_method(rb_cAND, "second", node_2nd, 0);
2954
2885
  rb_ary_push(members, rb_str_new2("second"));
2886
+
2887
+ /* Document-method: first
2888
+ * the expression on the left hand side
2889
+ */
2890
+ rb_define_method(rb_cAND, "first", node_1st, 0);
2891
+ rb_ary_push(members, rb_str_new2("first"));
2955
2892
  }
2956
2893
 
2957
2894
  /* Document-class: Node::ARGS
@@ -2965,12 +2902,6 @@ void define_node_subclass_methods()
2965
2902
  rb_iv_set(rb_cARGS, "__type__", INT2NUM(NODE_ARGS));
2966
2903
  rb_define_singleton_method(rb_cARGS, "members", node_s_members, 0);
2967
2904
 
2968
- /* Document-method: rest
2969
- * an assignment node to assign the rest arg, if it is present
2970
- */
2971
- rb_define_method(rb_cARGS, "rest", node_rest, 0);
2972
- rb_ary_push(members, rb_str_new2("rest"));
2973
-
2974
2905
  /* Document-method: opt
2975
2906
  * a list of assignment nodes to assign default values to the
2976
2907
  * optional arguments if no argument is specified
@@ -2978,6 +2909,12 @@ void define_node_subclass_methods()
2978
2909
  rb_define_method(rb_cARGS, "opt", node_opt, 0);
2979
2910
  rb_ary_push(members, rb_str_new2("opt"));
2980
2911
 
2912
+ /* Document-method: rest
2913
+ * an assignment node to assign the rest arg, if it is present
2914
+ */
2915
+ rb_define_method(rb_cARGS, "rest", node_rest, 0);
2916
+ rb_ary_push(members, rb_str_new2("rest"));
2917
+
2981
2918
  /* Document-method: cnt
2982
2919
  * the number of required arguments
2983
2920
  */
@@ -3049,6 +2986,12 @@ void define_node_subclass_methods()
3049
2986
  rb_iv_set(rb_cARRAY, "__type__", INT2NUM(NODE_ARRAY));
3050
2987
  rb_define_singleton_method(rb_cARRAY, "members", node_s_members, 0);
3051
2988
 
2989
+ /* Document-method: next
2990
+ * the tail of the array
2991
+ */
2992
+ rb_define_method(rb_cARRAY, "next", node_next, 0);
2993
+ rb_ary_push(members, rb_str_new2("next"));
2994
+
3052
2995
  /* Document-method: head
3053
2996
  * the first element of the array
3054
2997
  */
@@ -3056,33 +2999,39 @@ void define_node_subclass_methods()
3056
2999
  rb_ary_push(members, rb_str_new2("head"));
3057
3000
  rb_define_method(rb_cARRAY, "alen", node_alen, 0);
3058
3001
  rb_ary_push(members, rb_str_new2("alen"));
3059
-
3060
- /* Document-method: next
3061
- * the tail of the array
3062
- */
3063
- rb_define_method(rb_cARRAY, "next", node_next, 0);
3064
- rb_ary_push(members, rb_str_new2("next"));
3065
3002
  }
3066
3003
 
3067
- /* Document-class: Node::ATTRSET
3068
- * A placeholder for an attribute writer method, which can added to a
3069
- * class by using attr_writer:
3070
- * attr_writer :attribute
3071
- * Its reader counterpart is IVAR.
3004
+ /* Document-class: Node::ATTRASGN
3005
+ * Represents attribute assignment in the form:
3006
+ * recv.mid = args
3007
+ * or:
3008
+ * recv.mid=(args).
3072
3009
  */
3073
3010
  {
3074
- VALUE rb_cATTRSET = rb_define_class_under(rb_cNode, "ATTRSET", rb_cNode);
3011
+ VALUE rb_cATTRASGN = rb_define_class_under(rb_cNode, "ATTRASGN", rb_cNode);
3075
3012
  members = rb_ary_new();
3076
- rb_cNodeSubclass[NODE_ATTRSET] = rb_cATTRSET;
3077
- rb_iv_set(rb_cATTRSET, "__member__", members);
3078
- rb_iv_set(rb_cATTRSET, "__type__", INT2NUM(NODE_ATTRSET));
3079
- rb_define_singleton_method(rb_cATTRSET, "members", node_s_members, 0);
3013
+ rb_cNodeSubclass[NODE_ATTRASGN] = rb_cATTRASGN;
3014
+ rb_iv_set(rb_cATTRASGN, "__member__", members);
3015
+ rb_iv_set(rb_cATTRASGN, "__type__", INT2NUM(NODE_ATTRASGN));
3016
+ rb_define_singleton_method(rb_cATTRASGN, "members", node_s_members, 0);
3080
3017
 
3081
- /* Document-method: vid
3082
- * the name of the attribute, with a leading '@' sign
3018
+ /* Document-method: args
3019
+ * the arguments to the method
3083
3020
  */
3084
- rb_define_method(rb_cATTRSET, "vid", node_vid, 0);
3085
- rb_ary_push(members, rb_str_new2("vid"));
3021
+ rb_define_method(rb_cATTRASGN, "args", node_args, 0);
3022
+ rb_ary_push(members, rb_str_new2("args"));
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
+ /* Document-method: recv
3031
+ * the receiver of the method
3032
+ */
3033
+ rb_define_method(rb_cATTRASGN, "recv", node_recv, 0);
3034
+ rb_ary_push(members, rb_str_new2("recv"));
3086
3035
  }
3087
3036
 
3088
3037
  /* Document-class: Node::BACK_REF
@@ -3149,17 +3098,17 @@ void define_node_subclass_methods()
3149
3098
  rb_iv_set(rb_cBLOCK, "__type__", INT2NUM(NODE_BLOCK));
3150
3099
  rb_define_singleton_method(rb_cBLOCK, "members", node_s_members, 0);
3151
3100
 
3152
- /* Document-method: head
3153
- * the first expression in the block of code
3154
- */
3155
- rb_define_method(rb_cBLOCK, "head", node_head, 0);
3156
- rb_ary_push(members, rb_str_new2("head"));
3157
-
3158
3101
  /* Document-method: next
3159
3102
  * the second expression in the block of code
3160
3103
  */
3161
3104
  rb_define_method(rb_cBLOCK, "next", node_next, 0);
3162
3105
  rb_ary_push(members, rb_str_new2("next"));
3106
+
3107
+ /* Document-method: head
3108
+ * the first expression in the block of code
3109
+ */
3110
+ rb_define_method(rb_cBLOCK, "head", node_head, 0);
3111
+ rb_ary_push(members, rb_str_new2("head"));
3163
3112
  }
3164
3113
 
3165
3114
  /* Document-class: Node::BLOCK_ARG
@@ -3200,17 +3149,17 @@ void define_node_subclass_methods()
3200
3149
  rb_iv_set(rb_cBLOCK_PASS, "__type__", INT2NUM(NODE_BLOCK_PASS));
3201
3150
  rb_define_singleton_method(rb_cBLOCK_PASS, "members", node_s_members, 0);
3202
3151
 
3203
- /* Document-method: body
3204
- * the object to pass as a block
3205
- */
3206
- rb_define_method(rb_cBLOCK_PASS, "body", node_body, 0);
3207
- rb_ary_push(members, rb_str_new2("body"));
3208
-
3209
3152
  /* Document-method: iter
3210
3153
  * an expression which calls a method
3211
3154
  */
3212
3155
  rb_define_method(rb_cBLOCK_PASS, "iter", node_iter, 0);
3213
3156
  rb_ary_push(members, rb_str_new2("iter"));
3157
+
3158
+ /* Document-method: body
3159
+ * the object to pass as a block
3160
+ */
3161
+ rb_define_method(rb_cBLOCK_PASS, "body", node_body, 0);
3162
+ rb_ary_push(members, rb_str_new2("body"));
3214
3163
  }
3215
3164
 
3216
3165
  /* Document-class: Node::BMETHOD
@@ -3300,6 +3249,8 @@ void define_node_subclass_methods()
3300
3249
  rb_iv_set(rb_cCASE, "__member__", members);
3301
3250
  rb_iv_set(rb_cCASE, "__type__", INT2NUM(NODE_CASE));
3302
3251
  rb_define_singleton_method(rb_cCASE, "members", node_s_members, 0);
3252
+ rb_define_method(rb_cCASE, "next", node_next, 0);
3253
+ rb_ary_push(members, rb_str_new2("next"));
3303
3254
 
3304
3255
  /* Document-method: head
3305
3256
  * the value to select on
@@ -3313,8 +3264,6 @@ void define_node_subclass_methods()
3313
3264
  */
3314
3265
  rb_define_method(rb_cCASE, "body", node_body, 0);
3315
3266
  rb_ary_push(members, rb_str_new2("body"));
3316
- rb_define_method(rb_cCASE, "next", node_next, 0);
3317
- rb_ary_push(members, rb_str_new2("next"));
3318
3267
  }
3319
3268
 
3320
3269
  /* Document-class: Node::CDECL
@@ -3329,43 +3278,27 @@ void define_node_subclass_methods()
3329
3278
  rb_iv_set(rb_cCDECL, "__type__", INT2NUM(NODE_CDECL));
3330
3279
  rb_define_singleton_method(rb_cCDECL, "members", node_s_members, 0);
3331
3280
 
3332
- /* Document-method: value
3333
- * the value to be assigned to the constant
3334
- */
3335
- rb_define_method(rb_cCDECL, "value", node_value, 0);
3336
- rb_ary_push(members, rb_str_new2("value"));
3337
-
3338
3281
  /* Document-method: vid
3339
3282
  * the name of the constant to be assigned, all uppercase
3340
3283
  */
3341
3284
  rb_define_method(rb_cCDECL, "vid", node_vid, 0);
3342
3285
  rb_ary_push(members, rb_str_new2("vid"));
3343
- }
3344
3286
 
3345
- /* Document-class: Node::CFUNC
3346
- * A placeholder for a function implemented in C.
3347
- */
3348
- {
3349
- VALUE rb_cCFUNC = rb_define_class_under(rb_cNode, "CFUNC", rb_cNode);
3350
- members = rb_ary_new();
3351
- rb_cNodeSubclass[NODE_CFUNC] = rb_cCFUNC;
3352
- rb_iv_set(rb_cCFUNC, "__member__", members);
3353
- rb_iv_set(rb_cCFUNC, "__type__", INT2NUM(NODE_CFUNC));
3354
- rb_define_singleton_method(rb_cCFUNC, "members", node_s_members, 0);
3355
- rb_define_method(rb_cCFUNC, "cfnc", node_cfnc, 0);
3356
- rb_ary_push(members, rb_str_new2("cfnc"));
3357
- rb_define_method(rb_cCFUNC, "argc", node_argc, 0);
3358
- rb_ary_push(members, rb_str_new2("argc"));
3287
+ /* Document-method: value
3288
+ * the value to be assigned to the constant
3289
+ */
3290
+ rb_define_method(rb_cCDECL, "value", node_value, 0);
3291
+ rb_ary_push(members, rb_str_new2("value"));
3359
3292
  }
3360
3293
 
3361
3294
  /* Document-class: Node::CLASS
3362
3295
  * Represents a class definition, e.g.:
3363
- * class cname
3296
+ * class cpath
3364
3297
  * body
3365
3298
  * end
3366
3299
  *
3367
3300
  * or:
3368
- * class cname < super
3301
+ * class cpath < super
3369
3302
  * body
3370
3303
  * end
3371
3304
  *
@@ -3382,24 +3315,24 @@ void define_node_subclass_methods()
3382
3315
  rb_iv_set(rb_cCLASS, "__type__", INT2NUM(NODE_CLASS));
3383
3316
  rb_define_singleton_method(rb_cCLASS, "members", node_s_members, 0);
3384
3317
 
3385
- /* Document-method: body
3386
- * the body of the class definition
3387
- */
3388
- rb_define_method(rb_cCLASS, "body", node_body, 0);
3389
- rb_ary_push(members, rb_str_new2("body"));
3390
-
3391
- /* Document-method: cname
3392
- * the name of the class to define
3393
- */
3394
- rb_define_method(rb_cCLASS, "cname", node_cname, 0);
3395
- rb_ary_push(members, rb_str_new2("cname"));
3396
-
3397
3318
  /* Document-method: super
3398
3319
  * an expression returning the base class, or false if there is no
3399
3320
  * base class specified
3400
3321
  */
3401
3322
  rb_define_method(rb_cCLASS, "super", node_super, 0);
3402
3323
  rb_ary_push(members, rb_str_new2("super"));
3324
+
3325
+ /* Document-method: cpath
3326
+ * the name of the class to define
3327
+ */
3328
+ rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
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"));
3403
3336
  }
3404
3337
 
3405
3338
  /* Document-class: Node::COLON2
@@ -3471,41 +3404,6 @@ void define_node_subclass_methods()
3471
3404
  rb_ary_push(members, rb_str_new2("vid"));
3472
3405
  }
3473
3406
 
3474
- /* Document-class: Node::CREF
3475
- * A temporary node used to store the value of ruby_cref or
3476
- * ruby_top_cref and later restore it. The cref holds a reference to
3477
- * the cbase, which, among other things, is used for constant and class
3478
- * variable lookup.
3479
- *
3480
- * It should never be evaluated as an expression.
3481
- */
3482
- {
3483
- VALUE rb_cCREF = rb_define_class_under(rb_cNode, "CREF", rb_cNode);
3484
- members = rb_ary_new();
3485
- rb_cNodeSubclass[NODE_CREF] = rb_cCREF;
3486
- rb_iv_set(rb_cCREF, "__member__", members);
3487
- rb_iv_set(rb_cCREF, "__type__", INT2NUM(NODE_CREF));
3488
- rb_define_singleton_method(rb_cCREF, "members", node_s_members, 0);
3489
-
3490
- /* Document-method: body
3491
- * always 0 (false)
3492
- */
3493
- rb_define_method(rb_cCREF, "body", node_body, 0);
3494
- rb_ary_push(members, rb_str_new2("body"));
3495
-
3496
- /* Document-method: next
3497
- * the previous value of ruby_cref or ruby_top_cref
3498
- */
3499
- rb_define_method(rb_cCREF, "next", node_next, 0);
3500
- rb_ary_push(members, rb_str_new2("next"));
3501
-
3502
- /* Document-method: clss
3503
- * the new class to use for the cbase.
3504
- */
3505
- rb_define_method(rb_cCREF, "clss", node_clss, 0);
3506
- rb_ary_push(members, rb_str_new2("clss"));
3507
- }
3508
-
3509
3407
  /* Document-class: Node::CVAR
3510
3408
  * Represents a class variable retrieval. The result of the expression
3511
3409
  * is the value of the class variable.
@@ -3536,18 +3434,18 @@ void define_node_subclass_methods()
3536
3434
  rb_iv_set(rb_cCVASGN, "__type__", INT2NUM(NODE_CVASGN));
3537
3435
  rb_define_singleton_method(rb_cCVASGN, "members", node_s_members, 0);
3538
3436
 
3437
+ /* Document-method: vid
3438
+ * the name of the class variable to assign
3439
+ */
3440
+ rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
3441
+ rb_ary_push(members, rb_str_new2("vid"));
3442
+
3539
3443
  /* Document-method: value
3540
3444
  * an expression whose result is the new value of the class
3541
3445
  * variable
3542
3446
  */
3543
3447
  rb_define_method(rb_cCVASGN, "value", node_value, 0);
3544
3448
  rb_ary_push(members, rb_str_new2("value"));
3545
-
3546
- /* Document-method: vid
3547
- * the name of the class variable to assign
3548
- */
3549
- rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
3550
- rb_ary_push(members, rb_str_new2("vid"));
3551
3449
  }
3552
3450
 
3553
3451
  /* Document-class: Node::CVDECL
@@ -3563,18 +3461,18 @@ void define_node_subclass_methods()
3563
3461
  rb_iv_set(rb_cCVDECL, "__type__", INT2NUM(NODE_CVDECL));
3564
3462
  rb_define_singleton_method(rb_cCVDECL, "members", node_s_members, 0);
3565
3463
 
3464
+ /* Document-method: vid
3465
+ * the name of the class variable to assign
3466
+ */
3467
+ rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
3468
+ rb_ary_push(members, rb_str_new2("vid"));
3469
+
3566
3470
  /* Document-method: value
3567
3471
  * an expression whose result is the new value of the class
3568
3472
  * variable
3569
3473
  */
3570
3474
  rb_define_method(rb_cCVDECL, "value", node_value, 0);
3571
3475
  rb_ary_push(members, rb_str_new2("value"));
3572
-
3573
- /* Document-method: vid
3574
- * the name of the class variable to assign
3575
- */
3576
- rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
3577
- rb_ary_push(members, rb_str_new2("vid"));
3578
3476
  }
3579
3477
 
3580
3478
  /* Document-class: Node::DASGN
@@ -3597,17 +3495,17 @@ void define_node_subclass_methods()
3597
3495
  rb_iv_set(rb_cDASGN, "__type__", INT2NUM(NODE_DASGN));
3598
3496
  rb_define_singleton_method(rb_cDASGN, "members", node_s_members, 0);
3599
3497
 
3600
- /* Document-method: value
3601
- * the value to assign to the local variable
3602
- */
3603
- rb_define_method(rb_cDASGN, "value", node_value, 0);
3604
- rb_ary_push(members, rb_str_new2("value"));
3605
-
3606
3498
  /* Document-method: vid
3607
3499
  * the name of the local variable
3608
3500
  */
3609
3501
  rb_define_method(rb_cDASGN, "vid", node_vid, 0);
3610
3502
  rb_ary_push(members, rb_str_new2("vid"));
3503
+
3504
+ /* Document-method: value
3505
+ * the value to assign to the local variable
3506
+ */
3507
+ rb_define_method(rb_cDASGN, "value", node_value, 0);
3508
+ rb_ary_push(members, rb_str_new2("value"));
3611
3509
  }
3612
3510
 
3613
3511
  /* Document-class: Node::DASGN_CURR
@@ -3622,17 +3520,17 @@ void define_node_subclass_methods()
3622
3520
  rb_iv_set(rb_cDASGN_CURR, "__type__", INT2NUM(NODE_DASGN_CURR));
3623
3521
  rb_define_singleton_method(rb_cDASGN_CURR, "members", node_s_members, 0);
3624
3522
 
3625
- /* Document-method: value
3626
- * the value to assign to the local variable
3627
- */
3628
- rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
3629
- rb_ary_push(members, rb_str_new2("value"));
3630
-
3631
3523
  /* Document-method: vid
3632
3524
  * the name of the local variable
3633
3525
  */
3634
3526
  rb_define_method(rb_cDASGN_CURR, "vid", node_vid, 0);
3635
3527
  rb_ary_push(members, rb_str_new2("vid"));
3528
+
3529
+ /* Document-method: value
3530
+ * the value to assign to the local variable
3531
+ */
3532
+ rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
3533
+ rb_ary_push(members, rb_str_new2("value"));
3636
3534
  }
3637
3535
 
3638
3536
  /* Document-class: Node::DEFINED
@@ -3668,6 +3566,12 @@ void define_node_subclass_methods()
3668
3566
  rb_iv_set(rb_cDEFN, "__type__", INT2NUM(NODE_DEFN));
3669
3567
  rb_define_singleton_method(rb_cDEFN, "members", node_s_members, 0);
3670
3568
 
3569
+ /* Document-method: noex
3570
+ * the flags which should be used to define the method
3571
+ */
3572
+ rb_define_method(rb_cDEFN, "noex", node_noex, 0);
3573
+ rb_ary_push(members, rb_str_new2("noex"));
3574
+
3671
3575
  /* Document-method: defn
3672
3576
  * the body of the method definition
3673
3577
  */
@@ -3679,12 +3583,6 @@ void define_node_subclass_methods()
3679
3583
  */
3680
3584
  rb_define_method(rb_cDEFN, "mid", node_mid, 0);
3681
3585
  rb_ary_push(members, rb_str_new2("mid"));
3682
-
3683
- /* Document-method: noex
3684
- * the flags which should be used to define the method
3685
- */
3686
- rb_define_method(rb_cDEFN, "noex", node_noex, 0);
3687
- rb_ary_push(members, rb_str_new2("noex"));
3688
3586
  }
3689
3587
 
3690
3588
  /* Document-class: Node::DEFS
@@ -3716,29 +3614,6 @@ void define_node_subclass_methods()
3716
3614
  rb_ary_push(members, rb_str_new2("recv"));
3717
3615
  }
3718
3616
 
3719
- /* Document-class: Node::DMETHOD
3720
- * A placeholder for a method defined using define_method where the
3721
- * passed block is created from a Method object, e.g.:
3722
- * define_method(:name, method(:foo))
3723
- *
3724
- * See also BMETHOD.
3725
- */
3726
- {
3727
- VALUE rb_cDMETHOD = rb_define_class_under(rb_cNode, "DMETHOD", rb_cNode);
3728
- members = rb_ary_new();
3729
- rb_cNodeSubclass[NODE_DMETHOD] = rb_cDMETHOD;
3730
- rb_iv_set(rb_cDMETHOD, "__member__", members);
3731
- rb_iv_set(rb_cDMETHOD, "__type__", INT2NUM(NODE_DMETHOD));
3732
- rb_define_singleton_method(rb_cDMETHOD, "members", node_s_members, 0);
3733
-
3734
- /* Document-method: cval
3735
- * the Method object passed to define_method, which contains the
3736
- * body of the method
3737
- */
3738
- rb_define_method(rb_cDMETHOD, "cval", node_cval, 0);
3739
- rb_ary_push(members, rb_str_new2("cval"));
3740
- }
3741
-
3742
3617
  /* Document-class: Node::DOT2
3743
3618
  * Represents a range created with the form:
3744
3619
  * beg..end
@@ -3751,6 +3626,8 @@ void define_node_subclass_methods()
3751
3626
  rb_iv_set(rb_cDOT2, "__member__", members);
3752
3627
  rb_iv_set(rb_cDOT2, "__type__", INT2NUM(NODE_DOT2));
3753
3628
  rb_define_singleton_method(rb_cDOT2, "members", node_s_members, 0);
3629
+ rb_define_method(rb_cDOT2, "state", node_state, 0);
3630
+ rb_ary_push(members, rb_str_new2("state"));
3754
3631
 
3755
3632
  /* Document-method: beg
3756
3633
  * the beginning of the range
@@ -3763,8 +3640,6 @@ void define_node_subclass_methods()
3763
3640
  */
3764
3641
  rb_define_method(rb_cDOT2, "end", node_end, 0);
3765
3642
  rb_ary_push(members, rb_str_new2("end"));
3766
- rb_define_method(rb_cDOT2, "state", node_state, 0);
3767
- rb_ary_push(members, rb_str_new2("state"));
3768
3643
  }
3769
3644
 
3770
3645
  /* Document-class: Node::DOT3
@@ -3779,6 +3654,8 @@ void define_node_subclass_methods()
3779
3654
  rb_iv_set(rb_cDOT3, "__member__", members);
3780
3655
  rb_iv_set(rb_cDOT3, "__type__", INT2NUM(NODE_DOT3));
3781
3656
  rb_define_singleton_method(rb_cDOT3, "members", node_s_members, 0);
3657
+ rb_define_method(rb_cDOT3, "state", node_state, 0);
3658
+ rb_ary_push(members, rb_str_new2("state"));
3782
3659
 
3783
3660
  /* Document-method: beg
3784
3661
  * the beginning of the range
@@ -3791,8 +3668,6 @@ void define_node_subclass_methods()
3791
3668
  */
3792
3669
  rb_define_method(rb_cDOT3, "end", node_end, 0);
3793
3670
  rb_ary_push(members, rb_str_new2("end"));
3794
- rb_define_method(rb_cDOT3, "state", node_state, 0);
3795
- rb_ary_push(members, rb_str_new2("state"));
3796
3671
  }
3797
3672
 
3798
3673
  /* Document-class: Node::DREGX
@@ -3811,11 +3686,11 @@ void define_node_subclass_methods()
3811
3686
  rb_iv_set(rb_cDREGX, "__type__", INT2NUM(NODE_DREGX));
3812
3687
  rb_define_singleton_method(rb_cDREGX, "members", node_s_members, 0);
3813
3688
 
3814
- /* Document-method: lit
3815
- * a string
3689
+ /* Document-method: next
3690
+ * a list of expressions to be appended onto the string
3816
3691
  */
3817
- rb_define_method(rb_cDREGX, "lit", node_lit, 0);
3818
- rb_ary_push(members, rb_str_new2("lit"));
3692
+ rb_define_method(rb_cDREGX, "next", node_next, 0);
3693
+ rb_ary_push(members, rb_str_new2("next"));
3819
3694
 
3820
3695
  /* Document-method: cflag
3821
3696
  * a bitfield containing the options used in the regular
@@ -3834,11 +3709,11 @@ void define_node_subclass_methods()
3834
3709
  rb_define_method(rb_cDREGX, "cflag", node_cflag, 0);
3835
3710
  rb_ary_push(members, rb_str_new2("cflag"));
3836
3711
 
3837
- /* Document-method: next
3838
- * a list of expressions to be appended onto the string
3712
+ /* Document-method: lit
3713
+ * a string
3839
3714
  */
3840
- rb_define_method(rb_cDREGX, "next", node_next, 0);
3841
- rb_ary_push(members, rb_str_new2("next"));
3715
+ rb_define_method(rb_cDREGX, "lit", node_lit, 0);
3716
+ rb_ary_push(members, rb_str_new2("lit"));
3842
3717
  }
3843
3718
 
3844
3719
  /* Document-class: Node::DREGX_ONCE
@@ -3854,11 +3729,11 @@ void define_node_subclass_methods()
3854
3729
  rb_iv_set(rb_cDREGX_ONCE, "__type__", INT2NUM(NODE_DREGX_ONCE));
3855
3730
  rb_define_singleton_method(rb_cDREGX_ONCE, "members", node_s_members, 0);
3856
3731
 
3857
- /* Document-method: lit
3858
- * a string
3732
+ /* Document-method: next
3733
+ * a list of expressions to be appended onto the string
3859
3734
  */
3860
- rb_define_method(rb_cDREGX_ONCE, "lit", node_lit, 0);
3861
- rb_ary_push(members, rb_str_new2("lit"));
3735
+ rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
3736
+ rb_ary_push(members, rb_str_new2("next"));
3862
3737
 
3863
3738
  /* Document-method: cflag
3864
3739
  * a bitfield containing the options used in the regular
@@ -3867,11 +3742,11 @@ void define_node_subclass_methods()
3867
3742
  rb_define_method(rb_cDREGX_ONCE, "cflag", node_cflag, 0);
3868
3743
  rb_ary_push(members, rb_str_new2("cflag"));
3869
3744
 
3870
- /* Document-method: next
3871
- * a list of expressions to be appended onto the string
3745
+ /* Document-method: lit
3746
+ * a string
3872
3747
  */
3873
- rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
3874
- rb_ary_push(members, rb_str_new2("next"));
3748
+ rb_define_method(rb_cDREGX_ONCE, "lit", node_lit, 0);
3749
+ rb_ary_push(members, rb_str_new2("lit"));
3875
3750
  }
3876
3751
 
3877
3752
  /* Document-class: Node::DSTR
@@ -3890,17 +3765,41 @@ void define_node_subclass_methods()
3890
3765
  rb_iv_set(rb_cDSTR, "__type__", INT2NUM(NODE_DSTR));
3891
3766
  rb_define_singleton_method(rb_cDSTR, "members", node_s_members, 0);
3892
3767
 
3768
+ /* Document-method: next
3769
+ * a list of expressions to be appended onto the string
3770
+ */
3771
+ rb_define_method(rb_cDSTR, "next", node_next, 0);
3772
+ rb_ary_push(members, rb_str_new2("next"));
3773
+
3893
3774
  /* Document-method: lit
3894
3775
  * a string
3895
3776
  */
3896
3777
  rb_define_method(rb_cDSTR, "lit", node_lit, 0);
3897
3778
  rb_ary_push(members, rb_str_new2("lit"));
3779
+ }
3898
3780
 
3899
- /* Document-method: next
3900
- * a list of expressions to be appended onto the string
3901
- */
3902
- rb_define_method(rb_cDSTR, "next", node_next, 0);
3781
+ /* Document-class: Node::DSYM
3782
+ * Represents a symbol with interpolation, e.g.:
3783
+ * :"#{next}"
3784
+ *
3785
+ * The node is evaluated by duplicating the string stored in the 'lit'
3786
+ * element, then iterating over the nodes stored in the 'next' element.
3787
+ * Each node found should evalate to a string, and each resulting
3788
+ * string is appended onto the original string. The final resulting
3789
+ * string is then converted into a symbol. Interpolation is
3790
+ * represented with the EVSTR node.
3791
+ */
3792
+ {
3793
+ VALUE rb_cDSYM = rb_define_class_under(rb_cNode, "DSYM", rb_cNode);
3794
+ members = rb_ary_new();
3795
+ rb_cNodeSubclass[NODE_DSYM] = rb_cDSYM;
3796
+ rb_iv_set(rb_cDSYM, "__member__", members);
3797
+ rb_iv_set(rb_cDSYM, "__type__", INT2NUM(NODE_DSYM));
3798
+ rb_define_singleton_method(rb_cDSYM, "members", node_s_members, 0);
3799
+ rb_define_method(rb_cDSYM, "next", node_next, 0);
3903
3800
  rb_ary_push(members, rb_str_new2("next"));
3801
+ rb_define_method(rb_cDSYM, "lit", node_lit, 0);
3802
+ rb_ary_push(members, rb_str_new2("lit"));
3904
3803
  }
3905
3804
 
3906
3805
  /* Document-class: Node::DVAR
@@ -3943,17 +3842,17 @@ void define_node_subclass_methods()
3943
3842
  rb_iv_set(rb_cDXSTR, "__type__", INT2NUM(NODE_DXSTR));
3944
3843
  rb_define_singleton_method(rb_cDXSTR, "members", node_s_members, 0);
3945
3844
 
3946
- /* Document-method: lit
3947
- * a string
3948
- */
3949
- rb_define_method(rb_cDXSTR, "lit", node_lit, 0);
3950
- rb_ary_push(members, rb_str_new2("lit"));
3951
-
3952
3845
  /* Document-method: next
3953
3846
  * a list of expressions to be appended onto the string
3954
3847
  */
3955
3848
  rb_define_method(rb_cDXSTR, "next", node_next, 0);
3956
3849
  rb_ary_push(members, rb_str_new2("next"));
3850
+
3851
+ /* Document-method: lit
3852
+ * a string
3853
+ */
3854
+ rb_define_method(rb_cDXSTR, "lit", node_lit, 0);
3855
+ rb_ary_push(members, rb_str_new2("lit"));
3957
3856
  }
3958
3857
 
3959
3858
  /* Document-class: Node::ENSURE
@@ -4005,11 +3904,11 @@ void define_node_subclass_methods()
4005
3904
  rb_iv_set(rb_cEVSTR, "__type__", INT2NUM(NODE_EVSTR));
4006
3905
  rb_define_singleton_method(rb_cEVSTR, "members", node_s_members, 0);
4007
3906
 
4008
- /* Document-method: lit
4009
- * a string containing an expression to evaluate
3907
+ /* Document-method: body
3908
+ * an expression to evaluate
4010
3909
  */
4011
- rb_define_method(rb_cEVSTR, "lit", node_lit, 0);
4012
- rb_ary_push(members, rb_str_new2("lit"));
3910
+ rb_define_method(rb_cEVSTR, "body", node_body, 0);
3911
+ rb_ary_push(members, rb_str_new2("body"));
4013
3912
  }
4014
3913
 
4015
3914
  /* Document-class: Node::FALSE
@@ -4024,38 +3923,6 @@ void define_node_subclass_methods()
4024
3923
  rb_define_singleton_method(rb_cFALSE, "members", node_s_members, 0);
4025
3924
  }
4026
3925
 
4027
- /* Document-class: Node::FBODY
4028
- * A placeholder for a method alias, which can be added to a class by
4029
- * using alias or alias_method:
4030
- * alias old new
4031
- */
4032
- {
4033
- VALUE rb_cFBODY = rb_define_class_under(rb_cNode, "FBODY", rb_cNode);
4034
- members = rb_ary_new();
4035
- rb_cNodeSubclass[NODE_FBODY] = rb_cFBODY;
4036
- rb_iv_set(rb_cFBODY, "__member__", members);
4037
- rb_iv_set(rb_cFBODY, "__type__", INT2NUM(NODE_FBODY));
4038
- rb_define_singleton_method(rb_cFBODY, "members", node_s_members, 0);
4039
-
4040
- /* Document-method: head
4041
- * the method body
4042
- */
4043
- rb_define_method(rb_cFBODY, "head", node_head, 0);
4044
- rb_ary_push(members, rb_str_new2("head"));
4045
-
4046
- /* Document-method: orig
4047
- * the origin class
4048
- */
4049
- rb_define_method(rb_cFBODY, "orig", node_orig, 0);
4050
- rb_ary_push(members, rb_str_new2("orig"));
4051
-
4052
- /* Document-method: mid
4053
- * the name of the method
4054
- */
4055
- rb_define_method(rb_cFBODY, "mid", node_mid, 0);
4056
- rb_ary_push(members, rb_str_new2("mid"));
4057
- }
4058
-
4059
3926
  /* Document-class: Node::FCALL
4060
3927
  * Represents a method call in the form:
4061
3928
  * mid(args).
@@ -4098,6 +3965,13 @@ void define_node_subclass_methods()
4098
3965
  rb_iv_set(rb_cFLIP2, "__type__", INT2NUM(NODE_FLIP2));
4099
3966
  rb_define_singleton_method(rb_cFLIP2, "members", node_s_members, 0);
4100
3967
 
3968
+ /* Document-method: cnt
3969
+ * the index into the local variable table of the special variable
3970
+ * to use in the flip-flop expression (usually 2 for $_)
3971
+ */
3972
+ rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
3973
+ rb_ary_push(members, rb_str_new2("cnt"));
3974
+
4101
3975
  /* Document-method: beg
4102
3976
  * the beginning of the range
4103
3977
  */
@@ -4109,13 +3983,6 @@ void define_node_subclass_methods()
4109
3983
  */
4110
3984
  rb_define_method(rb_cFLIP2, "end", node_end, 0);
4111
3985
  rb_ary_push(members, rb_str_new2("end"));
4112
-
4113
- /* Document-method: cnt
4114
- * the index into the local variable table of the special variable
4115
- * to use in the flip-flop expression (usually 2 for $_)
4116
- */
4117
- rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
4118
- rb_ary_push(members, rb_str_new2("cnt"));
4119
3986
  }
4120
3987
 
4121
3988
  /* Document-class: Node::FLIP3
@@ -4132,6 +3999,13 @@ void define_node_subclass_methods()
4132
3999
  rb_iv_set(rb_cFLIP3, "__type__", INT2NUM(NODE_FLIP3));
4133
4000
  rb_define_singleton_method(rb_cFLIP3, "members", node_s_members, 0);
4134
4001
 
4002
+ /* Document-method: cnt
4003
+ * the index into the local variable table of the special variable
4004
+ * to use in the flip-flop expression (usually 2 for $_)
4005
+ */
4006
+ rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
4007
+ rb_ary_push(members, rb_str_new2("cnt"));
4008
+
4135
4009
  /* Document-method: beg
4136
4010
  * the beginning of the range
4137
4011
  */
@@ -4143,13 +4017,6 @@ void define_node_subclass_methods()
4143
4017
  */
4144
4018
  rb_define_method(rb_cFLIP3, "end", node_end, 0);
4145
4019
  rb_ary_push(members, rb_str_new2("end"));
4146
-
4147
- /* Document-method: cnt
4148
- * the index into the local variable table of the special variable
4149
- * to use in the flip-flop expression (usually 2 for $_)
4150
- */
4151
- rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
4152
- rb_ary_push(members, rb_str_new2("cnt"));
4153
4020
  }
4154
4021
 
4155
4022
  /* Document-class: Node::FOR
@@ -4174,12 +4041,6 @@ void define_node_subclass_methods()
4174
4041
  rb_iv_set(rb_cFOR, "__type__", INT2NUM(NODE_FOR));
4175
4042
  rb_define_singleton_method(rb_cFOR, "members", node_s_members, 0);
4176
4043
 
4177
- /* Document-method: body
4178
- * the body of the loop
4179
- */
4180
- rb_define_method(rb_cFOR, "body", node_body, 0);
4181
- rb_ary_push(members, rb_str_new2("body"));
4182
-
4183
4044
  /* Document-method: iter
4184
4045
  * the sequence over which to iterate
4185
4046
  */
@@ -4193,6 +4054,12 @@ void define_node_subclass_methods()
4193
4054
  */
4194
4055
  rb_define_method(rb_cFOR, "var", node_var, 0);
4195
4056
  rb_ary_push(members, rb_str_new2("var"));
4057
+
4058
+ /* Document-method: body
4059
+ * the body of the loop
4060
+ */
4061
+ rb_define_method(rb_cFOR, "body", node_body, 0);
4062
+ rb_ary_push(members, rb_str_new2("body"));
4196
4063
  }
4197
4064
 
4198
4065
  /* Document-class: Node::GASGN
@@ -4206,12 +4073,6 @@ void define_node_subclass_methods()
4206
4073
  rb_iv_set(rb_cGASGN, "__type__", INT2NUM(NODE_GASGN));
4207
4074
  rb_define_singleton_method(rb_cGASGN, "members", node_s_members, 0);
4208
4075
 
4209
- /* Document-method: value
4210
- * an expression whose result is the new value of the global variable
4211
- */
4212
- rb_define_method(rb_cGASGN, "value", node_value, 0);
4213
- rb_ary_push(members, rb_str_new2("value"));
4214
-
4215
4076
  /* Document-method: vid
4216
4077
  * the name of the global variable, with a leading '$' character.
4217
4078
  */
@@ -4219,6 +4080,12 @@ void define_node_subclass_methods()
4219
4080
  rb_ary_push(members, rb_str_new2("vid"));
4220
4081
  rb_define_method(rb_cGASGN, "entry", node_entry, 0);
4221
4082
  rb_ary_push(members, rb_str_new2("entry"));
4083
+
4084
+ /* Document-method: value
4085
+ * an expression whose result is the new value of the global variable
4086
+ */
4087
+ rb_define_method(rb_cGASGN, "value", node_value, 0);
4088
+ rb_ary_push(members, rb_str_new2("value"));
4222
4089
  }
4223
4090
 
4224
4091
  /* Document-class: Node::GVAR
@@ -4271,17 +4138,17 @@ void define_node_subclass_methods()
4271
4138
  rb_iv_set(rb_cIASGN, "__type__", INT2NUM(NODE_IASGN));
4272
4139
  rb_define_singleton_method(rb_cIASGN, "members", node_s_members, 0);
4273
4140
 
4274
- /* Document-method: value
4275
- * the value to assign to the instance variable
4276
- */
4277
- rb_define_method(rb_cIASGN, "value", node_value, 0);
4278
- rb_ary_push(members, rb_str_new2("value"));
4279
-
4280
4141
  /* Document-method: vid
4281
4142
  * the name of the instance variable, with a leading '@' sign
4282
4143
  */
4283
4144
  rb_define_method(rb_cIASGN, "vid", node_vid, 0);
4284
4145
  rb_ary_push(members, rb_str_new2("vid"));
4146
+
4147
+ /* Document-method: value
4148
+ * the value to assign to the instance variable
4149
+ */
4150
+ rb_define_method(rb_cIASGN, "value", node_value, 0);
4151
+ rb_ary_push(members, rb_str_new2("value"));
4285
4152
  }
4286
4153
 
4287
4154
  /* Document-class: Node::IF
@@ -4313,6 +4180,13 @@ void define_node_subclass_methods()
4313
4180
  rb_iv_set(rb_cIF, "__type__", INT2NUM(NODE_IF));
4314
4181
  rb_define_singleton_method(rb_cIF, "members", node_s_members, 0);
4315
4182
 
4183
+ /* Document-method: else
4184
+ * the expression to evaluate if the expression is false, or false
4185
+ * if the expression is empty
4186
+ */
4187
+ rb_define_method(rb_cIF, "else", node_else, 0);
4188
+ rb_ary_push(members, rb_str_new2("else"));
4189
+
4316
4190
  /* Document-method: cond
4317
4191
  * the condition to evaluate
4318
4192
  */
@@ -4325,13 +4199,6 @@ void define_node_subclass_methods()
4325
4199
  */
4326
4200
  rb_define_method(rb_cIF, "body", node_body, 0);
4327
4201
  rb_ary_push(members, rb_str_new2("body"));
4328
-
4329
- /* Document-method: else
4330
- * the expression to evaluate if the expression is false, or false
4331
- * if the expression is empty
4332
- */
4333
- rb_define_method(rb_cIF, "else", node_else, 0);
4334
- rb_ary_push(members, rb_str_new2("else"));
4335
4202
  }
4336
4203
 
4337
4204
  /* Document-class: Node::IFUNC
@@ -4345,12 +4212,6 @@ void define_node_subclass_methods()
4345
4212
  rb_iv_set(rb_cIFUNC, "__type__", INT2NUM(NODE_IFUNC));
4346
4213
  rb_define_singleton_method(rb_cIFUNC, "members", node_s_members, 0);
4347
4214
 
4348
- /* Document-method: cfnc
4349
- * a pointer to the C function to which to yield
4350
- */
4351
- rb_define_method(rb_cIFUNC, "cfnc", node_cfnc, 0);
4352
- rb_ary_push(members, rb_str_new2("cfnc"));
4353
-
4354
4215
  /* Document-method: tval
4355
4216
  * the user-specified data to be passed as the second argument to
4356
4217
  * cfnc
@@ -4363,6 +4224,12 @@ void define_node_subclass_methods()
4363
4224
  */
4364
4225
  rb_define_method(rb_cIFUNC, "state", node_state, 0);
4365
4226
  rb_ary_push(members, rb_str_new2("state"));
4227
+
4228
+ /* Document-method: cfnc
4229
+ * a pointer to the C function to which to yield
4230
+ */
4231
+ rb_define_method(rb_cIFUNC, "cfnc", node_cfnc, 0);
4232
+ rb_ary_push(members, rb_str_new2("cfnc"));
4366
4233
  }
4367
4234
 
4368
4235
  /* Document-class: Node::ITER
@@ -4386,12 +4253,6 @@ void define_node_subclass_methods()
4386
4253
  rb_iv_set(rb_cITER, "__type__", INT2NUM(NODE_ITER));
4387
4254
  rb_define_singleton_method(rb_cITER, "members", node_s_members, 0);
4388
4255
 
4389
- /* Document-method: body
4390
- * the body of the loop
4391
- */
4392
- rb_define_method(rb_cITER, "body", node_body, 0);
4393
- rb_ary_push(members, rb_str_new2("body"));
4394
-
4395
4256
  /* Document-method: iter
4396
4257
  * an expression which calls the desired iteration method, usually
4397
4258
  * recv.each
@@ -4406,6 +4267,12 @@ void define_node_subclass_methods()
4406
4267
  */
4407
4268
  rb_define_method(rb_cITER, "var", node_var, 0);
4408
4269
  rb_ary_push(members, rb_str_new2("var"));
4270
+
4271
+ /* Document-method: body
4272
+ * the body of the loop
4273
+ */
4274
+ rb_define_method(rb_cITER, "body", node_body, 0);
4275
+ rb_ary_push(members, rb_str_new2("body"));
4409
4276
  }
4410
4277
 
4411
4278
  /* Document-class: Node::IVAR
@@ -4440,12 +4307,6 @@ void define_node_subclass_methods()
4440
4307
  rb_iv_set(rb_cLASGN, "__type__", INT2NUM(NODE_LASGN));
4441
4308
  rb_define_singleton_method(rb_cLASGN, "members", node_s_members, 0);
4442
4309
 
4443
- /* Document-method: value
4444
- * the value to assign to the local variable
4445
- */
4446
- rb_define_method(rb_cLASGN, "value", node_value, 0);
4447
- rb_ary_push(members, rb_str_new2("value"));
4448
-
4449
4310
  /* Document-method: vid
4450
4311
  * the name of the local variable
4451
4312
  */
@@ -4453,6 +4314,12 @@ void define_node_subclass_methods()
4453
4314
  rb_ary_push(members, rb_str_new2("vid"));
4454
4315
  rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
4455
4316
  rb_ary_push(members, rb_str_new2("cnt"));
4317
+
4318
+ /* Document-method: value
4319
+ * the value to assign to the local variable
4320
+ */
4321
+ rb_define_method(rb_cLASGN, "value", node_value, 0);
4322
+ rb_ary_push(members, rb_str_new2("value"));
4456
4323
  }
4457
4324
 
4458
4325
  /* Document-class: Node::LIT
@@ -4546,11 +4413,11 @@ void define_node_subclass_methods()
4546
4413
  rb_iv_set(rb_cMATCH, "__type__", INT2NUM(NODE_MATCH));
4547
4414
  rb_define_singleton_method(rb_cMATCH, "members", node_s_members, 0);
4548
4415
 
4549
- /* Document-method: head
4416
+ /* Document-method: lit
4550
4417
  * the regular expression to use in the condition.
4551
4418
  */
4552
- rb_define_method(rb_cMATCH, "head", node_head, 0);
4553
- rb_ary_push(members, rb_str_new2("head"));
4419
+ rb_define_method(rb_cMATCH, "lit", node_lit, 0);
4420
+ rb_ary_push(members, rb_str_new2("lit"));
4554
4421
 
4555
4422
  /* Document-method: value
4556
4423
  * the value to compare against
@@ -4584,6 +4451,13 @@ void define_node_subclass_methods()
4584
4451
  rb_iv_set(rb_cMATCH2, "__type__", INT2NUM(NODE_MATCH2));
4585
4452
  rb_define_singleton_method(rb_cMATCH2, "members", node_s_members, 0);
4586
4453
 
4454
+ /* Document-method: recv
4455
+ * the regular expression on the left hand side of the match
4456
+ * operator
4457
+ */
4458
+ rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
4459
+ rb_ary_push(members, rb_str_new2("recv"));
4460
+
4587
4461
  /* Document-method: value
4588
4462
  * the expression on the right hand side of the match operator, or
4589
4463
  * an expression returning $_ if there is nothing on the right hand
@@ -4591,13 +4465,6 @@ void define_node_subclass_methods()
4591
4465
  */
4592
4466
  rb_define_method(rb_cMATCH2, "value", node_value, 0);
4593
4467
  rb_ary_push(members, rb_str_new2("value"));
4594
-
4595
- /* Document-method: recv
4596
- * the regular expression on the left hand side of the match
4597
- * operator
4598
- */
4599
- rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
4600
- rb_ary_push(members, rb_str_new2("recv"));
4601
4468
  }
4602
4469
 
4603
4470
  /* Document-class: Node::MATCH3
@@ -4615,17 +4482,17 @@ void define_node_subclass_methods()
4615
4482
  rb_iv_set(rb_cMATCH3, "__type__", INT2NUM(NODE_MATCH3));
4616
4483
  rb_define_singleton_method(rb_cMATCH3, "members", node_s_members, 0);
4617
4484
 
4618
- /* Document-method: value
4619
- * the right hand side of the match
4620
- */
4621
- rb_define_method(rb_cMATCH3, "value", node_value, 0);
4622
- rb_ary_push(members, rb_str_new2("value"));
4623
-
4624
4485
  /* Document-method: recv
4625
4486
  * the left hand side of the match
4626
4487
  */
4627
4488
  rb_define_method(rb_cMATCH3, "recv", node_recv, 0);
4628
4489
  rb_ary_push(members, rb_str_new2("recv"));
4490
+
4491
+ /* Document-method: value
4492
+ * the right hand side of the match
4493
+ */
4494
+ rb_define_method(rb_cMATCH3, "value", node_value, 0);
4495
+ rb_ary_push(members, rb_str_new2("value"));
4629
4496
  }
4630
4497
 
4631
4498
  /* Document-class: Node::MEMO
@@ -4651,33 +4518,9 @@ void define_node_subclass_methods()
4651
4518
  rb_define_singleton_method(rb_cMEMO, "members", node_s_members, 0);
4652
4519
  }
4653
4520
 
4654
- /* Document-class: Node::METHOD
4655
- * A placeholder for a method entry in a class's method table.
4656
- */
4657
- {
4658
- VALUE rb_cMETHOD = rb_define_class_under(rb_cNode, "METHOD", rb_cNode);
4659
- members = rb_ary_new();
4660
- rb_cNodeSubclass[NODE_METHOD] = rb_cMETHOD;
4661
- rb_iv_set(rb_cMETHOD, "__member__", members);
4662
- rb_iv_set(rb_cMETHOD, "__type__", INT2NUM(NODE_METHOD));
4663
- rb_define_singleton_method(rb_cMETHOD, "members", node_s_members, 0);
4664
-
4665
- /* Document-method: body
4666
- * the body of the method
4667
- */
4668
- rb_define_method(rb_cMETHOD, "body", node_body, 0);
4669
- rb_ary_push(members, rb_str_new2("body"));
4670
-
4671
- /* Document-method: noex
4672
- * the method's flags
4673
- */
4674
- rb_define_method(rb_cMETHOD, "noex", node_noex, 0);
4675
- rb_ary_push(members, rb_str_new2("noex"));
4676
- }
4677
-
4678
4521
  /* Document-class: Node::MODULE
4679
4522
  * Represents a module definition, e.g.:
4680
- * module cname
4523
+ * module cpath
4681
4524
  * body
4682
4525
  * end
4683
4526
  *
@@ -4694,36 +4537,17 @@ void define_node_subclass_methods()
4694
4537
  rb_iv_set(rb_cMODULE, "__type__", INT2NUM(NODE_MODULE));
4695
4538
  rb_define_singleton_method(rb_cMODULE, "members", node_s_members, 0);
4696
4539
 
4540
+ /* Document-method: cpath
4541
+ * the name of the module to define
4542
+ */
4543
+ rb_define_method(rb_cMODULE, "cpath", node_cpath, 0);
4544
+ rb_ary_push(members, rb_str_new2("cpath"));
4545
+
4697
4546
  /* Document-method: body
4698
4547
  * the body of the module definition
4699
4548
  */
4700
4549
  rb_define_method(rb_cMODULE, "body", node_body, 0);
4701
4550
  rb_ary_push(members, rb_str_new2("body"));
4702
-
4703
- /* Document-method: cname
4704
- * the name of the module to define
4705
- */
4706
- rb_define_method(rb_cMODULE, "cname", node_cname, 0);
4707
- rb_ary_push(members, rb_str_new2("cname"));
4708
- }
4709
-
4710
- /* Document-class: Node::NEWLINE
4711
- * Represents the termination of a line. This is used for calling
4712
- * event hooks when a new line of code is reached.
4713
- */
4714
- {
4715
- VALUE rb_cNEWLINE = rb_define_class_under(rb_cNode, "NEWLINE", rb_cNode);
4716
- members = rb_ary_new();
4717
- rb_cNodeSubclass[NODE_NEWLINE] = rb_cNEWLINE;
4718
- rb_iv_set(rb_cNEWLINE, "__member__", members);
4719
- rb_iv_set(rb_cNEWLINE, "__type__", INT2NUM(NODE_NEWLINE));
4720
- rb_define_singleton_method(rb_cNEWLINE, "members", node_s_members, 0);
4721
-
4722
- /* Document-method: next
4723
- * the expression on the next line
4724
- */
4725
- rb_define_method(rb_cNEWLINE, "next", node_next, 0);
4726
- rb_ary_push(members, rb_str_new2("next"));
4727
4551
  }
4728
4552
 
4729
4553
  /* Document-class: Node::NEXT
@@ -4754,24 +4578,6 @@ void define_node_subclass_methods()
4754
4578
  rb_define_singleton_method(rb_cNIL, "members", node_s_members, 0);
4755
4579
  }
4756
4580
 
4757
- /* Document-class: Node::NOT
4758
- * Represents a logical negation.
4759
- */
4760
- {
4761
- VALUE rb_cNOT = rb_define_class_under(rb_cNode, "NOT", rb_cNode);
4762
- members = rb_ary_new();
4763
- rb_cNodeSubclass[NODE_NOT] = rb_cNOT;
4764
- rb_iv_set(rb_cNOT, "__member__", members);
4765
- rb_iv_set(rb_cNOT, "__type__", INT2NUM(NODE_NOT));
4766
- rb_define_singleton_method(rb_cNOT, "members", node_s_members, 0);
4767
-
4768
- /* Document-method: body
4769
- * the value to negate.
4770
- */
4771
- rb_define_method(rb_cNOT, "body", node_body, 0);
4772
- rb_ary_push(members, rb_str_new2("body"));
4773
- }
4774
-
4775
4581
  /* Document-class: Node::NTH_REF
4776
4582
  * Represents the nth match data item, e.g. $1, $2, etc.
4777
4583
  */
@@ -4886,12 +4692,6 @@ void define_node_subclass_methods()
4886
4692
  rb_iv_set(rb_cOP_ASGN2, "__type__", INT2NUM(NODE_OP_ASGN2));
4887
4693
  rb_define_singleton_method(rb_cOP_ASGN2, "members", node_s_members, 0);
4888
4694
 
4889
- /* Document-method: value
4890
- * the value to assign to the attribute
4891
- */
4892
- rb_define_method(rb_cOP_ASGN2, "value", node_value, 0);
4893
- rb_ary_push(members, rb_str_new2("value"));
4894
-
4895
4695
  /* Document-method: next
4896
4696
  * another node of type OP_ASGN2 which contains more information
4897
4697
  * about the assignment operation than can fit in this node alone
@@ -4904,6 +4704,12 @@ void define_node_subclass_methods()
4904
4704
  */
4905
4705
  rb_define_method(rb_cOP_ASGN2, "recv", node_recv, 0);
4906
4706
  rb_ary_push(members, rb_str_new2("recv"));
4707
+
4708
+ /* Document-method: value
4709
+ * the value to assign to the attribute
4710
+ */
4711
+ rb_define_method(rb_cOP_ASGN2, "value", node_value, 0);
4712
+ rb_ary_push(members, rb_str_new2("value"));
4907
4713
  }
4908
4714
 
4909
4715
  /* Document-class: Node::OP_ASGN2_ARG
@@ -4919,12 +4725,6 @@ void define_node_subclass_methods()
4919
4725
  rb_iv_set(rb_cOP_ASGN2_ARG, "__type__", INT2NUM(NODE_OP_ASGN2_ARG));
4920
4726
  rb_define_singleton_method(rb_cOP_ASGN2_ARG, "members", node_s_members, 0);
4921
4727
 
4922
- /* Document-method: vid
4923
- * The method to call on the receiver to retrieve the attribute
4924
- */
4925
- rb_define_method(rb_cOP_ASGN2_ARG, "vid", node_vid, 0);
4926
- rb_ary_push(members, rb_str_new2("vid"));
4927
-
4928
4728
  /* Document-method: aid
4929
4729
  * The method to call on the receiver to set the attribute
4930
4730
  */
@@ -4938,6 +4738,12 @@ void define_node_subclass_methods()
4938
4738
  */
4939
4739
  rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
4940
4740
  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"));
4941
4747
  }
4942
4748
 
4943
4749
  /* Document-class: Node::OP_ASGN_AND
@@ -4956,18 +4762,18 @@ void define_node_subclass_methods()
4956
4762
  rb_iv_set(rb_cOP_ASGN_AND, "__type__", INT2NUM(NODE_OP_ASGN_AND));
4957
4763
  rb_define_singleton_method(rb_cOP_ASGN_AND, "members", node_s_members, 0);
4958
4764
 
4765
+ /* Document-method: recv
4766
+ * an expression representing the left hand side of the assignment
4767
+ */
4768
+ rb_define_method(rb_cOP_ASGN_AND, "recv", node_recv, 0);
4769
+ rb_ary_push(members, rb_str_new2("recv"));
4770
+
4959
4771
  /* Document-method: value
4960
4772
  * an expression representing the assignment that should be
4961
4773
  * performed if the left hand side is true
4962
4774
  */
4963
4775
  rb_define_method(rb_cOP_ASGN_AND, "value", node_value, 0);
4964
4776
  rb_ary_push(members, rb_str_new2("value"));
4965
-
4966
- /* Document-method: recv
4967
- * an expression representing the left hand side of the assignment
4968
- */
4969
- rb_define_method(rb_cOP_ASGN_AND, "recv", node_recv, 0);
4970
- rb_ary_push(members, rb_str_new2("recv"));
4971
4777
  }
4972
4778
 
4973
4779
  /* Document-class: Node::OP_ASGN_OR
@@ -4994,17 +4800,17 @@ void define_node_subclass_methods()
4994
4800
  rb_define_method(rb_cOP_ASGN_OR, "aid", node_aid, 0);
4995
4801
  rb_ary_push(members, rb_str_new2("aid"));
4996
4802
 
4997
- /* Document-method: value
4998
- * the right hand side of the assignment
4999
- */
5000
- rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
5001
- rb_ary_push(members, rb_str_new2("value"));
5002
-
5003
4803
  /* Document-method: recv
5004
4804
  * the receiver of the assignment
5005
4805
  */
5006
4806
  rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
5007
4807
  rb_ary_push(members, rb_str_new2("recv"));
4808
+
4809
+ /* Document-method: value
4810
+ * the right hand side of the assignment
4811
+ */
4812
+ rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
4813
+ rb_ary_push(members, rb_str_new2("value"));
5008
4814
  }
5009
4815
 
5010
4816
  /* Document-class: Node::OR
@@ -5022,17 +4828,17 @@ void define_node_subclass_methods()
5022
4828
  rb_iv_set(rb_cOR, "__type__", INT2NUM(NODE_OR));
5023
4829
  rb_define_singleton_method(rb_cOR, "members", node_s_members, 0);
5024
4830
 
5025
- /* Document-method: first
5026
- * the expression on the left hand side
5027
- */
5028
- rb_define_method(rb_cOR, "first", node_1st, 0);
5029
- rb_ary_push(members, rb_str_new2("first"));
5030
-
5031
4831
  /* Document-method: second
5032
4832
  * the expression on the right hand side
5033
4833
  */
5034
4834
  rb_define_method(rb_cOR, "second", node_2nd, 0);
5035
4835
  rb_ary_push(members, rb_str_new2("second"));
4836
+
4837
+ /* Document-method: first
4838
+ * the expression on the left hand side
4839
+ */
4840
+ rb_define_method(rb_cOR, "first", node_1st, 0);
4841
+ rb_ary_push(members, rb_str_new2("first"));
5036
4842
  }
5037
4843
 
5038
4844
  /* Document-class: Node::POSTEXE
@@ -5084,18 +4890,18 @@ void define_node_subclass_methods()
5084
4890
  rb_iv_set(rb_cRESBODY, "__type__", INT2NUM(NODE_RESBODY));
5085
4891
  rb_define_singleton_method(rb_cRESBODY, "members", node_s_members, 0);
5086
4892
 
5087
- /* Document-method: head
5088
- * the next rescue
5089
- */
5090
- rb_define_method(rb_cRESBODY, "head", node_head, 0);
5091
- rb_ary_push(members, rb_str_new2("head"));
5092
-
5093
4893
  /* Document-method: args
5094
4894
  * the expression type to match against
5095
4895
  */
5096
4896
  rb_define_method(rb_cRESBODY, "args", node_args, 0);
5097
4897
  rb_ary_push(members, rb_str_new2("args"));
5098
4898
 
4899
+ /* Document-method: head
4900
+ * the next rescue
4901
+ */
4902
+ rb_define_method(rb_cRESBODY, "head", node_head, 0);
4903
+ rb_ary_push(members, rb_str_new2("head"));
4904
+
5099
4905
  /* Document-method: body
5100
4906
  * the expresion to evaluate if the exception type matches
5101
4907
  */
@@ -5140,18 +4946,18 @@ void define_node_subclass_methods()
5140
4946
  rb_iv_set(rb_cRESCUE, "__type__", INT2NUM(NODE_RESCUE));
5141
4947
  rb_define_singleton_method(rb_cRESCUE, "members", node_s_members, 0);
5142
4948
 
5143
- /* Document-method: head
5144
- * the body of the block to evaluate
5145
- */
5146
- rb_define_method(rb_cRESCUE, "head", node_head, 0);
5147
- rb_ary_push(members, rb_str_new2("head"));
5148
-
5149
4949
  /* Document-method: else
5150
4950
  * the expression to be evaluated if no exception is raised
5151
4951
  */
5152
4952
  rb_define_method(rb_cRESCUE, "else", node_else, 0);
5153
4953
  rb_ary_push(members, rb_str_new2("else"));
5154
4954
 
4955
+ /* Document-method: head
4956
+ * the body of the block to evaluate
4957
+ */
4958
+ rb_define_method(rb_cRESCUE, "head", node_head, 0);
4959
+ rb_ary_push(members, rb_str_new2("head"));
4960
+
5155
4961
  /* Document-method: resq
5156
4962
  * the expression to be evaluated if an exception is raised
5157
4963
  */
@@ -5211,17 +5017,17 @@ void define_node_subclass_methods()
5211
5017
  rb_iv_set(rb_cSCLASS, "__type__", INT2NUM(NODE_SCLASS));
5212
5018
  rb_define_singleton_method(rb_cSCLASS, "members", node_s_members, 0);
5213
5019
 
5214
- /* Document-method: body
5215
- * the body of the class definition
5216
- */
5217
- rb_define_method(rb_cSCLASS, "body", node_body, 0);
5218
- rb_ary_push(members, rb_str_new2("body"));
5219
-
5220
5020
  /* Document-method: recv
5221
5021
  * the object whose singleton class is to be modified
5222
5022
  */
5223
5023
  rb_define_method(rb_cSCLASS, "recv", node_recv, 0);
5224
5024
  rb_ary_push(members, rb_str_new2("recv"));
5025
+
5026
+ /* Document-method: body
5027
+ * the body of the class definition
5028
+ */
5029
+ rb_define_method(rb_cSCLASS, "body", node_body, 0);
5030
+ rb_ary_push(members, rb_str_new2("body"));
5225
5031
  }
5226
5032
 
5227
5033
  /* Document-class: Node::SCOPE
@@ -5246,6 +5052,12 @@ void define_node_subclass_methods()
5246
5052
  rb_iv_set(rb_cSCOPE, "__type__", INT2NUM(NODE_SCOPE));
5247
5053
  rb_define_singleton_method(rb_cSCOPE, "members", node_s_members, 0);
5248
5054
 
5055
+ /* Document-method: next
5056
+ * the body of the lexical scope
5057
+ */
5058
+ rb_define_method(rb_cSCOPE, "next", node_next, 0);
5059
+ rb_ary_push(members, rb_str_new2("next"));
5060
+
5249
5061
  /* Document-method: tbl
5250
5062
  * the names of the local variables* next the first expression in
5251
5063
  * the scope
@@ -5259,12 +5071,6 @@ void define_node_subclass_methods()
5259
5071
  */
5260
5072
  rb_define_method(rb_cSCOPE, "rval", node_rval, 0);
5261
5073
  rb_ary_push(members, rb_str_new2("rval"));
5262
-
5263
- /* Document-method: next
5264
- * the body of the lexical scope
5265
- */
5266
- rb_define_method(rb_cSCOPE, "next", node_next, 0);
5267
- rb_ary_push(members, rb_str_new2("next"));
5268
5074
  }
5269
5075
 
5270
5076
  /* Document-class: Node::SELF
@@ -5279,6 +5085,29 @@ void define_node_subclass_methods()
5279
5085
  rb_define_singleton_method(rb_cSELF, "members", node_s_members, 0);
5280
5086
  }
5281
5087
 
5088
+ /* Document-class: Node::SPLAT
5089
+ * Represents the splat (*) operation as an rvalue, e.g.:
5090
+ * *head
5091
+ * If the argument is an array, returns self.
5092
+ * If the argument is nil, returns [nil].
5093
+ * If the argument is any other value, returns the result of calling #to_a on the
5094
+ * argument.
5095
+ */
5096
+ {
5097
+ VALUE rb_cSPLAT = rb_define_class_under(rb_cNode, "SPLAT", rb_cNode);
5098
+ members = rb_ary_new();
5099
+ rb_cNodeSubclass[NODE_SPLAT] = rb_cSPLAT;
5100
+ rb_iv_set(rb_cSPLAT, "__member__", members);
5101
+ rb_iv_set(rb_cSPLAT, "__type__", INT2NUM(NODE_SPLAT));
5102
+ rb_define_singleton_method(rb_cSPLAT, "members", node_s_members, 0);
5103
+
5104
+ /* Document-method: head
5105
+ * the argument to splat.
5106
+ */
5107
+ rb_define_method(rb_cSPLAT, "head", node_head, 0);
5108
+ rb_ary_push(members, rb_str_new2("head"));
5109
+ }
5110
+
5282
5111
  /* Document-class: Node::STR
5283
5112
  * Represents a string object. Duplicates the string stored in the
5284
5113
  * node.
@@ -5316,6 +5145,26 @@ void define_node_subclass_methods()
5316
5145
  rb_ary_push(members, rb_str_new2("args"));
5317
5146
  }
5318
5147
 
5148
+ /* Document-class: Node::TO_ARY
5149
+ * Represents a conversion from one object type to an array type.
5150
+ * Evaluation of this node converts its argument to an array by calling
5151
+ * \#to_ary on the argument.
5152
+ */
5153
+ {
5154
+ VALUE rb_cTO_ARY = rb_define_class_under(rb_cNode, "TO_ARY", rb_cNode);
5155
+ members = rb_ary_new();
5156
+ rb_cNodeSubclass[NODE_TO_ARY] = rb_cTO_ARY;
5157
+ rb_iv_set(rb_cTO_ARY, "__member__", members);
5158
+ rb_iv_set(rb_cTO_ARY, "__type__", INT2NUM(NODE_TO_ARY));
5159
+ rb_define_singleton_method(rb_cTO_ARY, "members", node_s_members, 0);
5160
+
5161
+ /* Document-method: head
5162
+ * the object to convert to an array
5163
+ */
5164
+ rb_define_method(rb_cTO_ARY, "head", node_head, 0);
5165
+ rb_ary_push(members, rb_str_new2("head"));
5166
+ }
5167
+
5319
5168
  /* Document-class: Node::TRUE
5320
5169
  * Represents the keyword 'true'.
5321
5170
  */
@@ -5343,11 +5192,11 @@ void define_node_subclass_methods()
5343
5192
  rb_iv_set(rb_cUNDEF, "__type__", INT2NUM(NODE_UNDEF));
5344
5193
  rb_define_singleton_method(rb_cUNDEF, "members", node_s_members, 0);
5345
5194
 
5346
- /* Document-method: mid
5347
- * the id of the method to undefine
5195
+ /* Document-method: body
5196
+ * an expression returning the id of the method to undefine
5348
5197
  */
5349
- rb_define_method(rb_cUNDEF, "mid", node_mid, 0);
5350
- rb_ary_push(members, rb_str_new2("mid"));
5198
+ rb_define_method(rb_cUNDEF, "body", node_body, 0);
5199
+ rb_ary_push(members, rb_str_new2("body"));
5351
5200
  }
5352
5201
 
5353
5202
  /* Document-class: Node::UNTIL
@@ -5363,20 +5212,20 @@ void define_node_subclass_methods()
5363
5212
  rb_iv_set(rb_cUNTIL, "__member__", members);
5364
5213
  rb_iv_set(rb_cUNTIL, "__type__", INT2NUM(NODE_UNTIL));
5365
5214
  rb_define_singleton_method(rb_cUNTIL, "members", node_s_members, 0);
5366
-
5367
- /* Document-method: body
5368
- * the body of the loop
5369
- */
5370
- rb_define_method(rb_cUNTIL, "body", node_body, 0);
5371
- rb_ary_push(members, rb_str_new2("body"));
5215
+ rb_define_method(rb_cUNTIL, "state", node_state, 0);
5216
+ rb_ary_push(members, rb_str_new2("state"));
5372
5217
 
5373
5218
  /* Document-method: cond
5374
5219
  * a condition to terminate the loop when it becomes true
5375
5220
  */
5376
5221
  rb_define_method(rb_cUNTIL, "cond", node_cond, 0);
5377
5222
  rb_ary_push(members, rb_str_new2("cond"));
5378
- rb_define_method(rb_cUNTIL, "state", node_state, 0);
5379
- rb_ary_push(members, rb_str_new2("state"));
5223
+
5224
+ /* Document-method: body
5225
+ * the body of the loop
5226
+ */
5227
+ rb_define_method(rb_cUNTIL, "body", node_body, 0);
5228
+ rb_ary_push(members, rb_str_new2("body"));
5380
5229
  }
5381
5230
 
5382
5231
  /* Document-class: Node::VALIAS
@@ -5392,10 +5241,10 @@ void define_node_subclass_methods()
5392
5241
  rb_iv_set(rb_cVALIAS, "__member__", members);
5393
5242
  rb_iv_set(rb_cVALIAS, "__type__", INT2NUM(NODE_VALIAS));
5394
5243
  rb_define_singleton_method(rb_cVALIAS, "members", node_s_members, 0);
5395
- rb_define_method(rb_cVALIAS, "first", node_1st, 0);
5396
- rb_ary_push(members, rb_str_new2("first"));
5397
5244
  rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
5398
5245
  rb_ary_push(members, rb_str_new2("second"));
5246
+ rb_define_method(rb_cVALIAS, "first", node_1st, 0);
5247
+ rb_ary_push(members, rb_str_new2("first"));
5399
5248
  }
5400
5249
 
5401
5250
  /* Document-class: Node::VCALL
@@ -5455,6 +5304,12 @@ void define_node_subclass_methods()
5455
5304
  rb_iv_set(rb_cWHEN, "__type__", INT2NUM(NODE_WHEN));
5456
5305
  rb_define_singleton_method(rb_cWHEN, "members", node_s_members, 0);
5457
5306
 
5307
+ /* Document-method: next
5308
+ * the next expression to be evaluated if the condition is false
5309
+ */
5310
+ rb_define_method(rb_cWHEN, "next", node_next, 0);
5311
+ rb_ary_push(members, rb_str_new2("next"));
5312
+
5458
5313
  /* Document-method: head
5459
5314
  * a value to compare against, or a condition to be tested
5460
5315
  */
@@ -5466,12 +5321,6 @@ void define_node_subclass_methods()
5466
5321
  */
5467
5322
  rb_define_method(rb_cWHEN, "body", node_body, 0);
5468
5323
  rb_ary_push(members, rb_str_new2("body"));
5469
-
5470
- /* Document-method: next
5471
- * the next expression to be evaluated if the condition is false
5472
- */
5473
- rb_define_method(rb_cWHEN, "next", node_next, 0);
5474
- rb_ary_push(members, rb_str_new2("next"));
5475
5324
  }
5476
5325
 
5477
5326
  /* Document-class: Node::WHILE
@@ -5487,20 +5336,20 @@ void define_node_subclass_methods()
5487
5336
  rb_iv_set(rb_cWHILE, "__member__", members);
5488
5337
  rb_iv_set(rb_cWHILE, "__type__", INT2NUM(NODE_WHILE));
5489
5338
  rb_define_singleton_method(rb_cWHILE, "members", node_s_members, 0);
5490
-
5491
- /* Document-method: body
5492
- * the body of the loop
5493
- */
5494
- rb_define_method(rb_cWHILE, "body", node_body, 0);
5495
- rb_ary_push(members, rb_str_new2("body"));
5339
+ rb_define_method(rb_cWHILE, "state", node_state, 0);
5340
+ rb_ary_push(members, rb_str_new2("state"));
5496
5341
 
5497
5342
  /* Document-method: cond
5498
5343
  * a condition to terminate the loop when it becomes false
5499
5344
  */
5500
5345
  rb_define_method(rb_cWHILE, "cond", node_cond, 0);
5501
5346
  rb_ary_push(members, rb_str_new2("cond"));
5502
- rb_define_method(rb_cWHILE, "state", node_state, 0);
5503
- rb_ary_push(members, rb_str_new2("state"));
5347
+
5348
+ /* Document-method: body
5349
+ * the body of the loop
5350
+ */
5351
+ rb_define_method(rb_cWHILE, "body", node_body, 0);
5352
+ rb_ary_push(members, rb_str_new2("body"));
5504
5353
  }
5505
5354
 
5506
5355
  /* Document-class: Node::XSTR
@@ -5537,17 +5386,17 @@ void define_node_subclass_methods()
5537
5386
  rb_iv_set(rb_cYIELD, "__type__", INT2NUM(NODE_YIELD));
5538
5387
  rb_define_singleton_method(rb_cYIELD, "members", node_s_members, 0);
5539
5388
 
5540
- /* Document-method: head
5541
- * the value to yield
5542
- */
5543
- rb_define_method(rb_cYIELD, "head", node_head, 0);
5544
- rb_ary_push(members, rb_str_new2("head"));
5545
-
5546
5389
  /* Document-method: state
5547
5390
  * if nonzero, splats the value before yielding
5548
5391
  */
5549
5392
  rb_define_method(rb_cYIELD, "state", node_state, 0);
5550
5393
  rb_ary_push(members, rb_str_new2("state"));
5394
+
5395
+ /* Document-method: head
5396
+ * the value to yield
5397
+ */
5398
+ rb_define_method(rb_cYIELD, "head", node_head, 0);
5399
+ rb_ary_push(members, rb_str_new2("head"));
5551
5400
  }
5552
5401
 
5553
5402
  /* Document-class: Node::ZARRAY