ruby-internal 0.7.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/ruby-internal-node-dump +1 -1
- data/bin/ruby-internal-obfuscate +1 -1
- data/ext/cached/ruby-1.8.4/internal/method/{method.h → internal_method.h} +12 -0
- data/ext/cached/ruby-1.8.4/internal/module/getcfp.h +13 -0
- data/ext/cached/ruby-1.8.4/internal/node/global_entry.h +94 -0
- data/ext/cached/ruby-1.8.4/internal/node/node_type_descrip.c +41 -41
- data/ext/cached/ruby-1.8.4/internal/node/nodeinfo.c +288 -273
- data/ext/cached/ruby-1.8.4/internal/vm/instruction/insns_info.c +3 -0
- data/ext/cached/ruby-1.8.4/internal/vm/iseq/iseq_load.inc +21 -2
- data/ext/cached/{ruby-1.8.3/internal/method/method.h → ruby-1.8.5/internal/method/internal_method.h} +12 -0
- data/ext/cached/ruby-1.8.5/internal/module/getcfp.h +13 -0
- data/ext/cached/ruby-1.8.5/internal/node/global_entry.h +94 -0
- data/ext/cached/ruby-1.8.5/internal/node/node_type_descrip.c +45 -45
- data/ext/cached/ruby-1.8.5/internal/node/nodeinfo.c +310 -295
- data/ext/cached/ruby-1.8.5/internal/vm/instruction/insns_info.c +3 -0
- data/ext/cached/ruby-1.8.5/internal/vm/iseq/iseq_load.inc +21 -2
- data/ext/cached/{ruby-1.8.5/internal/method/method.h → ruby-1.8.6/internal/method/internal_method.h} +12 -0
- data/ext/cached/ruby-1.8.6/internal/module/getcfp.h +13 -0
- data/ext/cached/ruby-1.8.6/internal/node/global_entry.h +94 -0
- data/ext/cached/ruby-1.8.6/internal/node/node_type_descrip.c +48 -48
- data/ext/cached/ruby-1.8.6/internal/node/nodeinfo.c +323 -308
- data/ext/cached/ruby-1.8.6/internal/vm/instruction/insns_info.c +3 -0
- data/ext/cached/ruby-1.8.6/internal/vm/iseq/iseq_load.inc +21 -2
- data/ext/cached/{ruby-1.8.6/internal/method/method.h → ruby-1.8.7/internal/method/internal_method.h} +12 -0
- data/ext/cached/ruby-1.8.7/internal/module/getcfp.h +13 -0
- data/ext/cached/ruby-1.8.7/internal/node/global_entry.h +98 -0
- data/ext/cached/ruby-1.8.7/internal/node/node_type_descrip.c +42 -42
- data/ext/cached/ruby-1.8.7/internal/node/nodeinfo.c +276 -261
- data/ext/cached/ruby-1.8.7/internal/vm/instruction/insns_info.c +3 -0
- data/ext/cached/ruby-1.8.7/internal/vm/iseq/iseq_load.inc +21 -2
- data/ext/cached/{ruby-1.9.0/internal/method/method.h → ruby-1.9.1/internal/method/internal_method.h} +12 -0
- data/ext/cached/ruby-1.9.1/internal/module/classpath.c +12 -14
- data/ext/cached/ruby-1.9.1/internal/module/getcfp.h +25 -0
- data/ext/cached/ruby-1.9.1/internal/node/global_entry.h +86 -0
- data/ext/cached/ruby-1.9.1/internal/node/node_type_descrip.c +46 -48
- data/ext/cached/ruby-1.9.1/internal/node/nodeinfo.c +311 -412
- data/ext/cached/ruby-1.9.1/internal/vm/instruction/insns_info.c +3 -0
- data/ext/cached/ruby-1.9.1/internal/vm/iseq/iseq_load.inc +28 -6
- data/ext/cached/ruby-1.9.1/internal/yarv-headers/iseq.h +1 -0
- data/ext/cached/ruby-1.9.1/internal/yarv-headers/parse.h +6 -6
- data/ext/cached/ruby-1.9.1/internal/yarv-headers/revision.h +1 -1
- data/ext/cached/ruby-1.9.1/internal/yarv-headers/version.h +6 -5
- data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_core.h +3 -2
- data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_insnhelper.h +1 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/binding/block.h +0 -0
- data/ext/cached/{ruby-1.9.1/internal/method/method.h → ruby-1.9.2/internal/method/internal_method.h} +16 -5
- data/ext/cached/ruby-1.9.2/internal/module/classpath.c +40 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/module/classpath.h +0 -0
- data/ext/cached/ruby-1.9.2/internal/module/getcfp.h +25 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/block.h +0 -0
- data/ext/cached/ruby-1.9.2/internal/node/global_entry.h +93 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/node_type_descrip.c +44 -48
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/nodeinfo.c +291 -439
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/nodeinfo.h +0 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/proc/block.h +0 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/tag/tag.h +0 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/instruction/insns_info.c +141 -64
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/instruction/insns_info.h +88 -80
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/iseq/insns_info.inc +77 -70
- data/ext/cached/ruby-1.9.2/internal/vm/iseq/iseq_load.inc +426 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/debug.h +1 -1
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/dln.h +3 -3
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/encdb.h +18 -2
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/eval_intern.h +39 -28
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/gc.h +7 -5
- data/ext/cached/ruby-1.9.2/internal/yarv-headers/id.h +170 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/iseq.h +20 -10
- data/ext/cached/ruby-1.9.2/internal/yarv-headers/method.h +103 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/node.h +14 -47
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/parse.h +31 -148
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regenc.h +7 -3
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regint.h +16 -17
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regparse.h +4 -1
- data/ext/cached/ruby-1.9.2/internal/yarv-headers/revision.h +1 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/thread_pthread.h +4 -1
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/thread_win32.h +1 -1
- data/ext/cached/ruby-1.9.2/internal/yarv-headers/timev.h +21 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/transcode_data.h +20 -10
- data/ext/cached/ruby-1.9.2/internal/yarv-headers/transdb.h +179 -0
- data/ext/cached/ruby-1.9.2/internal/yarv-headers/version.h +55 -0
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_core.h +127 -84
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_exec.h +4 -7
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_insnhelper.h +53 -36
- data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_opts.h +1 -1
- data/ext/cached/ruby-1.9.3/internal/binding/block.h +12 -0
- data/ext/cached/ruby-1.9.3/internal/method/internal_method.h +32 -0
- data/ext/cached/ruby-1.9.3/internal/module/classpath.c +40 -0
- data/ext/cached/{ruby-1.8.0 → ruby-1.9.3}/internal/module/classpath.h +5 -2
- data/ext/cached/ruby-1.9.3/internal/module/getcfp.h +25 -0
- data/ext/cached/ruby-1.9.3/internal/node/block.h +12 -0
- data/ext/cached/ruby-1.9.3/internal/node/global_entry.h +93 -0
- data/ext/cached/{ruby-1.8.3 → ruby-1.9.3}/internal/node/node_type_descrip.c +48 -57
- data/ext/cached/{ruby-1.6.8 → ruby-1.9.3}/internal/node/nodeinfo.c +589 -740
- data/ext/cached/{ruby-1.8.0 → ruby-1.9.3}/internal/node/nodeinfo.h +4 -3
- data/ext/cached/ruby-1.9.3/internal/proc/block.h +12 -0
- data/ext/cached/ruby-1.9.3/internal/tag/tag.h +6 -0
- data/ext/cached/ruby-1.9.3/internal/vm/instruction/insns_info.c +6013 -0
- data/ext/cached/ruby-1.9.3/internal/vm/instruction/insns_info.h +899 -0
- data/ext/cached/ruby-1.9.3/internal/vm/iseq/insns_info.inc +707 -0
- data/ext/cached/ruby-1.9.3/internal/vm/iseq/iseq_load.inc +423 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/addr2line.h +21 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/atomic.h +56 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/constant.h +34 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/debug.h +41 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/dln.h +50 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/encdb.h +167 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/eval_intern.h +234 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/gc.h +98 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/id.h +175 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/internal.h +232 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/iseq.h +125 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/method.h +105 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/node.h +503 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/parse.h +186 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/regenc.h +219 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/regint.h +850 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/regparse.h +362 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/revision.h +1 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/thread_pthread.h +51 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/thread_win32.h +40 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/timev.h +21 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/transcode_data.h +117 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/transdb.h +189 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/version.h +52 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_core.h +756 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_exec.h +184 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_insnhelper.h +220 -0
- data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_opts.h +51 -0
- data/ext/internal/binding/block.h +20 -0
- data/ext/internal/method/internal_method.h +5 -38
- data/ext/internal/method/internal_method.h.rpp +0 -7
- data/ext/internal/method/method.c +52 -32
- data/ext/internal/module/classpath.c +18 -13
- data/ext/internal/module/classpath.h +3 -3
- data/ext/internal/module/extconf.rb +3 -2
- data/ext/internal/module/getcfp.h +13 -0
- data/ext/internal/module/getcfp.h.rpp +44 -0
- data/ext/internal/module/module.c +58 -21
- data/ext/internal/node/block.h +20 -0
- data/ext/internal/node/extconf.rb +2 -0
- data/ext/internal/node/global_entry.h +69 -13
- data/ext/internal/node/global_entry.h.rpp +11 -2
- data/ext/internal/node/node.c +30 -3
- data/ext/internal/node/node_type_descrip.c +47 -38
- data/ext/internal/node/nodeinfo.c +622 -306
- data/ext/internal/node/nodeinfo.h +1 -4
- data/ext/internal/proc/block.h +20 -0
- data/ext/internal/tag/tag.h +10 -0
- data/ext/internal/thread/thread.c +9 -3
- data/ext/internal/vm/extconf.rb +1 -0
- data/ext/internal/vm/instruction/insns_info.c +3 -5974
- data/ext/internal/vm/instruction/insns_info.h +0 -878
- data/ext/internal/vm/iseq/extconf.rb +1 -0
- data/ext/internal/vm/iseq/iseq.c +38 -4
- data/ext/internal/vm/iseq/iseq_load.inc.rpp +23 -5
- data/ext/internal/vm/vm.c +28 -0
- data/lib/internal/classtree.rb +28 -0
- data/lib/internal/debug.rb +10 -2
- data/lib/internal/method/as_code.rb +25 -0
- data/lib/internal/method/as_expression.rb +2 -3
- data/lib/internal/method/origin.rb +29 -0
- data/lib/internal/method/signature.rb +5 -300
- data/lib/internal/method/signature/argument.rb +102 -0
- data/lib/internal/method/signature/iseq.rb +52 -0
- data/lib/internal/method/signature/node.rb +160 -0
- data/lib/internal/method/signature/signature.rb +23 -0
- data/lib/internal/proc/as_code.rb +2 -0
- data/lib/internal/proc/as_expression.rb +2 -0
- data/lib/internal/vm/bytedecoder.rb +5 -5
- data/lib/internal/vm/iseq/as_code.rb +2 -2
- data/lib/internal/vm/iseq/as_expression.rb +2 -2
- data/test/test_dump_method.rb +1 -1
- data/test/test_method.rb +21 -3
- data/test/test_node.rb +20 -4
- metadata +152 -155
- data/ext/cached/ruby-1.6.8/internal/binding/block.h +0 -35
- data/ext/cached/ruby-1.6.8/internal/method/method.h +0 -19
- data/ext/cached/ruby-1.6.8/internal/module/classpath.c +0 -3
- data/ext/cached/ruby-1.6.8/internal/module/classpath.h +0 -8
- data/ext/cached/ruby-1.6.8/internal/node/block.h +0 -35
- data/ext/cached/ruby-1.6.8/internal/node/global_entry.h +0 -15
- data/ext/cached/ruby-1.6.8/internal/node/node_type_descrip.c +0 -149
- data/ext/cached/ruby-1.6.8/internal/node/nodeinfo.h +0 -69
- data/ext/cached/ruby-1.6.8/internal/proc/block.h +0 -35
- data/ext/cached/ruby-1.6.8/internal/tag/tag.h +0 -15
- data/ext/cached/ruby-1.6.8/internal/vm/instruction/insns_info.c +0 -39
- data/ext/cached/ruby-1.6.8/internal/vm/instruction/insns_info.h +0 -21
- data/ext/cached/ruby-1.6.8/internal/vm/iseq/insns_info.inc +0 -12
- data/ext/cached/ruby-1.6.8/internal/vm/iseq/iseq_load.inc +0 -9
- data/ext/cached/ruby-1.8.0/internal/binding/block.h +0 -37
- data/ext/cached/ruby-1.8.0/internal/method/method.h +0 -19
- data/ext/cached/ruby-1.8.0/internal/module/classpath.c +0 -27
- data/ext/cached/ruby-1.8.0/internal/node/block.h +0 -37
- data/ext/cached/ruby-1.8.0/internal/node/global_entry.h +0 -10
- data/ext/cached/ruby-1.8.0/internal/node/node_type_descrip.c +0 -155
- data/ext/cached/ruby-1.8.0/internal/node/nodeinfo.c +0 -5744
- data/ext/cached/ruby-1.8.0/internal/proc/block.h +0 -37
- data/ext/cached/ruby-1.8.0/internal/tag/tag.h +0 -15
- data/ext/cached/ruby-1.8.0/internal/vm/instruction/insns_info.c +0 -39
- data/ext/cached/ruby-1.8.0/internal/vm/instruction/insns_info.h +0 -21
- data/ext/cached/ruby-1.8.0/internal/vm/iseq/insns_info.inc +0 -12
- data/ext/cached/ruby-1.8.0/internal/vm/iseq/iseq_load.inc +0 -9
- data/ext/cached/ruby-1.8.1/internal/binding/block.h +0 -31
- data/ext/cached/ruby-1.8.1/internal/method/method.h +0 -19
- data/ext/cached/ruby-1.8.1/internal/module/classpath.c +0 -27
- data/ext/cached/ruby-1.8.1/internal/module/classpath.h +0 -14
- data/ext/cached/ruby-1.8.1/internal/node/block.h +0 -31
- data/ext/cached/ruby-1.8.1/internal/node/global_entry.h +0 -10
- data/ext/cached/ruby-1.8.1/internal/node/node_type_descrip.c +0 -154
- data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.c +0 -5736
- data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.h +0 -69
- data/ext/cached/ruby-1.8.1/internal/proc/block.h +0 -31
- data/ext/cached/ruby-1.8.1/internal/tag/tag.h +0 -16
- data/ext/cached/ruby-1.8.1/internal/vm/instruction/insns_info.c +0 -39
- data/ext/cached/ruby-1.8.1/internal/vm/instruction/insns_info.h +0 -21
- data/ext/cached/ruby-1.8.1/internal/vm/iseq/insns_info.inc +0 -12
- data/ext/cached/ruby-1.8.1/internal/vm/iseq/iseq_load.inc +0 -9
- data/ext/cached/ruby-1.8.2/internal/binding/block.h +0 -32
- data/ext/cached/ruby-1.8.2/internal/method/method.h +0 -19
- data/ext/cached/ruby-1.8.2/internal/module/classpath.c +0 -45
- data/ext/cached/ruby-1.8.2/internal/module/classpath.h +0 -17
- data/ext/cached/ruby-1.8.2/internal/node/block.h +0 -32
- data/ext/cached/ruby-1.8.2/internal/node/global_entry.h +0 -10
- data/ext/cached/ruby-1.8.2/internal/node/node_type_descrip.c +0 -154
- data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.c +0 -5736
- data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.h +0 -69
- data/ext/cached/ruby-1.8.2/internal/proc/block.h +0 -32
- data/ext/cached/ruby-1.8.2/internal/tag/tag.h +0 -16
- data/ext/cached/ruby-1.8.2/internal/vm/instruction/insns_info.c +0 -39
- data/ext/cached/ruby-1.8.2/internal/vm/instruction/insns_info.h +0 -21
- data/ext/cached/ruby-1.8.2/internal/vm/iseq/insns_info.inc +0 -12
- data/ext/cached/ruby-1.8.2/internal/vm/iseq/iseq_load.inc +0 -9
- data/ext/cached/ruby-1.8.3/internal/binding/block.h +0 -32
- data/ext/cached/ruby-1.8.3/internal/module/classpath.c +0 -45
- data/ext/cached/ruby-1.8.3/internal/module/classpath.h +0 -17
- data/ext/cached/ruby-1.8.3/internal/node/block.h +0 -32
- data/ext/cached/ruby-1.8.3/internal/node/global_entry.h +0 -10
- data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.c +0 -5736
- data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.h +0 -69
- data/ext/cached/ruby-1.8.3/internal/proc/block.h +0 -32
- data/ext/cached/ruby-1.8.3/internal/tag/tag.h +0 -16
- data/ext/cached/ruby-1.8.3/internal/vm/instruction/insns_info.c +0 -39
- data/ext/cached/ruby-1.8.3/internal/vm/instruction/insns_info.h +0 -21
- data/ext/cached/ruby-1.8.3/internal/vm/iseq/insns_info.inc +0 -12
- data/ext/cached/ruby-1.8.3/internal/vm/iseq/iseq_load.inc +0 -9
- data/ext/cached/ruby-1.8.7/internal/method/method.h +0 -20
- data/ext/cached/ruby-1.9.0/internal/module/classpath.c +0 -42
- data/ext/cached/ruby-1.9.0/internal/node/global_entry.h +0 -10
- data/ext/cached/ruby-1.9.0/internal/vm/iseq/iseq_load.inc +0 -13
- data/ext/cached/ruby-1.9.0/internal/yarv-headers/id.h +0 -83
- data/ext/cached/ruby-1.9.0/internal/yarv-headers/revision.h +0 -1
- data/ext/cached/ruby-1.9.0/internal/yarv-headers/transdb.h +0 -67
- data/ext/cached/ruby-1.9.0/internal/yarv-headers/version.h +0 -57
- data/ext/internal/module/cfp.h +0 -13
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
#ifndef ruby_internal_iseq_load__inc_
|
|
2
2
|
#define ruby_internal_iseq_load__inc_
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
#include "internal/yarv-headers/iseq.h"
|
|
4
|
+
#ifdef HAVE_TYPE_STRUCT_RTYPEDDATA
|
|
6
5
|
|
|
6
|
+
static rb_data_type_t const * p_iseq_data_type;
|
|
7
|
+
|
|
8
|
+
static void init_iseq_data_type()
|
|
9
|
+
{
|
|
10
|
+
rb_proc_t * p;
|
|
11
|
+
VALUE body;
|
|
12
|
+
|
|
13
|
+
VALUE binding = rb_binding_new();
|
|
14
|
+
VALUE new_proc = rb_funcall(
|
|
15
|
+
rb_cObject, rb_intern("eval"), 2, rb_str_new2("proc { }"), binding);
|
|
16
|
+
GetProcPtr(new_proc, p);
|
|
17
|
+
body = p->block.iseq->self;
|
|
18
|
+
|
|
19
|
+
p_iseq_data_type = RTYPEDDATA_TYPE(body);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#else
|
|
23
|
+
|
|
24
|
+
#endif
|
|
25
|
+
#
|
|
7
26
|
|
|
8
27
|
#endif
|
|
9
28
|
|
data/ext/cached/{ruby-1.8.5/internal/method/method.h → ruby-1.8.6/internal/method/internal_method.h}
RENAMED
|
@@ -3,8 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
#include <ruby.h>
|
|
5
5
|
|
|
6
|
+
#ifdef RUBY_VM
|
|
7
|
+
#include "method.h"
|
|
8
|
+
#endif
|
|
9
|
+
|
|
6
10
|
#include "internal/node/ruby_internal_node.h"
|
|
7
11
|
|
|
12
|
+
#ifndef FALSE
|
|
13
|
+
#define FALSE 0
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
#ifndef TRUE
|
|
17
|
+
#define TRUE (!FALSE)
|
|
18
|
+
#endif
|
|
19
|
+
|
|
8
20
|
struct METHOD {
|
|
9
21
|
VALUE klass, rklass;
|
|
10
22
|
VALUE recv;
|
|
@@ -1,10 +1,104 @@
|
|
|
1
1
|
#ifndef global_entry__h_
|
|
2
2
|
#define global_entry__h_
|
|
3
3
|
|
|
4
|
+
st_table * rb_global_tbl;
|
|
5
|
+
|
|
6
|
+
struct trace_var {
|
|
7
|
+
int removed;
|
|
8
|
+
void (*func)();
|
|
9
|
+
VALUE data;
|
|
10
|
+
struct trace_var *next;
|
|
11
|
+
};
|
|
12
|
+
struct global_variable {
|
|
13
|
+
int counter;
|
|
14
|
+
void *data;
|
|
15
|
+
VALUE (*getter)();
|
|
16
|
+
void (*setter)();
|
|
17
|
+
void (*marker)();
|
|
18
|
+
int block_trace;
|
|
19
|
+
struct trace_var *trace;
|
|
20
|
+
};
|
|
4
21
|
struct global_entry {
|
|
5
22
|
struct global_variable *var;
|
|
6
23
|
ID id;
|
|
7
24
|
};
|
|
25
|
+
static VALUE undef_getter();
|
|
26
|
+
static void undef_setter();
|
|
27
|
+
static void undef_marker();
|
|
28
|
+
static VALUE val_getter();
|
|
29
|
+
static void val_setter();
|
|
30
|
+
static void val_marker();
|
|
31
|
+
struct global_entry*
|
|
32
|
+
rb_global_entry(id)
|
|
33
|
+
ID id;
|
|
34
|
+
{
|
|
35
|
+
struct global_entry *entry;
|
|
36
|
+
|
|
37
|
+
if (!st_lookup(rb_global_tbl, id, (st_data_t *)&entry)) {
|
|
38
|
+
struct global_variable *var;
|
|
39
|
+
entry = ALLOC(struct global_entry);
|
|
40
|
+
var = ALLOC(struct global_variable);
|
|
41
|
+
entry->id = id;
|
|
42
|
+
entry->var = var;
|
|
43
|
+
var->counter = 1;
|
|
44
|
+
var->data = 0;
|
|
45
|
+
var->getter = undef_getter;
|
|
46
|
+
var->setter = undef_setter;
|
|
47
|
+
var->marker = undef_marker;
|
|
48
|
+
|
|
49
|
+
var->block_trace = 0;
|
|
50
|
+
var->trace = 0;
|
|
51
|
+
st_add_direct(rb_global_tbl, id, (st_data_t)entry);
|
|
52
|
+
}
|
|
53
|
+
return entry;
|
|
54
|
+
}
|
|
55
|
+
static VALUE
|
|
56
|
+
undef_getter(id)
|
|
57
|
+
ID id;
|
|
58
|
+
{
|
|
59
|
+
rb_warning("global variable `%s' not initialized", rb_id2name(id));
|
|
60
|
+
|
|
61
|
+
return Qnil;
|
|
62
|
+
}
|
|
63
|
+
static void
|
|
64
|
+
undef_setter(val, id, data, var)
|
|
65
|
+
VALUE val;
|
|
66
|
+
ID id;
|
|
67
|
+
void *data;
|
|
68
|
+
struct global_variable *var;
|
|
69
|
+
{
|
|
70
|
+
var->getter = val_getter;
|
|
71
|
+
var->setter = val_setter;
|
|
72
|
+
var->marker = val_marker;
|
|
73
|
+
|
|
74
|
+
var->data = (void*)val;
|
|
75
|
+
}
|
|
76
|
+
static void
|
|
77
|
+
undef_marker()
|
|
78
|
+
{
|
|
79
|
+
}
|
|
80
|
+
static VALUE
|
|
81
|
+
val_getter(id, val)
|
|
82
|
+
ID id;
|
|
83
|
+
VALUE val;
|
|
84
|
+
{
|
|
85
|
+
return val;
|
|
86
|
+
}
|
|
87
|
+
static void
|
|
88
|
+
val_setter(val, id, data, var)
|
|
89
|
+
VALUE val;
|
|
90
|
+
ID id;
|
|
91
|
+
void *data;
|
|
92
|
+
struct global_variable *var;
|
|
93
|
+
{
|
|
94
|
+
var->data = (void*)val;
|
|
95
|
+
}
|
|
96
|
+
static void
|
|
97
|
+
val_marker(data)
|
|
98
|
+
VALUE data;
|
|
99
|
+
{
|
|
100
|
+
if (data) rb_gc_mark_maybe(data);
|
|
101
|
+
}
|
|
8
102
|
|
|
9
103
|
#endif
|
|
10
104
|
|
|
@@ -4,44 +4,44 @@
|
|
|
4
4
|
Node_Type_Descrip node_type_descrips_unsorted[] = {
|
|
5
5
|
{ NODE_ALIAS, NEN_1ST, NEN_2ND, NEN_NONE, "ALIAS" },
|
|
6
6
|
#ifdef HAVE_NODE_ALLOCA
|
|
7
|
-
{ NODE_ALLOCA, NEN_CFNC,
|
|
7
|
+
{ NODE_ALLOCA, NEN_CFNC, NEN_CNT, NEN_VALUE, "ALLOCA" },
|
|
8
8
|
#endif
|
|
9
9
|
{ NODE_AND, NEN_1ST, NEN_2ND, NEN_NONE, "AND" },
|
|
10
|
-
{ NODE_ARGS, NEN_REST, NEN_OPT,
|
|
11
|
-
{ NODE_ARGSCAT,
|
|
12
|
-
{ NODE_ARGSPUSH,
|
|
13
|
-
{ NODE_ARRAY,
|
|
14
|
-
{ NODE_ATTRASGN,
|
|
10
|
+
{ NODE_ARGS, NEN_CNT, NEN_REST, NEN_OPT, "ARGS" },
|
|
11
|
+
{ NODE_ARGSCAT, NEN_BODY, NEN_HEAD, NEN_NONE, "ARGSCAT" },
|
|
12
|
+
{ NODE_ARGSPUSH, NEN_BODY, NEN_HEAD, NEN_NONE, "ARGSPUSH" },
|
|
13
|
+
{ NODE_ARRAY, NEN_ALEN, NEN_NEXT, NEN_HEAD, "ARRAY" },
|
|
14
|
+
{ NODE_ATTRASGN, NEN_MID, NEN_RECV, NEN_ARGS, "ATTRASGN" },
|
|
15
15
|
{ NODE_ATTRSET, NEN_VID, NEN_NONE, NEN_NONE, "ATTRSET" },
|
|
16
16
|
{ NODE_BACK_REF, NEN_NTH, NEN_CNT, NEN_NONE, "BACK_REF" },
|
|
17
17
|
{ NODE_BEGIN, NEN_BODY, NEN_NONE, NEN_NONE, "BEGIN" },
|
|
18
|
-
{ NODE_BLOCK,
|
|
18
|
+
{ NODE_BLOCK, NEN_NEXT, NEN_HEAD, NEN_NONE, "BLOCK" },
|
|
19
19
|
{ NODE_BLOCK_ARG, NEN_CNT, NEN_NONE, NEN_NONE, "BLOCK_ARG" },
|
|
20
20
|
{ NODE_BLOCK_PASS, NEN_BODY, NEN_ITER, NEN_NONE, "BLOCK_PASS" },
|
|
21
21
|
{ NODE_BMETHOD, NEN_CVAL, NEN_NONE, NEN_NONE, "BMETHOD" },
|
|
22
22
|
{ NODE_BREAK, NEN_STTS, NEN_NONE, NEN_NONE, "BREAK" },
|
|
23
|
-
{ NODE_CALL,
|
|
24
|
-
{ NODE_CASE,
|
|
25
|
-
{ NODE_CDECL,
|
|
23
|
+
{ NODE_CALL, NEN_MID, NEN_RECV, NEN_ARGS, "CALL" },
|
|
24
|
+
{ NODE_CASE, NEN_BODY, NEN_NEXT, NEN_HEAD, "CASE" },
|
|
25
|
+
{ NODE_CDECL, NEN_VID, NEN_VALUE, NEN_NONE, "CDECL" },
|
|
26
26
|
{ NODE_CFUNC, NEN_CFNC, NEN_ARGC, NEN_NONE, "CFUNC" },
|
|
27
|
-
{ NODE_CLASS,
|
|
28
|
-
{ NODE_COLON2,
|
|
27
|
+
{ NODE_CLASS, NEN_BODY, NEN_SUPER, NEN_CPATH, "CLASS" },
|
|
28
|
+
{ NODE_COLON2, NEN_MID, NEN_HEAD, NEN_NONE, "COLON2" },
|
|
29
29
|
{ NODE_COLON3, NEN_MID, NEN_NONE, NEN_NONE, "COLON3" },
|
|
30
30
|
{ NODE_CONST, NEN_VID, NEN_NONE, NEN_NONE, "CONST" },
|
|
31
|
-
{ NODE_CREF, NEN_BODY,
|
|
31
|
+
{ NODE_CREF, NEN_BODY, NEN_CLSS, NEN_NEXT, "CREF" },
|
|
32
32
|
{ NODE_CVAR, NEN_VID, NEN_NONE, NEN_NONE, "CVAR" },
|
|
33
|
-
{ NODE_CVASGN,
|
|
34
|
-
{ NODE_CVDECL,
|
|
35
|
-
{ NODE_DASGN,
|
|
36
|
-
{ NODE_DASGN_CURR,
|
|
33
|
+
{ NODE_CVASGN, NEN_VID, NEN_VALUE, NEN_NONE, "CVASGN" },
|
|
34
|
+
{ NODE_CVDECL, NEN_VID, NEN_VALUE, NEN_NONE, "CVDECL" },
|
|
35
|
+
{ NODE_DASGN, NEN_VID, NEN_VALUE, NEN_NONE, "DASGN" },
|
|
36
|
+
{ NODE_DASGN_CURR, NEN_VID, NEN_VALUE, NEN_NONE, "DASGN_CURR" },
|
|
37
37
|
{ NODE_DEFINED, NEN_HEAD, NEN_NONE, NEN_NONE, "DEFINED" },
|
|
38
|
-
{ NODE_DEFN,
|
|
39
|
-
{ NODE_DEFS,
|
|
38
|
+
{ NODE_DEFN, NEN_NOEX, NEN_MID, NEN_DEFN, "DEFN" },
|
|
39
|
+
{ NODE_DEFS, NEN_MID, NEN_DEFN, NEN_RECV, "DEFS" },
|
|
40
40
|
{ NODE_DMETHOD, NEN_CVAL, NEN_NONE, NEN_NONE, "DMETHOD" },
|
|
41
|
-
{ NODE_DOT2,
|
|
42
|
-
{ NODE_DOT3,
|
|
43
|
-
{ NODE_DREGX, NEN_LIT,
|
|
44
|
-
{ NODE_DREGX_ONCE, NEN_LIT,
|
|
41
|
+
{ NODE_DOT2, NEN_STATE, NEN_END, NEN_BEG, "DOT2" },
|
|
42
|
+
{ NODE_DOT3, NEN_STATE, NEN_END, NEN_BEG, "DOT3" },
|
|
43
|
+
{ NODE_DREGX, NEN_LIT, NEN_NEXT, NEN_CFLAG, "DREGX" },
|
|
44
|
+
{ NODE_DREGX_ONCE, NEN_LIT, NEN_NEXT, NEN_CFLAG, "DREGX_ONCE" },
|
|
45
45
|
{ NODE_DSTR, NEN_LIT, NEN_NEXT, NEN_NONE, "DSTR" },
|
|
46
46
|
{ NODE_DSYM, NEN_LIT, NEN_NEXT, NEN_NONE, "DSYM" },
|
|
47
47
|
{ NODE_DVAR, NEN_VID, NEN_NONE, NEN_NONE, "DVAR" },
|
|
@@ -49,45 +49,45 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
|
|
|
49
49
|
{ NODE_ENSURE, NEN_HEAD, NEN_ENSR, NEN_NONE, "ENSURE" },
|
|
50
50
|
{ NODE_EVSTR, NEN_BODY, NEN_NONE, NEN_NONE, "EVSTR" },
|
|
51
51
|
{ NODE_FALSE, NEN_NONE, NEN_NONE, NEN_NONE, "FALSE" },
|
|
52
|
-
{ NODE_FBODY,
|
|
53
|
-
{ NODE_FCALL,
|
|
54
|
-
{ NODE_FLIP2,
|
|
55
|
-
{ NODE_FLIP3,
|
|
52
|
+
{ NODE_FBODY, NEN_MID, NEN_ORIG, NEN_HEAD, "FBODY" },
|
|
53
|
+
{ NODE_FCALL, NEN_MID, NEN_ARGS, NEN_NONE, "FCALL" },
|
|
54
|
+
{ NODE_FLIP2, NEN_CNT, NEN_END, NEN_BEG, "FLIP2" },
|
|
55
|
+
{ NODE_FLIP3, NEN_CNT, NEN_END, NEN_BEG, "FLIP3" },
|
|
56
56
|
{ NODE_FOR, NEN_BODY, NEN_ITER, NEN_VAR, "FOR" },
|
|
57
|
-
{ NODE_GASGN,
|
|
58
|
-
{ NODE_GVAR,
|
|
57
|
+
{ NODE_GASGN, NEN_ENTRY, NEN_VID, NEN_VALUE, "GASGN" },
|
|
58
|
+
{ NODE_GVAR, NEN_ENTRY, NEN_VID, NEN_NONE, "GVAR" },
|
|
59
59
|
{ NODE_HASH, NEN_HEAD, NEN_NONE, NEN_NONE, "HASH" },
|
|
60
|
-
{ NODE_IASGN,
|
|
61
|
-
{ NODE_IF,
|
|
62
|
-
{ NODE_IFUNC, NEN_CFNC, NEN_TVAL,
|
|
60
|
+
{ NODE_IASGN, NEN_VID, NEN_VALUE, NEN_NONE, "IASGN" },
|
|
61
|
+
{ NODE_IF, NEN_BODY, NEN_COND, NEN_ELSE, "IF" },
|
|
62
|
+
{ NODE_IFUNC, NEN_STATE, NEN_CFNC, NEN_TVAL, "IFUNC" },
|
|
63
63
|
{ NODE_ITER, NEN_BODY, NEN_ITER, NEN_VAR, "ITER" },
|
|
64
64
|
{ NODE_IVAR, NEN_VID, NEN_NONE, NEN_NONE, "IVAR" },
|
|
65
|
-
{ NODE_LASGN,
|
|
65
|
+
{ NODE_LASGN, NEN_CNT, NEN_VID, NEN_VALUE, "LASGN" },
|
|
66
66
|
{ NODE_LIT, NEN_LIT, NEN_NONE, NEN_NONE, "LIT" },
|
|
67
|
-
{ NODE_LVAR,
|
|
67
|
+
{ NODE_LVAR, NEN_CNT, NEN_VID, NEN_NONE, "LVAR" },
|
|
68
68
|
{ NODE_MASGN, NEN_ARGS, NEN_HEAD, NEN_VALUE, "MASGN" },
|
|
69
69
|
{ NODE_MATCH, NEN_LIT, NEN_VALUE, NEN_NONE, "MATCH" },
|
|
70
|
-
{ NODE_MATCH2,
|
|
71
|
-
{ NODE_MATCH3,
|
|
70
|
+
{ NODE_MATCH2, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH2" },
|
|
71
|
+
{ NODE_MATCH3, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH3" },
|
|
72
72
|
{ NODE_MEMO, NEN_NONE, NEN_NONE, NEN_NONE, "MEMO" },
|
|
73
73
|
{ NODE_METHOD, NEN_BODY, NEN_NOEX, NEN_NONE, "METHOD" },
|
|
74
|
-
{ NODE_MODULE,
|
|
74
|
+
{ NODE_MODULE, NEN_BODY, NEN_CPATH, NEN_NONE, "MODULE" },
|
|
75
75
|
{ NODE_NEWLINE, NEN_NEXT, NEN_NONE, NEN_NONE, "NEWLINE" },
|
|
76
76
|
{ NODE_NEXT, NEN_STTS, NEN_NONE, NEN_NONE, "NEXT" },
|
|
77
77
|
{ NODE_NIL, NEN_NONE, NEN_NONE, NEN_NONE, "NIL" },
|
|
78
78
|
{ NODE_NOT, NEN_BODY, NEN_NONE, NEN_NONE, "NOT" },
|
|
79
79
|
{ NODE_NTH_REF, NEN_NTH, NEN_CNT, NEN_NONE, "NTH_REF" },
|
|
80
80
|
{ NODE_OPT_N, NEN_BODY, NEN_NONE, NEN_NONE, "OPT_N" },
|
|
81
|
-
{ NODE_OP_ASGN1,
|
|
82
|
-
{ NODE_OP_ASGN2,
|
|
83
|
-
{ NODE_OP_ASGN2_ARG,
|
|
84
|
-
{ NODE_OP_ASGN_AND,
|
|
85
|
-
{ NODE_OP_ASGN_OR, NEN_AID,
|
|
81
|
+
{ NODE_OP_ASGN1, NEN_MID, NEN_RECV, NEN_ARGS, "OP_ASGN1" },
|
|
82
|
+
{ NODE_OP_ASGN2, NEN_RECV, NEN_NEXT, NEN_VALUE, "OP_ASGN2" },
|
|
83
|
+
{ NODE_OP_ASGN2_ARG, NEN_AID, NEN_MID, NEN_VID, "OP_ASGN2_ARG" },
|
|
84
|
+
{ NODE_OP_ASGN_AND, NEN_RECV, NEN_VALUE, NEN_NONE, "OP_ASGN_AND" },
|
|
85
|
+
{ NODE_OP_ASGN_OR, NEN_AID, NEN_RECV, NEN_VALUE, "OP_ASGN_OR" },
|
|
86
86
|
{ NODE_OR, NEN_1ST, NEN_2ND, NEN_NONE, "OR" },
|
|
87
87
|
{ NODE_POSTEXE, NEN_NONE, NEN_NONE, NEN_NONE, "POSTEXE" },
|
|
88
88
|
{ NODE_REDO, NEN_NONE, NEN_NONE, NEN_NONE, "REDO" },
|
|
89
|
-
{ NODE_RESBODY, NEN_HEAD, NEN_ARGS,
|
|
90
|
-
{ NODE_RESCUE, NEN_HEAD, NEN_ELSE,
|
|
89
|
+
{ NODE_RESBODY, NEN_BODY, NEN_HEAD, NEN_ARGS, "RESBODY" },
|
|
90
|
+
{ NODE_RESCUE, NEN_RESQ, NEN_HEAD, NEN_ELSE, "RESCUE" },
|
|
91
91
|
{ NODE_RETRY, NEN_NONE, NEN_NONE, NEN_NONE, "RETRY" },
|
|
92
92
|
{ NODE_RETURN, NEN_STTS, NEN_NONE, NEN_NONE, "RETURN" },
|
|
93
93
|
{ NODE_SCLASS, NEN_BODY, NEN_RECV, NEN_NONE, "SCLASS" },
|
|
@@ -100,13 +100,13 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
|
|
|
100
100
|
{ NODE_TO_ARY, NEN_HEAD, NEN_NONE, NEN_NONE, "TO_ARY" },
|
|
101
101
|
{ NODE_TRUE, NEN_NONE, NEN_NONE, NEN_NONE, "TRUE" },
|
|
102
102
|
{ NODE_UNDEF, NEN_BODY, NEN_NONE, NEN_NONE, "UNDEF" },
|
|
103
|
-
{ NODE_UNTIL, NEN_BODY,
|
|
103
|
+
{ NODE_UNTIL, NEN_BODY, NEN_STATE, NEN_COND, "UNTIL" },
|
|
104
104
|
{ NODE_VALIAS, NEN_1ST, NEN_2ND, NEN_NONE, "VALIAS" },
|
|
105
105
|
{ NODE_VCALL, NEN_MID, NEN_NONE, NEN_NONE, "VCALL" },
|
|
106
|
-
{ NODE_WHEN,
|
|
107
|
-
{ NODE_WHILE, NEN_BODY,
|
|
106
|
+
{ NODE_WHEN, NEN_BODY, NEN_NEXT, NEN_HEAD, "WHEN" },
|
|
107
|
+
{ NODE_WHILE, NEN_BODY, NEN_STATE, NEN_COND, "WHILE" },
|
|
108
108
|
{ NODE_XSTR, NEN_LIT, NEN_NONE, NEN_NONE, "XSTR" },
|
|
109
|
-
{ NODE_YIELD,
|
|
109
|
+
{ NODE_YIELD, NEN_STATE, NEN_HEAD, NEN_NONE, "YIELD" },
|
|
110
110
|
{ NODE_ZARRAY, NEN_NONE, NEN_NONE, NEN_NONE, "ZARRAY" },
|
|
111
111
|
{ NODE_ZSUPER, NEN_NONE, NEN_NONE, NEN_NONE, "ZSUPER" },
|
|
112
112
|
{ NODE_LAST, NEN_NONE, NEN_NONE, NEN_NONE, "LAST" },
|
|
@@ -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(
|
|
231
|
+
if(StringValuePtr(path)[0] == '#')
|
|
232
232
|
{
|
|
233
233
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
|
234
234
|
}
|
|
@@ -322,7 +322,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
|
322
322
|
else
|
|
323
323
|
{
|
|
324
324
|
path = rb_class_path(klass);
|
|
325
|
-
if(
|
|
325
|
+
if(StringValuePtr(path)[0] == '#')
|
|
326
326
|
{
|
|
327
327
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
|
328
328
|
}
|
|
@@ -565,7 +565,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
|
565
565
|
else
|
|
566
566
|
{
|
|
567
567
|
path = rb_class_path(klass);
|
|
568
|
-
if(
|
|
568
|
+
if(StringValuePtr(path)[0] == '#')
|
|
569
569
|
{
|
|
570
570
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
|
571
571
|
}
|
|
@@ -689,7 +689,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
|
689
689
|
else
|
|
690
690
|
{
|
|
691
691
|
path = rb_class_path(klass);
|
|
692
|
-
if(
|
|
692
|
+
if(StringValuePtr(path)[0] == '#')
|
|
693
693
|
{
|
|
694
694
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
|
695
695
|
}
|
|
@@ -897,7 +897,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
|
897
897
|
else
|
|
898
898
|
{
|
|
899
899
|
path = rb_class_path(klass);
|
|
900
|
-
if(
|
|
900
|
+
if(StringValuePtr(path)[0] == '#')
|
|
901
901
|
{
|
|
902
902
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
|
903
903
|
}
|
|
@@ -1152,20 +1152,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
|
1152
1152
|
}
|
|
1153
1153
|
case NEN_CLSS:
|
|
1154
1154
|
{
|
|
1155
|
+
int flags;
|
|
1155
1156
|
Check_Type(v, T_ARRAY);
|
|
1156
1157
|
if(RARRAY_LEN(v) != 2)
|
|
1157
1158
|
{
|
|
1158
1159
|
rb_raise(rb_eArgError, "wrong size for array");
|
|
1159
1160
|
}
|
|
1160
|
-
|
|
1161
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
|
1161
1162
|
switch(flags & T_MASK)
|
|
1162
1163
|
{
|
|
1163
1164
|
case T_CLASS:
|
|
1164
1165
|
case T_MODULE:
|
|
1165
1166
|
{
|
|
1166
|
-
VALUE str
|
|
1167
|
+
VALUE str, klass;
|
|
1168
|
+
|
|
1169
|
+
str = RARRAY_PTR(v)[1];
|
|
1167
1170
|
Check_Type(str, T_STRING);
|
|
1168
|
-
|
|
1171
|
+
klass = rb_path2class(StringValuePtr(str));
|
|
1169
1172
|
if(flags & FL_SINGLETON)
|
|
1170
1173
|
{
|
|
1171
1174
|
*(VALUE *)(&n->nd_clss) =
|
|
@@ -1241,20 +1244,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
|
1241
1244
|
}
|
|
1242
1245
|
case NEN_CVAL:
|
|
1243
1246
|
{
|
|
1247
|
+
int flags;
|
|
1244
1248
|
Check_Type(v, T_ARRAY);
|
|
1245
1249
|
if(RARRAY_LEN(v) != 2)
|
|
1246
1250
|
{
|
|
1247
1251
|
rb_raise(rb_eArgError, "wrong size for array");
|
|
1248
1252
|
}
|
|
1249
|
-
|
|
1253
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
|
1250
1254
|
switch(flags & T_MASK)
|
|
1251
1255
|
{
|
|
1252
1256
|
case T_CLASS:
|
|
1253
1257
|
case T_MODULE:
|
|
1254
1258
|
{
|
|
1255
|
-
VALUE str
|
|
1259
|
+
VALUE str, klass;
|
|
1260
|
+
|
|
1261
|
+
str = RARRAY_PTR(v)[1];
|
|
1256
1262
|
Check_Type(str, T_STRING);
|
|
1257
|
-
|
|
1263
|
+
klass = rb_path2class(StringValuePtr(str));
|
|
1258
1264
|
if(flags & FL_SINGLETON)
|
|
1259
1265
|
{
|
|
1260
1266
|
*(VALUE *)(&n->nd_cval) =
|
|
@@ -1480,20 +1486,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
|
1480
1486
|
}
|
|
1481
1487
|
case NEN_LIT:
|
|
1482
1488
|
{
|
|
1489
|
+
int flags;
|
|
1483
1490
|
Check_Type(v, T_ARRAY);
|
|
1484
1491
|
if(RARRAY_LEN(v) != 2)
|
|
1485
1492
|
{
|
|
1486
1493
|
rb_raise(rb_eArgError, "wrong size for array");
|
|
1487
1494
|
}
|
|
1488
|
-
|
|
1495
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
|
1489
1496
|
switch(flags & T_MASK)
|
|
1490
1497
|
{
|
|
1491
1498
|
case T_CLASS:
|
|
1492
1499
|
case T_MODULE:
|
|
1493
1500
|
{
|
|
1494
|
-
VALUE str
|
|
1501
|
+
VALUE str, klass;
|
|
1502
|
+
|
|
1503
|
+
str = RARRAY_PTR(v)[1];
|
|
1495
1504
|
Check_Type(str, T_STRING);
|
|
1496
|
-
|
|
1505
|
+
klass = rb_path2class(StringValuePtr(str));
|
|
1497
1506
|
if(flags & FL_SINGLETON)
|
|
1498
1507
|
{
|
|
1499
1508
|
*(VALUE *)(&n->nd_lit) =
|
|
@@ -1606,20 +1615,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
|
1606
1615
|
}
|
|
1607
1616
|
case NEN_ORIG:
|
|
1608
1617
|
{
|
|
1618
|
+
int flags;
|
|
1609
1619
|
Check_Type(v, T_ARRAY);
|
|
1610
1620
|
if(RARRAY_LEN(v) != 2)
|
|
1611
1621
|
{
|
|
1612
1622
|
rb_raise(rb_eArgError, "wrong size for array");
|
|
1613
1623
|
}
|
|
1614
|
-
|
|
1624
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
|
1615
1625
|
switch(flags & T_MASK)
|
|
1616
1626
|
{
|
|
1617
1627
|
case T_CLASS:
|
|
1618
1628
|
case T_MODULE:
|
|
1619
1629
|
{
|
|
1620
|
-
VALUE str
|
|
1630
|
+
VALUE str, klass;
|
|
1631
|
+
|
|
1632
|
+
str = RARRAY_PTR(v)[1];
|
|
1621
1633
|
Check_Type(str, T_STRING);
|
|
1622
|
-
|
|
1634
|
+
klass = rb_path2class(StringValuePtr(str));
|
|
1623
1635
|
if(flags & FL_SINGLETON)
|
|
1624
1636
|
{
|
|
1625
1637
|
*(VALUE *)(&n->nd_orig) =
|
|
@@ -1846,20 +1858,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
|
1846
1858
|
}
|
|
1847
1859
|
case NEN_TVAL:
|
|
1848
1860
|
{
|
|
1861
|
+
int flags;
|
|
1849
1862
|
Check_Type(v, T_ARRAY);
|
|
1850
1863
|
if(RARRAY_LEN(v) != 2)
|
|
1851
1864
|
{
|
|
1852
1865
|
rb_raise(rb_eArgError, "wrong size for array");
|
|
1853
1866
|
}
|
|
1854
|
-
|
|
1867
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
|
1855
1868
|
switch(flags & T_MASK)
|
|
1856
1869
|
{
|
|
1857
1870
|
case T_CLASS:
|
|
1858
1871
|
case T_MODULE:
|
|
1859
1872
|
{
|
|
1860
|
-
VALUE str
|
|
1873
|
+
VALUE str, klass;
|
|
1874
|
+
|
|
1875
|
+
str = RARRAY_PTR(v)[1];
|
|
1861
1876
|
Check_Type(str, T_STRING);
|
|
1862
|
-
|
|
1877
|
+
klass = rb_path2class(StringValuePtr(str));
|
|
1863
1878
|
if(flags & FL_SINGLETON)
|
|
1864
1879
|
{
|
|
1865
1880
|
*(VALUE *)(&n->nd_tval) =
|
|
@@ -2937,17 +2952,17 @@ void define_node_subclass_methods()
|
|
|
2937
2952
|
rb_define_method(rb_cALLOCA, "cfnc", node_cfnc, 0);
|
|
2938
2953
|
rb_ary_push(members, rb_str_new2("cfnc"));
|
|
2939
2954
|
|
|
2940
|
-
/* Document-method: value
|
|
2941
|
-
* a pointer to the previously allocated temporary node
|
|
2942
|
-
*/
|
|
2943
|
-
rb_define_method(rb_cALLOCA, "value", node_value, 0);
|
|
2944
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
2945
|
-
|
|
2946
2955
|
/* Document-method: cnt
|
|
2947
2956
|
* the number of bytes allocated
|
|
2948
2957
|
*/
|
|
2949
2958
|
rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
|
|
2950
2959
|
rb_ary_push(members, rb_str_new2("cnt"));
|
|
2960
|
+
|
|
2961
|
+
/* Document-method: value
|
|
2962
|
+
* a pointer to the previously allocated temporary node
|
|
2963
|
+
*/
|
|
2964
|
+
rb_define_method(rb_cALLOCA, "value", node_value, 0);
|
|
2965
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
2951
2966
|
}
|
|
2952
2967
|
#endif
|
|
2953
2968
|
|
|
@@ -2990,6 +3005,12 @@ void define_node_subclass_methods()
|
|
|
2990
3005
|
rb_iv_set(rb_cARGS, "__type__", INT2NUM(NODE_ARGS));
|
|
2991
3006
|
rb_define_singleton_method(rb_cARGS, "members", node_s_members, 0);
|
|
2992
3007
|
|
|
3008
|
+
/* Document-method: cnt
|
|
3009
|
+
* the number of required arguments
|
|
3010
|
+
*/
|
|
3011
|
+
rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
|
|
3012
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
|
3013
|
+
|
|
2993
3014
|
/* Document-method: rest
|
|
2994
3015
|
* an assignment node to assign the rest arg, if it is present
|
|
2995
3016
|
*/
|
|
@@ -3002,12 +3023,6 @@ void define_node_subclass_methods()
|
|
|
3002
3023
|
*/
|
|
3003
3024
|
rb_define_method(rb_cARGS, "opt", node_opt, 0);
|
|
3004
3025
|
rb_ary_push(members, rb_str_new2("opt"));
|
|
3005
|
-
|
|
3006
|
-
/* Document-method: cnt
|
|
3007
|
-
* the number of required arguments
|
|
3008
|
-
*/
|
|
3009
|
-
rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
|
|
3010
|
-
rb_ary_push(members, rb_str_new2("cnt"));
|
|
3011
3026
|
}
|
|
3012
3027
|
|
|
3013
3028
|
/* Document-class: Node::ARGSCAT
|
|
@@ -3027,18 +3042,18 @@ void define_node_subclass_methods()
|
|
|
3027
3042
|
rb_iv_set(rb_cARGSCAT, "__type__", INT2NUM(NODE_ARGSCAT));
|
|
3028
3043
|
rb_define_singleton_method(rb_cARGSCAT, "members", node_s_members, 0);
|
|
3029
3044
|
|
|
3030
|
-
/* Document-method: head
|
|
3031
|
-
* a list of fixed arguments
|
|
3032
|
-
*/
|
|
3033
|
-
rb_define_method(rb_cARGSCAT, "head", node_head, 0);
|
|
3034
|
-
rb_ary_push(members, rb_str_new2("head"));
|
|
3035
|
-
|
|
3036
3045
|
/* Document-method: body
|
|
3037
3046
|
* the last argument, which will be splatted onto the end of the
|
|
3038
3047
|
* fixed arguments
|
|
3039
3048
|
*/
|
|
3040
3049
|
rb_define_method(rb_cARGSCAT, "body", node_body, 0);
|
|
3041
3050
|
rb_ary_push(members, rb_str_new2("body"));
|
|
3051
|
+
|
|
3052
|
+
/* Document-method: head
|
|
3053
|
+
* a list of fixed arguments
|
|
3054
|
+
*/
|
|
3055
|
+
rb_define_method(rb_cARGSCAT, "head", node_head, 0);
|
|
3056
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
3042
3057
|
}
|
|
3043
3058
|
|
|
3044
3059
|
/* Document-class: Node::ARGSPUSH
|
|
@@ -3055,10 +3070,10 @@ void define_node_subclass_methods()
|
|
|
3055
3070
|
rb_iv_set(rb_cARGSPUSH, "__member__", members);
|
|
3056
3071
|
rb_iv_set(rb_cARGSPUSH, "__type__", INT2NUM(NODE_ARGSPUSH));
|
|
3057
3072
|
rb_define_singleton_method(rb_cARGSPUSH, "members", node_s_members, 0);
|
|
3058
|
-
rb_define_method(rb_cARGSPUSH, "head", node_head, 0);
|
|
3059
|
-
rb_ary_push(members, rb_str_new2("head"));
|
|
3060
3073
|
rb_define_method(rb_cARGSPUSH, "body", node_body, 0);
|
|
3061
3074
|
rb_ary_push(members, rb_str_new2("body"));
|
|
3075
|
+
rb_define_method(rb_cARGSPUSH, "head", node_head, 0);
|
|
3076
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
3062
3077
|
}
|
|
3063
3078
|
|
|
3064
3079
|
/* Document-class: Node::ARRAY
|
|
@@ -3073,12 +3088,6 @@ void define_node_subclass_methods()
|
|
|
3073
3088
|
rb_iv_set(rb_cARRAY, "__member__", members);
|
|
3074
3089
|
rb_iv_set(rb_cARRAY, "__type__", INT2NUM(NODE_ARRAY));
|
|
3075
3090
|
rb_define_singleton_method(rb_cARRAY, "members", node_s_members, 0);
|
|
3076
|
-
|
|
3077
|
-
/* Document-method: head
|
|
3078
|
-
* the first element of the array
|
|
3079
|
-
*/
|
|
3080
|
-
rb_define_method(rb_cARRAY, "head", node_head, 0);
|
|
3081
|
-
rb_ary_push(members, rb_str_new2("head"));
|
|
3082
3091
|
rb_define_method(rb_cARRAY, "alen", node_alen, 0);
|
|
3083
3092
|
rb_ary_push(members, rb_str_new2("alen"));
|
|
3084
3093
|
|
|
@@ -3087,6 +3096,12 @@ void define_node_subclass_methods()
|
|
|
3087
3096
|
*/
|
|
3088
3097
|
rb_define_method(rb_cARRAY, "next", node_next, 0);
|
|
3089
3098
|
rb_ary_push(members, rb_str_new2("next"));
|
|
3099
|
+
|
|
3100
|
+
/* Document-method: head
|
|
3101
|
+
* the first element of the array
|
|
3102
|
+
*/
|
|
3103
|
+
rb_define_method(rb_cARRAY, "head", node_head, 0);
|
|
3104
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
3090
3105
|
}
|
|
3091
3106
|
|
|
3092
3107
|
/* Document-class: Node::ATTRASGN
|
|
@@ -3103,12 +3118,6 @@ void define_node_subclass_methods()
|
|
|
3103
3118
|
rb_iv_set(rb_cATTRASGN, "__type__", INT2NUM(NODE_ATTRASGN));
|
|
3104
3119
|
rb_define_singleton_method(rb_cATTRASGN, "members", node_s_members, 0);
|
|
3105
3120
|
|
|
3106
|
-
/* Document-method: args
|
|
3107
|
-
* the arguments to the method
|
|
3108
|
-
*/
|
|
3109
|
-
rb_define_method(rb_cATTRASGN, "args", node_args, 0);
|
|
3110
|
-
rb_ary_push(members, rb_str_new2("args"));
|
|
3111
|
-
|
|
3112
3121
|
/* Document-method: mid
|
|
3113
3122
|
* the id of the attribute, with a trailing '=' sign
|
|
3114
3123
|
*/
|
|
@@ -3120,6 +3129,12 @@ void define_node_subclass_methods()
|
|
|
3120
3129
|
*/
|
|
3121
3130
|
rb_define_method(rb_cATTRASGN, "recv", node_recv, 0);
|
|
3122
3131
|
rb_ary_push(members, rb_str_new2("recv"));
|
|
3132
|
+
|
|
3133
|
+
/* Document-method: args
|
|
3134
|
+
* the arguments to the method
|
|
3135
|
+
*/
|
|
3136
|
+
rb_define_method(rb_cATTRASGN, "args", node_args, 0);
|
|
3137
|
+
rb_ary_push(members, rb_str_new2("args"));
|
|
3123
3138
|
}
|
|
3124
3139
|
|
|
3125
3140
|
/* Document-class: Node::ATTRSET
|
|
@@ -3207,17 +3222,17 @@ void define_node_subclass_methods()
|
|
|
3207
3222
|
rb_iv_set(rb_cBLOCK, "__type__", INT2NUM(NODE_BLOCK));
|
|
3208
3223
|
rb_define_singleton_method(rb_cBLOCK, "members", node_s_members, 0);
|
|
3209
3224
|
|
|
3210
|
-
/* Document-method: head
|
|
3211
|
-
* the first expression in the block of code
|
|
3212
|
-
*/
|
|
3213
|
-
rb_define_method(rb_cBLOCK, "head", node_head, 0);
|
|
3214
|
-
rb_ary_push(members, rb_str_new2("head"));
|
|
3215
|
-
|
|
3216
3225
|
/* Document-method: next
|
|
3217
3226
|
* the second expression in the block of code
|
|
3218
3227
|
*/
|
|
3219
3228
|
rb_define_method(rb_cBLOCK, "next", node_next, 0);
|
|
3220
3229
|
rb_ary_push(members, rb_str_new2("next"));
|
|
3230
|
+
|
|
3231
|
+
/* Document-method: head
|
|
3232
|
+
* the first expression in the block of code
|
|
3233
|
+
*/
|
|
3234
|
+
rb_define_method(rb_cBLOCK, "head", node_head, 0);
|
|
3235
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
3221
3236
|
}
|
|
3222
3237
|
|
|
3223
3238
|
/* Document-class: Node::BLOCK_ARG
|
|
@@ -3325,12 +3340,6 @@ void define_node_subclass_methods()
|
|
|
3325
3340
|
rb_iv_set(rb_cCALL, "__type__", INT2NUM(NODE_CALL));
|
|
3326
3341
|
rb_define_singleton_method(rb_cCALL, "members", node_s_members, 0);
|
|
3327
3342
|
|
|
3328
|
-
/* Document-method: args
|
|
3329
|
-
* the arguments to the method
|
|
3330
|
-
*/
|
|
3331
|
-
rb_define_method(rb_cCALL, "args", node_args, 0);
|
|
3332
|
-
rb_ary_push(members, rb_str_new2("args"));
|
|
3333
|
-
|
|
3334
3343
|
/* Document-method: mid
|
|
3335
3344
|
* the method id
|
|
3336
3345
|
*/
|
|
@@ -3342,6 +3351,12 @@ void define_node_subclass_methods()
|
|
|
3342
3351
|
*/
|
|
3343
3352
|
rb_define_method(rb_cCALL, "recv", node_recv, 0);
|
|
3344
3353
|
rb_ary_push(members, rb_str_new2("recv"));
|
|
3354
|
+
|
|
3355
|
+
/* Document-method: args
|
|
3356
|
+
* the arguments to the method
|
|
3357
|
+
*/
|
|
3358
|
+
rb_define_method(rb_cCALL, "args", node_args, 0);
|
|
3359
|
+
rb_ary_push(members, rb_str_new2("args"));
|
|
3345
3360
|
}
|
|
3346
3361
|
|
|
3347
3362
|
/* Document-class: Node::CASE
|
|
@@ -3359,12 +3374,6 @@ void define_node_subclass_methods()
|
|
|
3359
3374
|
rb_iv_set(rb_cCASE, "__type__", INT2NUM(NODE_CASE));
|
|
3360
3375
|
rb_define_singleton_method(rb_cCASE, "members", node_s_members, 0);
|
|
3361
3376
|
|
|
3362
|
-
/* Document-method: head
|
|
3363
|
-
* the value to select on
|
|
3364
|
-
*/
|
|
3365
|
-
rb_define_method(rb_cCASE, "head", node_head, 0);
|
|
3366
|
-
rb_ary_push(members, rb_str_new2("head"));
|
|
3367
|
-
|
|
3368
3377
|
/* Document-method: body
|
|
3369
3378
|
* a linked list of nodes, each node representing a when
|
|
3370
3379
|
* conditional
|
|
@@ -3373,6 +3382,12 @@ void define_node_subclass_methods()
|
|
|
3373
3382
|
rb_ary_push(members, rb_str_new2("body"));
|
|
3374
3383
|
rb_define_method(rb_cCASE, "next", node_next, 0);
|
|
3375
3384
|
rb_ary_push(members, rb_str_new2("next"));
|
|
3385
|
+
|
|
3386
|
+
/* Document-method: head
|
|
3387
|
+
* the value to select on
|
|
3388
|
+
*/
|
|
3389
|
+
rb_define_method(rb_cCASE, "head", node_head, 0);
|
|
3390
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
3376
3391
|
}
|
|
3377
3392
|
|
|
3378
3393
|
/* Document-class: Node::CDECL
|
|
@@ -3387,17 +3402,17 @@ void define_node_subclass_methods()
|
|
|
3387
3402
|
rb_iv_set(rb_cCDECL, "__type__", INT2NUM(NODE_CDECL));
|
|
3388
3403
|
rb_define_singleton_method(rb_cCDECL, "members", node_s_members, 0);
|
|
3389
3404
|
|
|
3390
|
-
/* Document-method: value
|
|
3391
|
-
* the value to be assigned to the constant
|
|
3392
|
-
*/
|
|
3393
|
-
rb_define_method(rb_cCDECL, "value", node_value, 0);
|
|
3394
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
3395
|
-
|
|
3396
3405
|
/* Document-method: vid
|
|
3397
3406
|
* the name of the constant to be assigned, all uppercase
|
|
3398
3407
|
*/
|
|
3399
3408
|
rb_define_method(rb_cCDECL, "vid", node_vid, 0);
|
|
3400
3409
|
rb_ary_push(members, rb_str_new2("vid"));
|
|
3410
|
+
|
|
3411
|
+
/* Document-method: value
|
|
3412
|
+
* the value to be assigned to the constant
|
|
3413
|
+
*/
|
|
3414
|
+
rb_define_method(rb_cCDECL, "value", node_value, 0);
|
|
3415
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
3401
3416
|
}
|
|
3402
3417
|
|
|
3403
3418
|
/* Document-class: Node::CFUNC
|
|
@@ -3440,12 +3455,6 @@ void define_node_subclass_methods()
|
|
|
3440
3455
|
rb_iv_set(rb_cCLASS, "__type__", INT2NUM(NODE_CLASS));
|
|
3441
3456
|
rb_define_singleton_method(rb_cCLASS, "members", node_s_members, 0);
|
|
3442
3457
|
|
|
3443
|
-
/* Document-method: cpath
|
|
3444
|
-
* the name of the class to define
|
|
3445
|
-
*/
|
|
3446
|
-
rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
|
|
3447
|
-
rb_ary_push(members, rb_str_new2("cpath"));
|
|
3448
|
-
|
|
3449
3458
|
/* Document-method: body
|
|
3450
3459
|
* the body of the class definition
|
|
3451
3460
|
*/
|
|
@@ -3458,6 +3467,12 @@ void define_node_subclass_methods()
|
|
|
3458
3467
|
*/
|
|
3459
3468
|
rb_define_method(rb_cCLASS, "super", node_super, 0);
|
|
3460
3469
|
rb_ary_push(members, rb_str_new2("super"));
|
|
3470
|
+
|
|
3471
|
+
/* Document-method: cpath
|
|
3472
|
+
* the name of the class to define
|
|
3473
|
+
*/
|
|
3474
|
+
rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
|
|
3475
|
+
rb_ary_push(members, rb_str_new2("cpath"));
|
|
3461
3476
|
}
|
|
3462
3477
|
|
|
3463
3478
|
/* Document-class: Node::COLON2
|
|
@@ -3476,17 +3491,17 @@ void define_node_subclass_methods()
|
|
|
3476
3491
|
rb_iv_set(rb_cCOLON2, "__type__", INT2NUM(NODE_COLON2));
|
|
3477
3492
|
rb_define_singleton_method(rb_cCOLON2, "members", node_s_members, 0);
|
|
3478
3493
|
|
|
3479
|
-
/* Document-method: head
|
|
3480
|
-
* an expression specifying the class in which to do the lookup
|
|
3481
|
-
*/
|
|
3482
|
-
rb_define_method(rb_cCOLON2, "head", node_head, 0);
|
|
3483
|
-
rb_ary_push(members, rb_str_new2("head"));
|
|
3484
|
-
|
|
3485
3494
|
/* Document-method: mid
|
|
3486
3495
|
* the name of the method or constant to call/look up
|
|
3487
3496
|
*/
|
|
3488
3497
|
rb_define_method(rb_cCOLON2, "mid", node_mid, 0);
|
|
3489
3498
|
rb_ary_push(members, rb_str_new2("mid"));
|
|
3499
|
+
|
|
3500
|
+
/* Document-method: head
|
|
3501
|
+
* an expression specifying the class in which to do the lookup
|
|
3502
|
+
*/
|
|
3503
|
+
rb_define_method(rb_cCOLON2, "head", node_head, 0);
|
|
3504
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
3490
3505
|
}
|
|
3491
3506
|
|
|
3492
3507
|
/* Document-class: Node::COLON3
|
|
@@ -3551,17 +3566,17 @@ void define_node_subclass_methods()
|
|
|
3551
3566
|
rb_define_method(rb_cCREF, "body", node_body, 0);
|
|
3552
3567
|
rb_ary_push(members, rb_str_new2("body"));
|
|
3553
3568
|
|
|
3554
|
-
/* Document-method: next
|
|
3555
|
-
* the previous value of ruby_cref or ruby_top_cref
|
|
3556
|
-
*/
|
|
3557
|
-
rb_define_method(rb_cCREF, "next", node_next, 0);
|
|
3558
|
-
rb_ary_push(members, rb_str_new2("next"));
|
|
3559
|
-
|
|
3560
3569
|
/* Document-method: clss
|
|
3561
3570
|
* the new class to use for the cbase.
|
|
3562
3571
|
*/
|
|
3563
3572
|
rb_define_method(rb_cCREF, "clss", node_clss, 0);
|
|
3564
3573
|
rb_ary_push(members, rb_str_new2("clss"));
|
|
3574
|
+
|
|
3575
|
+
/* Document-method: next
|
|
3576
|
+
* the previous value of ruby_cref or ruby_top_cref
|
|
3577
|
+
*/
|
|
3578
|
+
rb_define_method(rb_cCREF, "next", node_next, 0);
|
|
3579
|
+
rb_ary_push(members, rb_str_new2("next"));
|
|
3565
3580
|
}
|
|
3566
3581
|
|
|
3567
3582
|
/* Document-class: Node::CVAR
|
|
@@ -3594,18 +3609,18 @@ void define_node_subclass_methods()
|
|
|
3594
3609
|
rb_iv_set(rb_cCVASGN, "__type__", INT2NUM(NODE_CVASGN));
|
|
3595
3610
|
rb_define_singleton_method(rb_cCVASGN, "members", node_s_members, 0);
|
|
3596
3611
|
|
|
3612
|
+
/* Document-method: vid
|
|
3613
|
+
* the name of the class variable to assign
|
|
3614
|
+
*/
|
|
3615
|
+
rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
|
|
3616
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
|
3617
|
+
|
|
3597
3618
|
/* Document-method: value
|
|
3598
3619
|
* an expression whose result is the new value of the class
|
|
3599
3620
|
* variable
|
|
3600
3621
|
*/
|
|
3601
3622
|
rb_define_method(rb_cCVASGN, "value", node_value, 0);
|
|
3602
3623
|
rb_ary_push(members, rb_str_new2("value"));
|
|
3603
|
-
|
|
3604
|
-
/* Document-method: vid
|
|
3605
|
-
* the name of the class variable to assign
|
|
3606
|
-
*/
|
|
3607
|
-
rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
|
|
3608
|
-
rb_ary_push(members, rb_str_new2("vid"));
|
|
3609
3624
|
}
|
|
3610
3625
|
|
|
3611
3626
|
/* Document-class: Node::CVDECL
|
|
@@ -3621,18 +3636,18 @@ void define_node_subclass_methods()
|
|
|
3621
3636
|
rb_iv_set(rb_cCVDECL, "__type__", INT2NUM(NODE_CVDECL));
|
|
3622
3637
|
rb_define_singleton_method(rb_cCVDECL, "members", node_s_members, 0);
|
|
3623
3638
|
|
|
3639
|
+
/* Document-method: vid
|
|
3640
|
+
* the name of the class variable to assign
|
|
3641
|
+
*/
|
|
3642
|
+
rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
|
|
3643
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
|
3644
|
+
|
|
3624
3645
|
/* Document-method: value
|
|
3625
3646
|
* an expression whose result is the new value of the class
|
|
3626
3647
|
* variable
|
|
3627
3648
|
*/
|
|
3628
3649
|
rb_define_method(rb_cCVDECL, "value", node_value, 0);
|
|
3629
3650
|
rb_ary_push(members, rb_str_new2("value"));
|
|
3630
|
-
|
|
3631
|
-
/* Document-method: vid
|
|
3632
|
-
* the name of the class variable to assign
|
|
3633
|
-
*/
|
|
3634
|
-
rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
|
|
3635
|
-
rb_ary_push(members, rb_str_new2("vid"));
|
|
3636
3651
|
}
|
|
3637
3652
|
|
|
3638
3653
|
/* Document-class: Node::DASGN
|
|
@@ -3655,17 +3670,17 @@ void define_node_subclass_methods()
|
|
|
3655
3670
|
rb_iv_set(rb_cDASGN, "__type__", INT2NUM(NODE_DASGN));
|
|
3656
3671
|
rb_define_singleton_method(rb_cDASGN, "members", node_s_members, 0);
|
|
3657
3672
|
|
|
3658
|
-
/* Document-method: value
|
|
3659
|
-
* the value to assign to the local variable
|
|
3660
|
-
*/
|
|
3661
|
-
rb_define_method(rb_cDASGN, "value", node_value, 0);
|
|
3662
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
3663
|
-
|
|
3664
3673
|
/* Document-method: vid
|
|
3665
3674
|
* the name of the local variable
|
|
3666
3675
|
*/
|
|
3667
3676
|
rb_define_method(rb_cDASGN, "vid", node_vid, 0);
|
|
3668
3677
|
rb_ary_push(members, rb_str_new2("vid"));
|
|
3678
|
+
|
|
3679
|
+
/* Document-method: value
|
|
3680
|
+
* the value to assign to the local variable
|
|
3681
|
+
*/
|
|
3682
|
+
rb_define_method(rb_cDASGN, "value", node_value, 0);
|
|
3683
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
3669
3684
|
}
|
|
3670
3685
|
|
|
3671
3686
|
/* Document-class: Node::DASGN_CURR
|
|
@@ -3680,17 +3695,17 @@ void define_node_subclass_methods()
|
|
|
3680
3695
|
rb_iv_set(rb_cDASGN_CURR, "__type__", INT2NUM(NODE_DASGN_CURR));
|
|
3681
3696
|
rb_define_singleton_method(rb_cDASGN_CURR, "members", node_s_members, 0);
|
|
3682
3697
|
|
|
3683
|
-
/* Document-method: value
|
|
3684
|
-
* the value to assign to the local variable
|
|
3685
|
-
*/
|
|
3686
|
-
rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
|
|
3687
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
3688
|
-
|
|
3689
3698
|
/* Document-method: vid
|
|
3690
3699
|
* the name of the local variable
|
|
3691
3700
|
*/
|
|
3692
3701
|
rb_define_method(rb_cDASGN_CURR, "vid", node_vid, 0);
|
|
3693
3702
|
rb_ary_push(members, rb_str_new2("vid"));
|
|
3703
|
+
|
|
3704
|
+
/* Document-method: value
|
|
3705
|
+
* the value to assign to the local variable
|
|
3706
|
+
*/
|
|
3707
|
+
rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
|
|
3708
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
3694
3709
|
}
|
|
3695
3710
|
|
|
3696
3711
|
/* Document-class: Node::DEFINED
|
|
@@ -3726,11 +3741,11 @@ void define_node_subclass_methods()
|
|
|
3726
3741
|
rb_iv_set(rb_cDEFN, "__type__", INT2NUM(NODE_DEFN));
|
|
3727
3742
|
rb_define_singleton_method(rb_cDEFN, "members", node_s_members, 0);
|
|
3728
3743
|
|
|
3729
|
-
/* Document-method:
|
|
3730
|
-
* the
|
|
3744
|
+
/* Document-method: noex
|
|
3745
|
+
* the flags which should be used to define the method
|
|
3731
3746
|
*/
|
|
3732
|
-
rb_define_method(rb_cDEFN, "
|
|
3733
|
-
rb_ary_push(members, rb_str_new2("
|
|
3747
|
+
rb_define_method(rb_cDEFN, "noex", node_noex, 0);
|
|
3748
|
+
rb_ary_push(members, rb_str_new2("noex"));
|
|
3734
3749
|
|
|
3735
3750
|
/* Document-method: mid
|
|
3736
3751
|
* the name of the method* defn the body of the method
|
|
@@ -3738,11 +3753,11 @@ void define_node_subclass_methods()
|
|
|
3738
3753
|
rb_define_method(rb_cDEFN, "mid", node_mid, 0);
|
|
3739
3754
|
rb_ary_push(members, rb_str_new2("mid"));
|
|
3740
3755
|
|
|
3741
|
-
/* Document-method:
|
|
3742
|
-
* the
|
|
3756
|
+
/* Document-method: defn
|
|
3757
|
+
* the body of the method definition
|
|
3743
3758
|
*/
|
|
3744
|
-
rb_define_method(rb_cDEFN, "
|
|
3745
|
-
rb_ary_push(members, rb_str_new2("
|
|
3759
|
+
rb_define_method(rb_cDEFN, "defn", node_defn, 0);
|
|
3760
|
+
rb_ary_push(members, rb_str_new2("defn"));
|
|
3746
3761
|
}
|
|
3747
3762
|
|
|
3748
3763
|
/* Document-class: Node::DEFS
|
|
@@ -3758,14 +3773,14 @@ void define_node_subclass_methods()
|
|
|
3758
3773
|
rb_iv_set(rb_cDEFS, "__member__", members);
|
|
3759
3774
|
rb_iv_set(rb_cDEFS, "__type__", INT2NUM(NODE_DEFS));
|
|
3760
3775
|
rb_define_singleton_method(rb_cDEFS, "members", node_s_members, 0);
|
|
3761
|
-
rb_define_method(rb_cDEFS, "defn", node_defn, 0);
|
|
3762
|
-
rb_ary_push(members, rb_str_new2("defn"));
|
|
3763
3776
|
|
|
3764
3777
|
/* Document-method: mid
|
|
3765
3778
|
* the name of the method* defn the body of the method
|
|
3766
3779
|
*/
|
|
3767
3780
|
rb_define_method(rb_cDEFS, "mid", node_mid, 0);
|
|
3768
3781
|
rb_ary_push(members, rb_str_new2("mid"));
|
|
3782
|
+
rb_define_method(rb_cDEFS, "defn", node_defn, 0);
|
|
3783
|
+
rb_ary_push(members, rb_str_new2("defn"));
|
|
3769
3784
|
|
|
3770
3785
|
/* Document-method: recv
|
|
3771
3786
|
* the object to whose singleton class the new method is to be added
|
|
@@ -3809,20 +3824,20 @@ void define_node_subclass_methods()
|
|
|
3809
3824
|
rb_iv_set(rb_cDOT2, "__member__", members);
|
|
3810
3825
|
rb_iv_set(rb_cDOT2, "__type__", INT2NUM(NODE_DOT2));
|
|
3811
3826
|
rb_define_singleton_method(rb_cDOT2, "members", node_s_members, 0);
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
* the beginning of the range
|
|
3815
|
-
*/
|
|
3816
|
-
rb_define_method(rb_cDOT2, "beg", node_beg, 0);
|
|
3817
|
-
rb_ary_push(members, rb_str_new2("beg"));
|
|
3827
|
+
rb_define_method(rb_cDOT2, "state", node_state, 0);
|
|
3828
|
+
rb_ary_push(members, rb_str_new2("state"));
|
|
3818
3829
|
|
|
3819
3830
|
/* Document-method: end
|
|
3820
3831
|
* the end of the range
|
|
3821
3832
|
*/
|
|
3822
3833
|
rb_define_method(rb_cDOT2, "end", node_end, 0);
|
|
3823
3834
|
rb_ary_push(members, rb_str_new2("end"));
|
|
3824
|
-
|
|
3825
|
-
|
|
3835
|
+
|
|
3836
|
+
/* Document-method: beg
|
|
3837
|
+
* the beginning of the range
|
|
3838
|
+
*/
|
|
3839
|
+
rb_define_method(rb_cDOT2, "beg", node_beg, 0);
|
|
3840
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
|
3826
3841
|
}
|
|
3827
3842
|
|
|
3828
3843
|
/* Document-class: Node::DOT3
|
|
@@ -3837,20 +3852,20 @@ void define_node_subclass_methods()
|
|
|
3837
3852
|
rb_iv_set(rb_cDOT3, "__member__", members);
|
|
3838
3853
|
rb_iv_set(rb_cDOT3, "__type__", INT2NUM(NODE_DOT3));
|
|
3839
3854
|
rb_define_singleton_method(rb_cDOT3, "members", node_s_members, 0);
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
* the beginning of the range
|
|
3843
|
-
*/
|
|
3844
|
-
rb_define_method(rb_cDOT3, "beg", node_beg, 0);
|
|
3845
|
-
rb_ary_push(members, rb_str_new2("beg"));
|
|
3855
|
+
rb_define_method(rb_cDOT3, "state", node_state, 0);
|
|
3856
|
+
rb_ary_push(members, rb_str_new2("state"));
|
|
3846
3857
|
|
|
3847
3858
|
/* Document-method: end
|
|
3848
3859
|
* the end of the range
|
|
3849
3860
|
*/
|
|
3850
3861
|
rb_define_method(rb_cDOT3, "end", node_end, 0);
|
|
3851
3862
|
rb_ary_push(members, rb_str_new2("end"));
|
|
3852
|
-
|
|
3853
|
-
|
|
3863
|
+
|
|
3864
|
+
/* Document-method: beg
|
|
3865
|
+
* the beginning of the range
|
|
3866
|
+
*/
|
|
3867
|
+
rb_define_method(rb_cDOT3, "beg", node_beg, 0);
|
|
3868
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
|
3854
3869
|
}
|
|
3855
3870
|
|
|
3856
3871
|
/* Document-class: Node::DREGX
|
|
@@ -3875,9 +3890,15 @@ void define_node_subclass_methods()
|
|
|
3875
3890
|
rb_define_method(rb_cDREGX, "lit", node_lit, 0);
|
|
3876
3891
|
rb_ary_push(members, rb_str_new2("lit"));
|
|
3877
3892
|
|
|
3878
|
-
/* Document-method:
|
|
3879
|
-
* a
|
|
3880
|
-
|
|
3893
|
+
/* Document-method: next
|
|
3894
|
+
* a list of expressions to be appended onto the string
|
|
3895
|
+
*/
|
|
3896
|
+
rb_define_method(rb_cDREGX, "next", node_next, 0);
|
|
3897
|
+
rb_ary_push(members, rb_str_new2("next"));
|
|
3898
|
+
|
|
3899
|
+
/* Document-method: cflag
|
|
3900
|
+
* a bitfield containing the options used in the regular
|
|
3901
|
+
* expression. Valid values include:
|
|
3881
3902
|
* * RE_OPTION_IGNORECASE
|
|
3882
3903
|
* * RE_OPTION_EXTENDED
|
|
3883
3904
|
* * RE_OPTION_MULTILINE
|
|
@@ -3891,12 +3912,6 @@ void define_node_subclass_methods()
|
|
|
3891
3912
|
*/
|
|
3892
3913
|
rb_define_method(rb_cDREGX, "cflag", node_cflag, 0);
|
|
3893
3914
|
rb_ary_push(members, rb_str_new2("cflag"));
|
|
3894
|
-
|
|
3895
|
-
/* Document-method: next
|
|
3896
|
-
* a list of expressions to be appended onto the string
|
|
3897
|
-
*/
|
|
3898
|
-
rb_define_method(rb_cDREGX, "next", node_next, 0);
|
|
3899
|
-
rb_ary_push(members, rb_str_new2("next"));
|
|
3900
3915
|
}
|
|
3901
3916
|
|
|
3902
3917
|
/* Document-class: Node::DREGX_ONCE
|
|
@@ -3918,18 +3933,18 @@ void define_node_subclass_methods()
|
|
|
3918
3933
|
rb_define_method(rb_cDREGX_ONCE, "lit", node_lit, 0);
|
|
3919
3934
|
rb_ary_push(members, rb_str_new2("lit"));
|
|
3920
3935
|
|
|
3936
|
+
/* Document-method: next
|
|
3937
|
+
* a list of expressions to be appended onto the string
|
|
3938
|
+
*/
|
|
3939
|
+
rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
|
|
3940
|
+
rb_ary_push(members, rb_str_new2("next"));
|
|
3941
|
+
|
|
3921
3942
|
/* Document-method: cflag
|
|
3922
3943
|
* a bitfield containing the options used in the regular
|
|
3923
3944
|
* expression. See DREGX for a list of valid values.
|
|
3924
3945
|
*/
|
|
3925
3946
|
rb_define_method(rb_cDREGX_ONCE, "cflag", node_cflag, 0);
|
|
3926
3947
|
rb_ary_push(members, rb_str_new2("cflag"));
|
|
3927
|
-
|
|
3928
|
-
/* Document-method: next
|
|
3929
|
-
* a list of expressions to be appended onto the string
|
|
3930
|
-
*/
|
|
3931
|
-
rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
|
|
3932
|
-
rb_ary_push(members, rb_str_new2("next"));
|
|
3933
3948
|
}
|
|
3934
3949
|
|
|
3935
3950
|
/* Document-class: Node::DSTR
|
|
@@ -4119,11 +4134,11 @@ void define_node_subclass_methods()
|
|
|
4119
4134
|
rb_iv_set(rb_cFBODY, "__type__", INT2NUM(NODE_FBODY));
|
|
4120
4135
|
rb_define_singleton_method(rb_cFBODY, "members", node_s_members, 0);
|
|
4121
4136
|
|
|
4122
|
-
/* Document-method:
|
|
4123
|
-
* the method
|
|
4137
|
+
/* Document-method: mid
|
|
4138
|
+
* the name of the method
|
|
4124
4139
|
*/
|
|
4125
|
-
rb_define_method(rb_cFBODY, "
|
|
4126
|
-
rb_ary_push(members, rb_str_new2("
|
|
4140
|
+
rb_define_method(rb_cFBODY, "mid", node_mid, 0);
|
|
4141
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
|
4127
4142
|
|
|
4128
4143
|
/* Document-method: orig
|
|
4129
4144
|
* the origin class
|
|
@@ -4131,11 +4146,11 @@ void define_node_subclass_methods()
|
|
|
4131
4146
|
rb_define_method(rb_cFBODY, "orig", node_orig, 0);
|
|
4132
4147
|
rb_ary_push(members, rb_str_new2("orig"));
|
|
4133
4148
|
|
|
4134
|
-
/* Document-method:
|
|
4135
|
-
* the
|
|
4149
|
+
/* Document-method: head
|
|
4150
|
+
* the method body
|
|
4136
4151
|
*/
|
|
4137
|
-
rb_define_method(rb_cFBODY, "
|
|
4138
|
-
rb_ary_push(members, rb_str_new2("
|
|
4152
|
+
rb_define_method(rb_cFBODY, "head", node_head, 0);
|
|
4153
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
4139
4154
|
}
|
|
4140
4155
|
|
|
4141
4156
|
/* Document-class: Node::FCALL
|
|
@@ -4153,17 +4168,17 @@ void define_node_subclass_methods()
|
|
|
4153
4168
|
rb_iv_set(rb_cFCALL, "__type__", INT2NUM(NODE_FCALL));
|
|
4154
4169
|
rb_define_singleton_method(rb_cFCALL, "members", node_s_members, 0);
|
|
4155
4170
|
|
|
4156
|
-
/* Document-method: args
|
|
4157
|
-
* the arguments to the method
|
|
4158
|
-
*/
|
|
4159
|
-
rb_define_method(rb_cFCALL, "args", node_args, 0);
|
|
4160
|
-
rb_ary_push(members, rb_str_new2("args"));
|
|
4161
|
-
|
|
4162
4171
|
/* Document-method: mid
|
|
4163
4172
|
* the method id
|
|
4164
4173
|
*/
|
|
4165
4174
|
rb_define_method(rb_cFCALL, "mid", node_mid, 0);
|
|
4166
4175
|
rb_ary_push(members, rb_str_new2("mid"));
|
|
4176
|
+
|
|
4177
|
+
/* Document-method: args
|
|
4178
|
+
* the arguments to the method
|
|
4179
|
+
*/
|
|
4180
|
+
rb_define_method(rb_cFCALL, "args", node_args, 0);
|
|
4181
|
+
rb_ary_push(members, rb_str_new2("args"));
|
|
4167
4182
|
}
|
|
4168
4183
|
|
|
4169
4184
|
/* Document-class: Node::FLIP2
|
|
@@ -4180,11 +4195,12 @@ void define_node_subclass_methods()
|
|
|
4180
4195
|
rb_iv_set(rb_cFLIP2, "__type__", INT2NUM(NODE_FLIP2));
|
|
4181
4196
|
rb_define_singleton_method(rb_cFLIP2, "members", node_s_members, 0);
|
|
4182
4197
|
|
|
4183
|
-
/* Document-method:
|
|
4184
|
-
* the
|
|
4198
|
+
/* Document-method: cnt
|
|
4199
|
+
* the index into the local variable table of the special variable
|
|
4200
|
+
* to use in the flip-flop expression (usually 2 for $_)
|
|
4185
4201
|
*/
|
|
4186
|
-
rb_define_method(rb_cFLIP2, "
|
|
4187
|
-
rb_ary_push(members, rb_str_new2("
|
|
4202
|
+
rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
|
|
4203
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
|
4188
4204
|
|
|
4189
4205
|
/* Document-method: end
|
|
4190
4206
|
* the end of the range
|
|
@@ -4192,12 +4208,11 @@ void define_node_subclass_methods()
|
|
|
4192
4208
|
rb_define_method(rb_cFLIP2, "end", node_end, 0);
|
|
4193
4209
|
rb_ary_push(members, rb_str_new2("end"));
|
|
4194
4210
|
|
|
4195
|
-
/* Document-method:
|
|
4196
|
-
* the
|
|
4197
|
-
* to use in the flip-flop expression (usually 2 for $_)
|
|
4211
|
+
/* Document-method: beg
|
|
4212
|
+
* the beginning of the range
|
|
4198
4213
|
*/
|
|
4199
|
-
rb_define_method(rb_cFLIP2, "
|
|
4200
|
-
rb_ary_push(members, rb_str_new2("
|
|
4214
|
+
rb_define_method(rb_cFLIP2, "beg", node_beg, 0);
|
|
4215
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
|
4201
4216
|
}
|
|
4202
4217
|
|
|
4203
4218
|
/* Document-class: Node::FLIP3
|
|
@@ -4214,11 +4229,12 @@ void define_node_subclass_methods()
|
|
|
4214
4229
|
rb_iv_set(rb_cFLIP3, "__type__", INT2NUM(NODE_FLIP3));
|
|
4215
4230
|
rb_define_singleton_method(rb_cFLIP3, "members", node_s_members, 0);
|
|
4216
4231
|
|
|
4217
|
-
/* Document-method:
|
|
4218
|
-
* the
|
|
4232
|
+
/* Document-method: cnt
|
|
4233
|
+
* the index into the local variable table of the special variable
|
|
4234
|
+
* to use in the flip-flop expression (usually 2 for $_)
|
|
4219
4235
|
*/
|
|
4220
|
-
rb_define_method(rb_cFLIP3, "
|
|
4221
|
-
rb_ary_push(members, rb_str_new2("
|
|
4236
|
+
rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
|
|
4237
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
|
4222
4238
|
|
|
4223
4239
|
/* Document-method: end
|
|
4224
4240
|
* the end of the range
|
|
@@ -4226,12 +4242,11 @@ void define_node_subclass_methods()
|
|
|
4226
4242
|
rb_define_method(rb_cFLIP3, "end", node_end, 0);
|
|
4227
4243
|
rb_ary_push(members, rb_str_new2("end"));
|
|
4228
4244
|
|
|
4229
|
-
/* Document-method:
|
|
4230
|
-
* the
|
|
4231
|
-
* to use in the flip-flop expression (usually 2 for $_)
|
|
4245
|
+
/* Document-method: beg
|
|
4246
|
+
* the beginning of the range
|
|
4232
4247
|
*/
|
|
4233
|
-
rb_define_method(rb_cFLIP3, "
|
|
4234
|
-
rb_ary_push(members, rb_str_new2("
|
|
4248
|
+
rb_define_method(rb_cFLIP3, "beg", node_beg, 0);
|
|
4249
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
|
4235
4250
|
}
|
|
4236
4251
|
|
|
4237
4252
|
/* Document-class: Node::FOR
|
|
@@ -4287,20 +4302,20 @@ void define_node_subclass_methods()
|
|
|
4287
4302
|
rb_iv_set(rb_cGASGN, "__member__", members);
|
|
4288
4303
|
rb_iv_set(rb_cGASGN, "__type__", INT2NUM(NODE_GASGN));
|
|
4289
4304
|
rb_define_singleton_method(rb_cGASGN, "members", node_s_members, 0);
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
* an expression whose result is the new value of the global variable
|
|
4293
|
-
*/
|
|
4294
|
-
rb_define_method(rb_cGASGN, "value", node_value, 0);
|
|
4295
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
4305
|
+
rb_define_method(rb_cGASGN, "entry", node_entry, 0);
|
|
4306
|
+
rb_ary_push(members, rb_str_new2("entry"));
|
|
4296
4307
|
|
|
4297
4308
|
/* Document-method: vid
|
|
4298
4309
|
* the name of the global variable, with a leading '$' character.
|
|
4299
4310
|
*/
|
|
4300
4311
|
rb_define_method(rb_cGASGN, "vid", node_vid, 0);
|
|
4301
4312
|
rb_ary_push(members, rb_str_new2("vid"));
|
|
4302
|
-
|
|
4303
|
-
|
|
4313
|
+
|
|
4314
|
+
/* Document-method: value
|
|
4315
|
+
* an expression whose result is the new value of the global variable
|
|
4316
|
+
*/
|
|
4317
|
+
rb_define_method(rb_cGASGN, "value", node_value, 0);
|
|
4318
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
4304
4319
|
}
|
|
4305
4320
|
|
|
4306
4321
|
/* Document-class: Node::GVAR
|
|
@@ -4313,14 +4328,14 @@ void define_node_subclass_methods()
|
|
|
4313
4328
|
rb_iv_set(rb_cGVAR, "__member__", members);
|
|
4314
4329
|
rb_iv_set(rb_cGVAR, "__type__", INT2NUM(NODE_GVAR));
|
|
4315
4330
|
rb_define_singleton_method(rb_cGVAR, "members", node_s_members, 0);
|
|
4331
|
+
rb_define_method(rb_cGVAR, "entry", node_entry, 0);
|
|
4332
|
+
rb_ary_push(members, rb_str_new2("entry"));
|
|
4316
4333
|
|
|
4317
4334
|
/* Document-method: vid
|
|
4318
4335
|
* the name of the global variable to retrieve, with a leading '$'
|
|
4319
4336
|
*/
|
|
4320
4337
|
rb_define_method(rb_cGVAR, "vid", node_vid, 0);
|
|
4321
4338
|
rb_ary_push(members, rb_str_new2("vid"));
|
|
4322
|
-
rb_define_method(rb_cGVAR, "entry", node_entry, 0);
|
|
4323
|
-
rb_ary_push(members, rb_str_new2("entry"));
|
|
4324
4339
|
}
|
|
4325
4340
|
|
|
4326
4341
|
/* Document-class: Node::HASH
|
|
@@ -4353,17 +4368,17 @@ void define_node_subclass_methods()
|
|
|
4353
4368
|
rb_iv_set(rb_cIASGN, "__type__", INT2NUM(NODE_IASGN));
|
|
4354
4369
|
rb_define_singleton_method(rb_cIASGN, "members", node_s_members, 0);
|
|
4355
4370
|
|
|
4356
|
-
/* Document-method: value
|
|
4357
|
-
* the value to assign to the instance variable
|
|
4358
|
-
*/
|
|
4359
|
-
rb_define_method(rb_cIASGN, "value", node_value, 0);
|
|
4360
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
4361
|
-
|
|
4362
4371
|
/* Document-method: vid
|
|
4363
4372
|
* the name of the instance variable, with a leading '@' sign
|
|
4364
4373
|
*/
|
|
4365
4374
|
rb_define_method(rb_cIASGN, "vid", node_vid, 0);
|
|
4366
4375
|
rb_ary_push(members, rb_str_new2("vid"));
|
|
4376
|
+
|
|
4377
|
+
/* Document-method: value
|
|
4378
|
+
* the value to assign to the instance variable
|
|
4379
|
+
*/
|
|
4380
|
+
rb_define_method(rb_cIASGN, "value", node_value, 0);
|
|
4381
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
4367
4382
|
}
|
|
4368
4383
|
|
|
4369
4384
|
/* Document-class: Node::IF
|
|
@@ -4395,12 +4410,6 @@ void define_node_subclass_methods()
|
|
|
4395
4410
|
rb_iv_set(rb_cIF, "__type__", INT2NUM(NODE_IF));
|
|
4396
4411
|
rb_define_singleton_method(rb_cIF, "members", node_s_members, 0);
|
|
4397
4412
|
|
|
4398
|
-
/* Document-method: cond
|
|
4399
|
-
* the condition to evaluate
|
|
4400
|
-
*/
|
|
4401
|
-
rb_define_method(rb_cIF, "cond", node_cond, 0);
|
|
4402
|
-
rb_ary_push(members, rb_str_new2("cond"));
|
|
4403
|
-
|
|
4404
4413
|
/* Document-method: body
|
|
4405
4414
|
* the expression to evaluate if the expression is true, or false
|
|
4406
4415
|
* if the expression is empty
|
|
@@ -4408,6 +4417,12 @@ void define_node_subclass_methods()
|
|
|
4408
4417
|
rb_define_method(rb_cIF, "body", node_body, 0);
|
|
4409
4418
|
rb_ary_push(members, rb_str_new2("body"));
|
|
4410
4419
|
|
|
4420
|
+
/* Document-method: cond
|
|
4421
|
+
* the condition to evaluate
|
|
4422
|
+
*/
|
|
4423
|
+
rb_define_method(rb_cIF, "cond", node_cond, 0);
|
|
4424
|
+
rb_ary_push(members, rb_str_new2("cond"));
|
|
4425
|
+
|
|
4411
4426
|
/* Document-method: else
|
|
4412
4427
|
* the expression to evaluate if the expression is false, or false
|
|
4413
4428
|
* if the expression is empty
|
|
@@ -4427,6 +4442,12 @@ void define_node_subclass_methods()
|
|
|
4427
4442
|
rb_iv_set(rb_cIFUNC, "__type__", INT2NUM(NODE_IFUNC));
|
|
4428
4443
|
rb_define_singleton_method(rb_cIFUNC, "members", node_s_members, 0);
|
|
4429
4444
|
|
|
4445
|
+
/* Document-method: state
|
|
4446
|
+
* always 0
|
|
4447
|
+
*/
|
|
4448
|
+
rb_define_method(rb_cIFUNC, "state", node_state, 0);
|
|
4449
|
+
rb_ary_push(members, rb_str_new2("state"));
|
|
4450
|
+
|
|
4430
4451
|
/* Document-method: cfnc
|
|
4431
4452
|
* a pointer to the C function to which to yield
|
|
4432
4453
|
*/
|
|
@@ -4439,12 +4460,6 @@ void define_node_subclass_methods()
|
|
|
4439
4460
|
*/
|
|
4440
4461
|
rb_define_method(rb_cIFUNC, "tval", node_tval, 0);
|
|
4441
4462
|
rb_ary_push(members, rb_str_new2("tval"));
|
|
4442
|
-
|
|
4443
|
-
/* Document-method: state
|
|
4444
|
-
* always 0
|
|
4445
|
-
*/
|
|
4446
|
-
rb_define_method(rb_cIFUNC, "state", node_state, 0);
|
|
4447
|
-
rb_ary_push(members, rb_str_new2("state"));
|
|
4448
4463
|
}
|
|
4449
4464
|
|
|
4450
4465
|
/* Document-class: Node::ITER
|
|
@@ -4521,20 +4536,20 @@ void define_node_subclass_methods()
|
|
|
4521
4536
|
rb_iv_set(rb_cLASGN, "__member__", members);
|
|
4522
4537
|
rb_iv_set(rb_cLASGN, "__type__", INT2NUM(NODE_LASGN));
|
|
4523
4538
|
rb_define_singleton_method(rb_cLASGN, "members", node_s_members, 0);
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
* the value to assign to the local variable
|
|
4527
|
-
*/
|
|
4528
|
-
rb_define_method(rb_cLASGN, "value", node_value, 0);
|
|
4529
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
4539
|
+
rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
|
|
4540
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
|
4530
4541
|
|
|
4531
4542
|
/* Document-method: vid
|
|
4532
4543
|
* the name of the local variable
|
|
4533
4544
|
*/
|
|
4534
4545
|
rb_define_method(rb_cLASGN, "vid", node_vid, 0);
|
|
4535
4546
|
rb_ary_push(members, rb_str_new2("vid"));
|
|
4536
|
-
|
|
4537
|
-
|
|
4547
|
+
|
|
4548
|
+
/* Document-method: value
|
|
4549
|
+
* the value to assign to the local variable
|
|
4550
|
+
*/
|
|
4551
|
+
rb_define_method(rb_cLASGN, "value", node_value, 0);
|
|
4552
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
4538
4553
|
}
|
|
4539
4554
|
|
|
4540
4555
|
/* Document-class: Node::LIT
|
|
@@ -4566,14 +4581,14 @@ void define_node_subclass_methods()
|
|
|
4566
4581
|
rb_iv_set(rb_cLVAR, "__member__", members);
|
|
4567
4582
|
rb_iv_set(rb_cLVAR, "__type__", INT2NUM(NODE_LVAR));
|
|
4568
4583
|
rb_define_singleton_method(rb_cLVAR, "members", node_s_members, 0);
|
|
4584
|
+
rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
|
|
4585
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
|
4569
4586
|
|
|
4570
4587
|
/* Document-method: vid
|
|
4571
4588
|
* the name of the local variable to retrieve.
|
|
4572
4589
|
*/
|
|
4573
4590
|
rb_define_method(rb_cLVAR, "vid", node_vid, 0);
|
|
4574
4591
|
rb_ary_push(members, rb_str_new2("vid"));
|
|
4575
|
-
rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
|
|
4576
|
-
rb_ary_push(members, rb_str_new2("cnt"));
|
|
4577
4592
|
}
|
|
4578
4593
|
|
|
4579
4594
|
/* Document-class: Node::MASGN
|
|
@@ -4666,6 +4681,13 @@ void define_node_subclass_methods()
|
|
|
4666
4681
|
rb_iv_set(rb_cMATCH2, "__type__", INT2NUM(NODE_MATCH2));
|
|
4667
4682
|
rb_define_singleton_method(rb_cMATCH2, "members", node_s_members, 0);
|
|
4668
4683
|
|
|
4684
|
+
/* Document-method: recv
|
|
4685
|
+
* the regular expression on the left hand side of the match
|
|
4686
|
+
* operator
|
|
4687
|
+
*/
|
|
4688
|
+
rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
|
|
4689
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
|
4690
|
+
|
|
4669
4691
|
/* Document-method: value
|
|
4670
4692
|
* the expression on the right hand side of the match operator, or
|
|
4671
4693
|
* an expression returning $_ if there is nothing on the right hand
|
|
@@ -4673,13 +4695,6 @@ void define_node_subclass_methods()
|
|
|
4673
4695
|
*/
|
|
4674
4696
|
rb_define_method(rb_cMATCH2, "value", node_value, 0);
|
|
4675
4697
|
rb_ary_push(members, rb_str_new2("value"));
|
|
4676
|
-
|
|
4677
|
-
/* Document-method: recv
|
|
4678
|
-
* the regular expression on the left hand side of the match
|
|
4679
|
-
* operator
|
|
4680
|
-
*/
|
|
4681
|
-
rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
|
|
4682
|
-
rb_ary_push(members, rb_str_new2("recv"));
|
|
4683
4698
|
}
|
|
4684
4699
|
|
|
4685
4700
|
/* Document-class: Node::MATCH3
|
|
@@ -4697,17 +4712,17 @@ void define_node_subclass_methods()
|
|
|
4697
4712
|
rb_iv_set(rb_cMATCH3, "__type__", INT2NUM(NODE_MATCH3));
|
|
4698
4713
|
rb_define_singleton_method(rb_cMATCH3, "members", node_s_members, 0);
|
|
4699
4714
|
|
|
4700
|
-
/* Document-method: value
|
|
4701
|
-
* the right hand side of the match
|
|
4702
|
-
*/
|
|
4703
|
-
rb_define_method(rb_cMATCH3, "value", node_value, 0);
|
|
4704
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
4705
|
-
|
|
4706
4715
|
/* Document-method: recv
|
|
4707
4716
|
* the left hand side of the match
|
|
4708
4717
|
*/
|
|
4709
4718
|
rb_define_method(rb_cMATCH3, "recv", node_recv, 0);
|
|
4710
4719
|
rb_ary_push(members, rb_str_new2("recv"));
|
|
4720
|
+
|
|
4721
|
+
/* Document-method: value
|
|
4722
|
+
* the right hand side of the match
|
|
4723
|
+
*/
|
|
4724
|
+
rb_define_method(rb_cMATCH3, "value", node_value, 0);
|
|
4725
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
4711
4726
|
}
|
|
4712
4727
|
|
|
4713
4728
|
/* Document-class: Node::MEMO
|
|
@@ -4776,17 +4791,17 @@ void define_node_subclass_methods()
|
|
|
4776
4791
|
rb_iv_set(rb_cMODULE, "__type__", INT2NUM(NODE_MODULE));
|
|
4777
4792
|
rb_define_singleton_method(rb_cMODULE, "members", node_s_members, 0);
|
|
4778
4793
|
|
|
4779
|
-
/* Document-method: cpath
|
|
4780
|
-
* the name of the module to define
|
|
4781
|
-
*/
|
|
4782
|
-
rb_define_method(rb_cMODULE, "cpath", node_cpath, 0);
|
|
4783
|
-
rb_ary_push(members, rb_str_new2("cpath"));
|
|
4784
|
-
|
|
4785
4794
|
/* Document-method: body
|
|
4786
4795
|
* the body of the module definition
|
|
4787
4796
|
*/
|
|
4788
4797
|
rb_define_method(rb_cMODULE, "body", node_body, 0);
|
|
4789
4798
|
rb_ary_push(members, rb_str_new2("body"));
|
|
4799
|
+
|
|
4800
|
+
/* Document-method: cpath
|
|
4801
|
+
* the name of the module to define
|
|
4802
|
+
*/
|
|
4803
|
+
rb_define_method(rb_cMODULE, "cpath", node_cpath, 0);
|
|
4804
|
+
rb_ary_push(members, rb_str_new2("cpath"));
|
|
4790
4805
|
}
|
|
4791
4806
|
|
|
4792
4807
|
/* Document-class: Node::NEWLINE
|
|
@@ -4928,12 +4943,6 @@ void define_node_subclass_methods()
|
|
|
4928
4943
|
rb_iv_set(rb_cOP_ASGN1, "__type__", INT2NUM(NODE_OP_ASGN1));
|
|
4929
4944
|
rb_define_singleton_method(rb_cOP_ASGN1, "members", node_s_members, 0);
|
|
4930
4945
|
|
|
4931
|
-
/* Document-method: args
|
|
4932
|
-
* the arguments to the assigment
|
|
4933
|
-
*/
|
|
4934
|
-
rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
|
|
4935
|
-
rb_ary_push(members, rb_str_new2("args"));
|
|
4936
|
-
|
|
4937
4946
|
/* Document-method: mid
|
|
4938
4947
|
* 0, 1, or the name a method to call to calculate the value of the
|
|
4939
4948
|
* rhs
|
|
@@ -4946,6 +4955,12 @@ void define_node_subclass_methods()
|
|
|
4946
4955
|
*/
|
|
4947
4956
|
rb_define_method(rb_cOP_ASGN1, "recv", node_recv, 0);
|
|
4948
4957
|
rb_ary_push(members, rb_str_new2("recv"));
|
|
4958
|
+
|
|
4959
|
+
/* Document-method: args
|
|
4960
|
+
* the arguments to the assigment
|
|
4961
|
+
*/
|
|
4962
|
+
rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
|
|
4963
|
+
rb_ary_push(members, rb_str_new2("args"));
|
|
4949
4964
|
}
|
|
4950
4965
|
|
|
4951
4966
|
/* Document-class: Node::OP_ASGN2
|
|
@@ -4968,11 +4983,11 @@ void define_node_subclass_methods()
|
|
|
4968
4983
|
rb_iv_set(rb_cOP_ASGN2, "__type__", INT2NUM(NODE_OP_ASGN2));
|
|
4969
4984
|
rb_define_singleton_method(rb_cOP_ASGN2, "members", node_s_members, 0);
|
|
4970
4985
|
|
|
4971
|
-
/* Document-method:
|
|
4972
|
-
* the
|
|
4986
|
+
/* Document-method: recv
|
|
4987
|
+
* the receiver of the attribute
|
|
4973
4988
|
*/
|
|
4974
|
-
rb_define_method(rb_cOP_ASGN2, "
|
|
4975
|
-
rb_ary_push(members, rb_str_new2("
|
|
4989
|
+
rb_define_method(rb_cOP_ASGN2, "recv", node_recv, 0);
|
|
4990
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
|
4976
4991
|
|
|
4977
4992
|
/* Document-method: next
|
|
4978
4993
|
* another node of type OP_ASGN2 which contains more information
|
|
@@ -4981,11 +4996,11 @@ void define_node_subclass_methods()
|
|
|
4981
4996
|
rb_define_method(rb_cOP_ASGN2, "next", node_next, 0);
|
|
4982
4997
|
rb_ary_push(members, rb_str_new2("next"));
|
|
4983
4998
|
|
|
4984
|
-
/* Document-method:
|
|
4985
|
-
* the
|
|
4999
|
+
/* Document-method: value
|
|
5000
|
+
* the value to assign to the attribute
|
|
4986
5001
|
*/
|
|
4987
|
-
rb_define_method(rb_cOP_ASGN2, "
|
|
4988
|
-
rb_ary_push(members, rb_str_new2("
|
|
5002
|
+
rb_define_method(rb_cOP_ASGN2, "value", node_value, 0);
|
|
5003
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
4989
5004
|
}
|
|
4990
5005
|
|
|
4991
5006
|
/* Document-class: Node::OP_ASGN2_ARG
|
|
@@ -5001,12 +5016,6 @@ void define_node_subclass_methods()
|
|
|
5001
5016
|
rb_iv_set(rb_cOP_ASGN2_ARG, "__type__", INT2NUM(NODE_OP_ASGN2_ARG));
|
|
5002
5017
|
rb_define_singleton_method(rb_cOP_ASGN2_ARG, "members", node_s_members, 0);
|
|
5003
5018
|
|
|
5004
|
-
/* Document-method: vid
|
|
5005
|
-
* The method to call on the receiver to retrieve the attribute
|
|
5006
|
-
*/
|
|
5007
|
-
rb_define_method(rb_cOP_ASGN2_ARG, "vid", node_vid, 0);
|
|
5008
|
-
rb_ary_push(members, rb_str_new2("vid"));
|
|
5009
|
-
|
|
5010
5019
|
/* Document-method: aid
|
|
5011
5020
|
* The method to call on the receiver to set the attribute
|
|
5012
5021
|
*/
|
|
@@ -5020,6 +5029,12 @@ void define_node_subclass_methods()
|
|
|
5020
5029
|
*/
|
|
5021
5030
|
rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
|
|
5022
5031
|
rb_ary_push(members, rb_str_new2("mid"));
|
|
5032
|
+
|
|
5033
|
+
/* Document-method: vid
|
|
5034
|
+
* The method to call on the receiver to retrieve the attribute
|
|
5035
|
+
*/
|
|
5036
|
+
rb_define_method(rb_cOP_ASGN2_ARG, "vid", node_vid, 0);
|
|
5037
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
|
5023
5038
|
}
|
|
5024
5039
|
|
|
5025
5040
|
/* Document-class: Node::OP_ASGN_AND
|
|
@@ -5038,18 +5053,18 @@ void define_node_subclass_methods()
|
|
|
5038
5053
|
rb_iv_set(rb_cOP_ASGN_AND, "__type__", INT2NUM(NODE_OP_ASGN_AND));
|
|
5039
5054
|
rb_define_singleton_method(rb_cOP_ASGN_AND, "members", node_s_members, 0);
|
|
5040
5055
|
|
|
5056
|
+
/* Document-method: recv
|
|
5057
|
+
* an expression representing the left hand side of the assignment
|
|
5058
|
+
*/
|
|
5059
|
+
rb_define_method(rb_cOP_ASGN_AND, "recv", node_recv, 0);
|
|
5060
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
|
5061
|
+
|
|
5041
5062
|
/* Document-method: value
|
|
5042
5063
|
* an expression representing the assignment that should be
|
|
5043
5064
|
* performed if the left hand side is true
|
|
5044
5065
|
*/
|
|
5045
5066
|
rb_define_method(rb_cOP_ASGN_AND, "value", node_value, 0);
|
|
5046
5067
|
rb_ary_push(members, rb_str_new2("value"));
|
|
5047
|
-
|
|
5048
|
-
/* Document-method: recv
|
|
5049
|
-
* an expression representing the left hand side of the assignment
|
|
5050
|
-
*/
|
|
5051
|
-
rb_define_method(rb_cOP_ASGN_AND, "recv", node_recv, 0);
|
|
5052
|
-
rb_ary_push(members, rb_str_new2("recv"));
|
|
5053
5068
|
}
|
|
5054
5069
|
|
|
5055
5070
|
/* Document-class: Node::OP_ASGN_OR
|
|
@@ -5076,17 +5091,17 @@ void define_node_subclass_methods()
|
|
|
5076
5091
|
rb_define_method(rb_cOP_ASGN_OR, "aid", node_aid, 0);
|
|
5077
5092
|
rb_ary_push(members, rb_str_new2("aid"));
|
|
5078
5093
|
|
|
5079
|
-
/* Document-method: value
|
|
5080
|
-
* the right hand side of the assignment
|
|
5081
|
-
*/
|
|
5082
|
-
rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
|
|
5083
|
-
rb_ary_push(members, rb_str_new2("value"));
|
|
5084
|
-
|
|
5085
5094
|
/* Document-method: recv
|
|
5086
5095
|
* the receiver of the assignment
|
|
5087
5096
|
*/
|
|
5088
5097
|
rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
|
|
5089
5098
|
rb_ary_push(members, rb_str_new2("recv"));
|
|
5099
|
+
|
|
5100
|
+
/* Document-method: value
|
|
5101
|
+
* the right hand side of the assignment
|
|
5102
|
+
*/
|
|
5103
|
+
rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
|
|
5104
|
+
rb_ary_push(members, rb_str_new2("value"));
|
|
5090
5105
|
}
|
|
5091
5106
|
|
|
5092
5107
|
/* Document-class: Node::OR
|
|
@@ -5166,6 +5181,12 @@ void define_node_subclass_methods()
|
|
|
5166
5181
|
rb_iv_set(rb_cRESBODY, "__type__", INT2NUM(NODE_RESBODY));
|
|
5167
5182
|
rb_define_singleton_method(rb_cRESBODY, "members", node_s_members, 0);
|
|
5168
5183
|
|
|
5184
|
+
/* Document-method: body
|
|
5185
|
+
* the expresion to evaluate if the exception type matches
|
|
5186
|
+
*/
|
|
5187
|
+
rb_define_method(rb_cRESBODY, "body", node_body, 0);
|
|
5188
|
+
rb_ary_push(members, rb_str_new2("body"));
|
|
5189
|
+
|
|
5169
5190
|
/* Document-method: head
|
|
5170
5191
|
* the next rescue
|
|
5171
5192
|
*/
|
|
@@ -5177,12 +5198,6 @@ void define_node_subclass_methods()
|
|
|
5177
5198
|
*/
|
|
5178
5199
|
rb_define_method(rb_cRESBODY, "args", node_args, 0);
|
|
5179
5200
|
rb_ary_push(members, rb_str_new2("args"));
|
|
5180
|
-
|
|
5181
|
-
/* Document-method: body
|
|
5182
|
-
* the expresion to evaluate if the exception type matches
|
|
5183
|
-
*/
|
|
5184
|
-
rb_define_method(rb_cRESBODY, "body", node_body, 0);
|
|
5185
|
-
rb_ary_push(members, rb_str_new2("body"));
|
|
5186
5201
|
}
|
|
5187
5202
|
|
|
5188
5203
|
/* Document-class: Node::RESCUE
|
|
@@ -5222,6 +5237,12 @@ void define_node_subclass_methods()
|
|
|
5222
5237
|
rb_iv_set(rb_cRESCUE, "__type__", INT2NUM(NODE_RESCUE));
|
|
5223
5238
|
rb_define_singleton_method(rb_cRESCUE, "members", node_s_members, 0);
|
|
5224
5239
|
|
|
5240
|
+
/* Document-method: resq
|
|
5241
|
+
* the expression to be evaluated if an exception is raised
|
|
5242
|
+
*/
|
|
5243
|
+
rb_define_method(rb_cRESCUE, "resq", node_resq, 0);
|
|
5244
|
+
rb_ary_push(members, rb_str_new2("resq"));
|
|
5245
|
+
|
|
5225
5246
|
/* Document-method: head
|
|
5226
5247
|
* the body of the block to evaluate
|
|
5227
5248
|
*/
|
|
@@ -5233,12 +5254,6 @@ void define_node_subclass_methods()
|
|
|
5233
5254
|
*/
|
|
5234
5255
|
rb_define_method(rb_cRESCUE, "else", node_else, 0);
|
|
5235
5256
|
rb_ary_push(members, rb_str_new2("else"));
|
|
5236
|
-
|
|
5237
|
-
/* Document-method: resq
|
|
5238
|
-
* the expression to be evaluated if an exception is raised
|
|
5239
|
-
*/
|
|
5240
|
-
rb_define_method(rb_cRESCUE, "resq", node_resq, 0);
|
|
5241
|
-
rb_ary_push(members, rb_str_new2("resq"));
|
|
5242
5257
|
}
|
|
5243
5258
|
|
|
5244
5259
|
/* Document-class: Node::RETRY
|
|
@@ -5519,14 +5534,14 @@ void define_node_subclass_methods()
|
|
|
5519
5534
|
*/
|
|
5520
5535
|
rb_define_method(rb_cUNTIL, "body", node_body, 0);
|
|
5521
5536
|
rb_ary_push(members, rb_str_new2("body"));
|
|
5537
|
+
rb_define_method(rb_cUNTIL, "state", node_state, 0);
|
|
5538
|
+
rb_ary_push(members, rb_str_new2("state"));
|
|
5522
5539
|
|
|
5523
5540
|
/* Document-method: cond
|
|
5524
5541
|
* a condition to terminate the loop when it becomes true
|
|
5525
5542
|
*/
|
|
5526
5543
|
rb_define_method(rb_cUNTIL, "cond", node_cond, 0);
|
|
5527
5544
|
rb_ary_push(members, rb_str_new2("cond"));
|
|
5528
|
-
rb_define_method(rb_cUNTIL, "state", node_state, 0);
|
|
5529
|
-
rb_ary_push(members, rb_str_new2("state"));
|
|
5530
5545
|
}
|
|
5531
5546
|
|
|
5532
5547
|
/* Document-class: Node::VALIAS
|
|
@@ -5605,12 +5620,6 @@ void define_node_subclass_methods()
|
|
|
5605
5620
|
rb_iv_set(rb_cWHEN, "__type__", INT2NUM(NODE_WHEN));
|
|
5606
5621
|
rb_define_singleton_method(rb_cWHEN, "members", node_s_members, 0);
|
|
5607
5622
|
|
|
5608
|
-
/* Document-method: head
|
|
5609
|
-
* a value to compare against, or a condition to be tested
|
|
5610
|
-
*/
|
|
5611
|
-
rb_define_method(rb_cWHEN, "head", node_head, 0);
|
|
5612
|
-
rb_ary_push(members, rb_str_new2("head"));
|
|
5613
|
-
|
|
5614
5623
|
/* Document-method: body
|
|
5615
5624
|
* an expression to evaluate if the condition evaluates to true
|
|
5616
5625
|
*/
|
|
@@ -5622,6 +5631,12 @@ void define_node_subclass_methods()
|
|
|
5622
5631
|
*/
|
|
5623
5632
|
rb_define_method(rb_cWHEN, "next", node_next, 0);
|
|
5624
5633
|
rb_ary_push(members, rb_str_new2("next"));
|
|
5634
|
+
|
|
5635
|
+
/* Document-method: head
|
|
5636
|
+
* a value to compare against, or a condition to be tested
|
|
5637
|
+
*/
|
|
5638
|
+
rb_define_method(rb_cWHEN, "head", node_head, 0);
|
|
5639
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
5625
5640
|
}
|
|
5626
5641
|
|
|
5627
5642
|
/* Document-class: Node::WHILE
|
|
@@ -5643,14 +5658,14 @@ void define_node_subclass_methods()
|
|
|
5643
5658
|
*/
|
|
5644
5659
|
rb_define_method(rb_cWHILE, "body", node_body, 0);
|
|
5645
5660
|
rb_ary_push(members, rb_str_new2("body"));
|
|
5661
|
+
rb_define_method(rb_cWHILE, "state", node_state, 0);
|
|
5662
|
+
rb_ary_push(members, rb_str_new2("state"));
|
|
5646
5663
|
|
|
5647
5664
|
/* Document-method: cond
|
|
5648
5665
|
* a condition to terminate the loop when it becomes false
|
|
5649
5666
|
*/
|
|
5650
5667
|
rb_define_method(rb_cWHILE, "cond", node_cond, 0);
|
|
5651
5668
|
rb_ary_push(members, rb_str_new2("cond"));
|
|
5652
|
-
rb_define_method(rb_cWHILE, "state", node_state, 0);
|
|
5653
|
-
rb_ary_push(members, rb_str_new2("state"));
|
|
5654
5669
|
}
|
|
5655
5670
|
|
|
5656
5671
|
/* Document-class: Node::XSTR
|
|
@@ -5687,17 +5702,17 @@ void define_node_subclass_methods()
|
|
|
5687
5702
|
rb_iv_set(rb_cYIELD, "__type__", INT2NUM(NODE_YIELD));
|
|
5688
5703
|
rb_define_singleton_method(rb_cYIELD, "members", node_s_members, 0);
|
|
5689
5704
|
|
|
5690
|
-
/* Document-method: head
|
|
5691
|
-
* the value to yield
|
|
5692
|
-
*/
|
|
5693
|
-
rb_define_method(rb_cYIELD, "head", node_head, 0);
|
|
5694
|
-
rb_ary_push(members, rb_str_new2("head"));
|
|
5695
|
-
|
|
5696
5705
|
/* Document-method: state
|
|
5697
5706
|
* if nonzero, splats the value before yielding
|
|
5698
5707
|
*/
|
|
5699
5708
|
rb_define_method(rb_cYIELD, "state", node_state, 0);
|
|
5700
5709
|
rb_ary_push(members, rb_str_new2("state"));
|
|
5710
|
+
|
|
5711
|
+
/* Document-method: head
|
|
5712
|
+
* the value to yield
|
|
5713
|
+
*/
|
|
5714
|
+
rb_define_method(rb_cYIELD, "head", node_head, 0);
|
|
5715
|
+
rb_ary_push(members, rb_str_new2("head"));
|
|
5701
5716
|
}
|
|
5702
5717
|
|
|
5703
5718
|
/* Document-class: Node::ZARRAY
|