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.9.0/internal/method/method.h → ruby-1.9.1/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 oclass; /* class that holds the method */
|
10
22
|
VALUE rclass; /* class of the receiver */
|
@@ -4,37 +4,35 @@ VALUE
|
|
4
4
|
class2path(VALUE klass)
|
5
5
|
{
|
6
6
|
VALUE path = rb_class_path(klass);
|
7
|
-
char *n
|
7
|
+
const char *n;
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
n);
|
13
|
-
}
|
14
|
-
if (rb_path2class(n) != rb_class_real(klass)) {
|
15
|
-
rb_raise(rb_eTypeError, "%s can't be referred", n);
|
9
|
+
n = must_not_be_anonymous((TYPE(klass) == T_CLASS ? "class" : "module"), path);
|
10
|
+
if (rb_path_to_class(path) != rb_class_real(klass)) {
|
11
|
+
rb_raise(rb_eTypeError, "%s can't be referred to", n);
|
16
12
|
}
|
17
13
|
return path;
|
18
14
|
}
|
19
15
|
|
20
16
|
VALUE
|
21
|
-
path2class(
|
17
|
+
path2class(VALUE path)
|
22
18
|
{
|
23
|
-
VALUE v =
|
19
|
+
VALUE v = rb_path_to_class(path);
|
24
20
|
|
25
21
|
if (TYPE(v) != T_CLASS) {
|
26
|
-
rb_raise(rb_eArgError, "
|
22
|
+
rb_raise(rb_eArgError, "%.*s does not refer to class",
|
23
|
+
(int)RSTRING_LEN(path), RSTRING_PTR(path));
|
27
24
|
}
|
28
25
|
return v;
|
29
26
|
}
|
30
27
|
|
31
28
|
VALUE
|
32
|
-
path2module(
|
29
|
+
path2module(VALUE path)
|
33
30
|
{
|
34
|
-
VALUE v =
|
31
|
+
VALUE v = rb_path_to_class(path);
|
35
32
|
|
36
33
|
if (TYPE(v) != T_MODULE) {
|
37
|
-
rb_raise(rb_eArgError, "
|
34
|
+
rb_raise(rb_eArgError, "%.*s does not refer to module",
|
35
|
+
(int)RSTRING_LEN(path), RSTRING_PTR(path));
|
38
36
|
}
|
39
37
|
return v;
|
40
38
|
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#ifndef getcfp__h
|
2
|
+
#define getcfp__h
|
3
|
+
|
4
|
+
#include "ruby.h"
|
5
|
+
|
6
|
+
#ifdef RUBY_VM
|
7
|
+
|
8
|
+
#include "vm_core.h"
|
9
|
+
|
10
|
+
static rb_control_frame_t *
|
11
|
+
getcfp(rb_thread_t *th, rb_control_frame_t *cfp)
|
12
|
+
{
|
13
|
+
while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) {
|
14
|
+
if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
|
15
|
+
return cfp;
|
16
|
+
}
|
17
|
+
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
|
18
|
+
}
|
19
|
+
return 0;
|
20
|
+
}
|
21
|
+
|
22
|
+
|
23
|
+
#endif
|
24
|
+
|
25
|
+
#endif
|
@@ -1,10 +1,96 @@
|
|
1
1
|
#ifndef global_entry__h_
|
2
2
|
#define global_entry__h_
|
3
3
|
|
4
|
+
st_table * rb_global_tbl;
|
5
|
+
|
6
|
+
#define gvar_getter_t rb_gvar_getter_t
|
7
|
+
#define gvar_setter_t rb_gvar_setter_t
|
8
|
+
#define gvar_marker_t rb_gvar_marker_t
|
9
|
+
struct trace_var {
|
10
|
+
int removed;
|
11
|
+
void (*func)(VALUE arg, VALUE val);
|
12
|
+
VALUE data;
|
13
|
+
struct trace_var *next;
|
14
|
+
};
|
15
|
+
struct global_variable {
|
16
|
+
int counter;
|
17
|
+
void *data;
|
18
|
+
gvar_getter_t *getter;
|
19
|
+
gvar_setter_t *setter;
|
20
|
+
gvar_marker_t *marker;
|
21
|
+
int block_trace;
|
22
|
+
struct trace_var *trace;
|
23
|
+
};
|
4
24
|
struct global_entry {
|
5
25
|
struct global_variable *var;
|
6
26
|
ID id;
|
7
27
|
};
|
28
|
+
#define undef_getter rb_gvar_undef_getter
|
29
|
+
#define undef_setter rb_gvar_undef_setter
|
30
|
+
#define undef_marker rb_gvar_undef_marker
|
31
|
+
struct global_entry*
|
32
|
+
rb_global_entry(ID id)
|
33
|
+
{
|
34
|
+
struct global_entry *entry;
|
35
|
+
st_data_t data;
|
36
|
+
|
37
|
+
if (!st_lookup(rb_global_tbl, id, &data)) {
|
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
|
+
else {
|
54
|
+
entry = (struct global_entry *)data;
|
55
|
+
}
|
56
|
+
return entry;
|
57
|
+
}
|
58
|
+
VALUE
|
59
|
+
undef_getter(ID id, void *data, struct global_variable *var)
|
60
|
+
{
|
61
|
+
rb_warning("global variable `%s' not initialized", rb_id2name(id));
|
62
|
+
|
63
|
+
return Qnil;
|
64
|
+
}
|
65
|
+
void
|
66
|
+
undef_setter(VALUE val, ID id, void *data, struct global_variable *var)
|
67
|
+
{
|
68
|
+
var->getter = val_getter;
|
69
|
+
var->setter = val_setter;
|
70
|
+
var->marker = val_marker;
|
71
|
+
|
72
|
+
var->data = (void*)val;
|
73
|
+
}
|
74
|
+
void
|
75
|
+
undef_marker(VALUE *var)
|
76
|
+
{
|
77
|
+
}
|
78
|
+
VALUE
|
79
|
+
val_getter(ID id, void *data, struct global_variable *var)
|
80
|
+
{
|
81
|
+
return (VALUE)data;
|
82
|
+
}
|
83
|
+
void
|
84
|
+
val_setter(VALUE val, ID id, void *data, struct global_variable *var)
|
85
|
+
{
|
86
|
+
var->data = (void*)val;
|
87
|
+
}
|
88
|
+
void
|
89
|
+
val_marker(VALUE *var)
|
90
|
+
{
|
91
|
+
VALUE data = (VALUE)var;
|
92
|
+
if (data) rb_gc_mark_maybe(data);
|
93
|
+
}
|
8
94
|
|
9
95
|
#endif
|
10
96
|
|
@@ -2,42 +2,42 @@
|
|
2
2
|
#include "version.h"
|
3
3
|
|
4
4
|
Node_Type_Descrip node_type_descrips_unsorted[] = {
|
5
|
-
{ NODE_ALIAS,
|
5
|
+
{ NODE_ALIAS, NEN_2ND, NEN_1ST, NEN_NONE, "ALIAS" },
|
6
6
|
#ifdef HAVE_NODE_ALLOCA
|
7
|
-
{ NODE_ALLOCA, NEN_CFNC, NEN_VALUE,
|
7
|
+
{ NODE_ALLOCA, NEN_CNT, NEN_CFNC, NEN_VALUE, "ALLOCA" },
|
8
8
|
#endif
|
9
|
-
{ NODE_AND,
|
10
|
-
{ NODE_ARGS,
|
9
|
+
{ NODE_AND, NEN_2ND, NEN_1ST, NEN_NONE, "AND" },
|
10
|
+
{ NODE_ARGS, NEN_CNT, NEN_OPT, NEN_REST, "ARGS" },
|
11
11
|
{ NODE_ARGSCAT, NEN_HEAD, NEN_BODY, NEN_NONE, "ARGSCAT" },
|
12
12
|
{ NODE_ARGSPUSH, NEN_HEAD, NEN_BODY, NEN_NONE, "ARGSPUSH" },
|
13
13
|
{ NODE_ARRAY, NEN_HEAD, NEN_ALEN, NEN_NEXT, "ARRAY" },
|
14
|
-
{ NODE_ATTRASGN,
|
14
|
+
{ NODE_ATTRASGN, NEN_MID, NEN_RECV, NEN_ARGS, "ATTRASGN" },
|
15
15
|
{ NODE_ATTRSET, NEN_VID, NEN_NONE, NEN_NONE, "ATTRSET" },
|
16
|
-
{ NODE_BACK_REF,
|
16
|
+
{ NODE_BACK_REF, NEN_CNT, NEN_NTH, NEN_NONE, "BACK_REF" },
|
17
17
|
{ NODE_BEGIN, NEN_BODY, NEN_NONE, NEN_NONE, "BEGIN" },
|
18
18
|
{ NODE_BLOCK, NEN_HEAD, NEN_NEXT, NEN_NONE, "BLOCK" },
|
19
19
|
{ NODE_BLOCK_ARG, NEN_CNT, NEN_NONE, NEN_NONE, "BLOCK_ARG" },
|
20
|
-
{ NODE_BLOCK_PASS,
|
20
|
+
{ NODE_BLOCK_PASS, NEN_ITER, NEN_BODY, 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,
|
23
|
+
{ NODE_CALL, NEN_MID, NEN_RECV, NEN_ARGS, "CALL" },
|
24
24
|
{ NODE_CASE, NEN_HEAD, NEN_BODY, NEN_NEXT, "CASE" },
|
25
|
-
{ NODE_CDECL,
|
25
|
+
{ NODE_CDECL, NEN_VID, NEN_VALUE, NEN_NONE, "CDECL" },
|
26
26
|
{ NODE_CFUNC, NEN_CFNC, NEN_ARGC, NEN_NONE, "CFUNC" },
|
27
|
-
{ NODE_CLASS,
|
27
|
+
{ NODE_CLASS, NEN_BODY, NEN_SUPER, NEN_CPATH, "CLASS" },
|
28
28
|
{ NODE_COLON2, NEN_HEAD, NEN_MID, NEN_NONE, "COLON2" },
|
29
29
|
{ NODE_COLON3, NEN_MID, NEN_NONE, NEN_NONE, "COLON3" },
|
30
30
|
{ NODE_CONST, NEN_VID, NEN_NONE, NEN_NONE, "CONST" },
|
31
31
|
{ NODE_CVAR, NEN_VID, NEN_NONE, NEN_NONE, "CVAR" },
|
32
|
-
{ NODE_CVASGN,
|
33
|
-
{ NODE_CVDECL,
|
34
|
-
{ NODE_DASGN,
|
35
|
-
{ NODE_DASGN_CURR,
|
32
|
+
{ NODE_CVASGN, NEN_VID, NEN_VALUE, NEN_NONE, "CVASGN" },
|
33
|
+
{ NODE_CVDECL, NEN_VID, NEN_VALUE, NEN_NONE, "CVDECL" },
|
34
|
+
{ NODE_DASGN, NEN_VID, NEN_VALUE, NEN_NONE, "DASGN" },
|
35
|
+
{ NODE_DASGN_CURR, NEN_VID, NEN_VALUE, NEN_NONE, "DASGN_CURR" },
|
36
36
|
{ NODE_DEFINED, NEN_HEAD, NEN_NONE, NEN_NONE, "DEFINED" },
|
37
|
-
{ NODE_DEFN,
|
38
|
-
{ NODE_DEFS,
|
39
|
-
{ NODE_DOT2,
|
40
|
-
{ NODE_DOT3,
|
37
|
+
{ NODE_DEFN, NEN_MID, NEN_DEFN, NEN_NOEX, "DEFN" },
|
38
|
+
{ NODE_DEFS, NEN_MID, NEN_DEFN, NEN_RECV, "DEFS" },
|
39
|
+
{ NODE_DOT2, NEN_END, NEN_STATE, NEN_BEG, "DOT2" },
|
40
|
+
{ NODE_DOT3, NEN_END, NEN_STATE, NEN_BEG, "DOT3" },
|
41
41
|
{ NODE_DREGX, NEN_LIT, NEN_CFLAG, NEN_NEXT, "DREGX" },
|
42
42
|
{ NODE_DREGX_ONCE, NEN_LIT, NEN_CFLAG, NEN_NEXT, "DREGX_ONCE" },
|
43
43
|
{ NODE_DSTR, NEN_LIT, NEN_NEXT, NEN_NONE, "DSTR" },
|
@@ -47,47 +47,45 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
|
|
47
47
|
{ NODE_ENSURE, NEN_HEAD, NEN_ENSR, NEN_NONE, "ENSURE" },
|
48
48
|
{ NODE_EVSTR, NEN_BODY, NEN_NONE, NEN_NONE, "EVSTR" },
|
49
49
|
{ NODE_FALSE, NEN_NONE, NEN_NONE, NEN_NONE, "FALSE" },
|
50
|
-
{
|
51
|
-
{
|
52
|
-
{
|
53
|
-
{
|
54
|
-
{
|
55
|
-
{ NODE_GASGN, NEN_VALUE, NEN_VID, NEN_ENTRY, "GASGN" },
|
50
|
+
{ NODE_FCALL, NEN_MID, NEN_ARGS, NEN_NONE, "FCALL" },
|
51
|
+
{ NODE_FLIP2, NEN_CNT, NEN_END, NEN_BEG, "FLIP2" },
|
52
|
+
{ NODE_FLIP3, NEN_CNT, NEN_END, NEN_BEG, "FLIP3" },
|
53
|
+
{ NODE_FOR, NEN_ITER, NEN_BODY, NEN_VAR, "FOR" },
|
54
|
+
{ NODE_GASGN, NEN_VID, NEN_ENTRY, NEN_VALUE, "GASGN" },
|
56
55
|
{ NODE_GVAR, NEN_VID, NEN_ENTRY, NEN_NONE, "GVAR" },
|
57
56
|
{ NODE_HASH, NEN_HEAD, NEN_NONE, NEN_NONE, "HASH" },
|
58
|
-
{ NODE_IASGN,
|
59
|
-
{ NODE_IF,
|
60
|
-
{ NODE_IFUNC, NEN_CFNC, NEN_TVAL,
|
61
|
-
{ NODE_ITER,
|
57
|
+
{ NODE_IASGN, NEN_VID, NEN_VALUE, NEN_NONE, "IASGN" },
|
58
|
+
{ NODE_IF, NEN_BODY, NEN_COND, NEN_ELSE, "IF" },
|
59
|
+
{ NODE_IFUNC, NEN_STATE, NEN_CFNC, NEN_TVAL, "IFUNC" },
|
60
|
+
{ NODE_ITER, NEN_ITER, NEN_BODY, NEN_VAR, "ITER" },
|
62
61
|
{ NODE_IVAR, NEN_VID, NEN_NONE, NEN_NONE, "IVAR" },
|
63
|
-
{ NODE_LASGN,
|
62
|
+
{ NODE_LASGN, NEN_CNT, NEN_VID, NEN_VALUE, "LASGN" },
|
64
63
|
{ NODE_LIT, NEN_LIT, NEN_NONE, NEN_NONE, "LIT" },
|
65
|
-
{ NODE_LVAR,
|
66
|
-
{ NODE_MASGN,
|
64
|
+
{ NODE_LVAR, NEN_CNT, NEN_VID, NEN_NONE, "LVAR" },
|
65
|
+
{ NODE_MASGN, NEN_HEAD, NEN_ARGS, NEN_VALUE, "MASGN" },
|
67
66
|
{ NODE_MATCH, NEN_LIT, NEN_VALUE, NEN_NONE, "MATCH" },
|
68
|
-
{ NODE_MATCH2,
|
69
|
-
{ NODE_MATCH3,
|
67
|
+
{ NODE_MATCH2, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH2" },
|
68
|
+
{ NODE_MATCH3, NEN_RECV, NEN_VALUE, NEN_NONE, "MATCH3" },
|
70
69
|
{ NODE_MEMO, NEN_NONE, NEN_NONE, NEN_NONE, "MEMO" },
|
71
|
-
{
|
72
|
-
{ NODE_MODULE, NEN_CPATH, NEN_BODY, NEN_NONE, "MODULE" },
|
70
|
+
{ NODE_MODULE, NEN_BODY, NEN_CPATH, NEN_NONE, "MODULE" },
|
73
71
|
{ NODE_NEXT, NEN_STTS, NEN_NONE, NEN_NONE, "NEXT" },
|
74
72
|
{ NODE_NIL, NEN_NONE, NEN_NONE, NEN_NONE, "NIL" },
|
75
|
-
{ NODE_NTH_REF,
|
73
|
+
{ NODE_NTH_REF, NEN_CNT, NEN_NTH, NEN_NONE, "NTH_REF" },
|
76
74
|
{ NODE_OPT_N, NEN_BODY, NEN_NONE, NEN_NONE, "OPT_N" },
|
77
|
-
{ NODE_OP_ASGN1,
|
78
|
-
{ NODE_OP_ASGN2,
|
79
|
-
{ NODE_OP_ASGN2_ARG, NEN_VID, NEN_AID,
|
80
|
-
{ NODE_OP_ASGN_AND,
|
81
|
-
{ NODE_OP_ASGN_OR, NEN_AID, NEN_VALUE,
|
82
|
-
{ NODE_OR,
|
75
|
+
{ NODE_OP_ASGN1, NEN_MID, NEN_RECV, NEN_ARGS, "OP_ASGN1" },
|
76
|
+
{ NODE_OP_ASGN2, NEN_RECV, NEN_NEXT, NEN_VALUE, "OP_ASGN2" },
|
77
|
+
{ NODE_OP_ASGN2_ARG, NEN_MID, NEN_VID, NEN_AID, "OP_ASGN2_ARG" },
|
78
|
+
{ NODE_OP_ASGN_AND, NEN_RECV, NEN_VALUE, NEN_NONE, "OP_ASGN_AND" },
|
79
|
+
{ NODE_OP_ASGN_OR, NEN_RECV, NEN_AID, NEN_VALUE, "OP_ASGN_OR" },
|
80
|
+
{ NODE_OR, NEN_2ND, NEN_1ST, NEN_NONE, "OR" },
|
83
81
|
{ NODE_POSTEXE, NEN_NONE, NEN_NONE, NEN_NONE, "POSTEXE" },
|
84
82
|
{ NODE_REDO, NEN_NONE, NEN_NONE, NEN_NONE, "REDO" },
|
85
|
-
{ NODE_RESBODY, NEN_HEAD,
|
86
|
-
{ NODE_RESCUE, NEN_HEAD,
|
83
|
+
{ NODE_RESBODY, NEN_HEAD, NEN_BODY, NEN_ARGS, "RESBODY" },
|
84
|
+
{ NODE_RESCUE, NEN_HEAD, NEN_RESQ, NEN_ELSE, "RESCUE" },
|
87
85
|
{ NODE_RETRY, NEN_NONE, NEN_NONE, NEN_NONE, "RETRY" },
|
88
86
|
{ NODE_RETURN, NEN_STTS, NEN_NONE, NEN_NONE, "RETURN" },
|
89
87
|
{ NODE_SCLASS, NEN_BODY, NEN_RECV, NEN_NONE, "SCLASS" },
|
90
|
-
{ NODE_SCOPE,
|
88
|
+
{ NODE_SCOPE, NEN_RVAL, NEN_TBL, NEN_NEXT, "SCOPE" },
|
91
89
|
{ NODE_SELF, NEN_NONE, NEN_NONE, NEN_NONE, "SELF" },
|
92
90
|
{ NODE_SPLAT, NEN_HEAD, NEN_NONE, NEN_NONE, "SPLAT" },
|
93
91
|
{ NODE_STR, NEN_LIT, NEN_NONE, NEN_NONE, "STR" },
|
@@ -95,11 +93,11 @@ Node_Type_Descrip node_type_descrips_unsorted[] = {
|
|
95
93
|
{ NODE_TO_ARY, NEN_HEAD, NEN_NONE, NEN_NONE, "TO_ARY" },
|
96
94
|
{ NODE_TRUE, NEN_NONE, NEN_NONE, NEN_NONE, "TRUE" },
|
97
95
|
{ NODE_UNDEF, NEN_BODY, NEN_NONE, NEN_NONE, "UNDEF" },
|
98
|
-
{ NODE_UNTIL, NEN_BODY, NEN_COND,
|
99
|
-
{ NODE_VALIAS,
|
96
|
+
{ NODE_UNTIL, NEN_STATE, NEN_BODY, NEN_COND, "UNTIL" },
|
97
|
+
{ NODE_VALIAS, NEN_2ND, NEN_1ST, NEN_NONE, "VALIAS" },
|
100
98
|
{ NODE_VCALL, NEN_MID, NEN_NONE, NEN_NONE, "VCALL" },
|
101
99
|
{ NODE_WHEN, NEN_HEAD, NEN_BODY, NEN_NEXT, "WHEN" },
|
102
|
-
{ NODE_WHILE, NEN_BODY, NEN_COND,
|
100
|
+
{ NODE_WHILE, NEN_STATE, NEN_BODY, NEN_COND, "WHILE" },
|
103
101
|
{ NODE_XSTR, NEN_LIT, NEN_NONE, NEN_NONE, "XSTR" },
|
104
102
|
{ NODE_YIELD, NEN_HEAD, NEN_STATE, NEN_NONE, "YIELD" },
|
105
103
|
{ NODE_ZARRAY, NEN_NONE, NEN_NONE, NEN_NONE, "ZARRAY" },
|
@@ -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
|
}
|
@@ -521,7 +521,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
521
521
|
else
|
522
522
|
{
|
523
523
|
path = rb_class_path(klass);
|
524
|
-
if(
|
524
|
+
if(StringValuePtr(path)[0] == '#')
|
525
525
|
{
|
526
526
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
527
527
|
}
|
@@ -658,7 +658,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
658
658
|
else
|
659
659
|
{
|
660
660
|
path = rb_class_path(klass);
|
661
|
-
if(
|
661
|
+
if(StringValuePtr(path)[0] == '#')
|
662
662
|
{
|
663
663
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
664
664
|
}
|
@@ -872,7 +872,7 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
872
872
|
else
|
873
873
|
{
|
874
874
|
path = rb_class_path(klass);
|
875
|
-
if(
|
875
|
+
if(StringValuePtr(path)[0] == '#')
|
876
876
|
{
|
877
877
|
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
878
878
|
}
|
@@ -1131,20 +1131,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1131
1131
|
}
|
1132
1132
|
case NEN_CLSS:
|
1133
1133
|
{
|
1134
|
+
int flags;
|
1134
1135
|
Check_Type(v, T_ARRAY);
|
1135
1136
|
if(RARRAY_LEN(v) != 2)
|
1136
1137
|
{
|
1137
1138
|
rb_raise(rb_eArgError, "wrong size for array");
|
1138
1139
|
}
|
1139
|
-
|
1140
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
1140
1141
|
switch(flags & T_MASK)
|
1141
1142
|
{
|
1142
1143
|
case T_CLASS:
|
1143
1144
|
case T_MODULE:
|
1144
1145
|
{
|
1145
|
-
VALUE str
|
1146
|
+
VALUE str, klass;
|
1147
|
+
|
1148
|
+
str = RARRAY_PTR(v)[1];
|
1146
1149
|
Check_Type(str, T_STRING);
|
1147
|
-
|
1150
|
+
klass = rb_path2class(StringValuePtr(str));
|
1148
1151
|
if(flags & FL_SINGLETON)
|
1149
1152
|
{
|
1150
1153
|
*(VALUE *)(&n->nd_clss) =
|
@@ -1220,20 +1223,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1220
1223
|
}
|
1221
1224
|
case NEN_CVAL:
|
1222
1225
|
{
|
1226
|
+
int flags;
|
1223
1227
|
Check_Type(v, T_ARRAY);
|
1224
1228
|
if(RARRAY_LEN(v) != 2)
|
1225
1229
|
{
|
1226
1230
|
rb_raise(rb_eArgError, "wrong size for array");
|
1227
1231
|
}
|
1228
|
-
|
1232
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
1229
1233
|
switch(flags & T_MASK)
|
1230
1234
|
{
|
1231
1235
|
case T_CLASS:
|
1232
1236
|
case T_MODULE:
|
1233
1237
|
{
|
1234
|
-
VALUE str
|
1238
|
+
VALUE str, klass;
|
1239
|
+
|
1240
|
+
str = RARRAY_PTR(v)[1];
|
1235
1241
|
Check_Type(str, T_STRING);
|
1236
|
-
|
1242
|
+
klass = rb_path2class(StringValuePtr(str));
|
1237
1243
|
if(flags & FL_SINGLETON)
|
1238
1244
|
{
|
1239
1245
|
*(VALUE *)(&n->nd_cval) =
|
@@ -1414,20 +1420,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1414
1420
|
}
|
1415
1421
|
case NEN_LIT:
|
1416
1422
|
{
|
1423
|
+
int flags;
|
1417
1424
|
Check_Type(v, T_ARRAY);
|
1418
1425
|
if(RARRAY_LEN(v) != 2)
|
1419
1426
|
{
|
1420
1427
|
rb_raise(rb_eArgError, "wrong size for array");
|
1421
1428
|
}
|
1422
|
-
|
1429
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
1423
1430
|
switch(flags & T_MASK)
|
1424
1431
|
{
|
1425
1432
|
case T_CLASS:
|
1426
1433
|
case T_MODULE:
|
1427
1434
|
{
|
1428
|
-
VALUE str
|
1435
|
+
VALUE str, klass;
|
1436
|
+
|
1437
|
+
str = RARRAY_PTR(v)[1];
|
1429
1438
|
Check_Type(str, T_STRING);
|
1430
|
-
|
1439
|
+
klass = rb_path2class(StringValuePtr(str));
|
1431
1440
|
if(flags & FL_SINGLETON)
|
1432
1441
|
{
|
1433
1442
|
*(VALUE *)(&n->nd_lit) =
|
@@ -1556,20 +1565,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1556
1565
|
}
|
1557
1566
|
case NEN_ORIG:
|
1558
1567
|
{
|
1568
|
+
int flags;
|
1559
1569
|
Check_Type(v, T_ARRAY);
|
1560
1570
|
if(RARRAY_LEN(v) != 2)
|
1561
1571
|
{
|
1562
1572
|
rb_raise(rb_eArgError, "wrong size for array");
|
1563
1573
|
}
|
1564
|
-
|
1574
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
1565
1575
|
switch(flags & T_MASK)
|
1566
1576
|
{
|
1567
1577
|
case T_CLASS:
|
1568
1578
|
case T_MODULE:
|
1569
1579
|
{
|
1570
|
-
VALUE str
|
1580
|
+
VALUE str, klass;
|
1581
|
+
|
1582
|
+
str = RARRAY_PTR(v)[1];
|
1571
1583
|
Check_Type(str, T_STRING);
|
1572
|
-
|
1584
|
+
klass = rb_path2class(StringValuePtr(str));
|
1573
1585
|
if(flags & FL_SINGLETON)
|
1574
1586
|
{
|
1575
1587
|
*(VALUE *)(&n->nd_orig) =
|
@@ -1808,20 +1820,23 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1808
1820
|
}
|
1809
1821
|
case NEN_TVAL:
|
1810
1822
|
{
|
1823
|
+
int flags;
|
1811
1824
|
Check_Type(v, T_ARRAY);
|
1812
1825
|
if(RARRAY_LEN(v) != 2)
|
1813
1826
|
{
|
1814
1827
|
rb_raise(rb_eArgError, "wrong size for array");
|
1815
1828
|
}
|
1816
|
-
|
1829
|
+
flags = NUM2INT(RARRAY_PTR(v)[0]);
|
1817
1830
|
switch(flags & T_MASK)
|
1818
1831
|
{
|
1819
1832
|
case T_CLASS:
|
1820
1833
|
case T_MODULE:
|
1821
1834
|
{
|
1822
|
-
VALUE str
|
1835
|
+
VALUE str, klass;
|
1836
|
+
|
1837
|
+
str = RARRAY_PTR(v)[1];
|
1823
1838
|
Check_Type(str, T_STRING);
|
1824
|
-
|
1839
|
+
klass = rb_path2class(StringValuePtr(str));
|
1825
1840
|
if(flags & FL_SINGLETON)
|
1826
1841
|
{
|
1827
1842
|
*(VALUE *)(&n->nd_tval) =
|
@@ -2107,33 +2122,6 @@ static VALUE node_cfnc(VALUE self)
|
|
2107
2122
|
Data_Get_Struct(self, NODE, n);
|
2108
2123
|
return LONG2NUM((long)(n->nd_cfnc));
|
2109
2124
|
}
|
2110
|
-
/*
|
2111
|
-
* Return the Node's _clss_ member. The return type is
|
2112
|
-
* either a Node or an Object.
|
2113
|
-
*/
|
2114
|
-
static VALUE node_clss(VALUE self)
|
2115
|
-
{
|
2116
|
-
NODE * n;
|
2117
|
-
Data_Get_Struct(self, NODE, n);
|
2118
|
-
|
2119
|
-
if(TYPE(n->nd_clss) == T_NODE)
|
2120
|
-
{
|
2121
|
-
if(0 && nd_type(n) == NODE_OP_ASGN2)
|
2122
|
-
{
|
2123
|
-
return wrap_node_as(
|
2124
|
-
(NODE *)n->nd_clss,
|
2125
|
-
rb_cNodeSubclass[NODE_OP_ASGN2_ARG]);
|
2126
|
-
}
|
2127
|
-
else
|
2128
|
-
{
|
2129
|
-
return wrap_node((NODE *)n->nd_clss);
|
2130
|
-
}
|
2131
|
-
}
|
2132
|
-
else
|
2133
|
-
{
|
2134
|
-
return (VALUE)n->nd_clss;
|
2135
|
-
}
|
2136
|
-
}
|
2137
2125
|
/*
|
2138
2126
|
* Return the Node's _cnt_ member. The return type is an
|
2139
2127
|
* Integer.
|
@@ -2499,27 +2487,6 @@ static VALUE node_nth(VALUE self)
|
|
2499
2487
|
Data_Get_Struct(self, NODE, n);
|
2500
2488
|
return LONG2NUM(n->nd_nth);
|
2501
2489
|
}
|
2502
|
-
/*
|
2503
|
-
* Return the Node's _oid_ member. The return type is a
|
2504
|
-
* Symbol.
|
2505
|
-
*/
|
2506
|
-
static VALUE node_oid(VALUE self)
|
2507
|
-
{
|
2508
|
-
NODE * n;
|
2509
|
-
Data_Get_Struct(self, NODE, n);
|
2510
|
-
if(n->nd_oid == 0)
|
2511
|
-
{
|
2512
|
-
return Qfalse;
|
2513
|
-
}
|
2514
|
-
else if(n->nd_oid == 1)
|
2515
|
-
{
|
2516
|
-
return Qtrue;
|
2517
|
-
}
|
2518
|
-
else
|
2519
|
-
{
|
2520
|
-
return ID2SYM(n->nd_oid);
|
2521
|
-
}
|
2522
|
-
}
|
2523
2490
|
/*
|
2524
2491
|
* Return the Node's _opt_ member. The return type is
|
2525
2492
|
* either a Node or an Object.
|
@@ -2865,10 +2832,10 @@ void define_node_subclass_methods()
|
|
2865
2832
|
rb_iv_set(rb_cALIAS, "__member__", members);
|
2866
2833
|
rb_iv_set(rb_cALIAS, "__type__", INT2NUM(NODE_ALIAS));
|
2867
2834
|
rb_define_singleton_method(rb_cALIAS, "members", node_s_members, 0);
|
2868
|
-
rb_define_method(rb_cALIAS, "first", node_1st, 0);
|
2869
|
-
rb_ary_push(members, rb_str_new2("first"));
|
2870
2835
|
rb_define_method(rb_cALIAS, "second", node_2nd, 0);
|
2871
2836
|
rb_ary_push(members, rb_str_new2("second"));
|
2837
|
+
rb_define_method(rb_cALIAS, "first", node_1st, 0);
|
2838
|
+
rb_ary_push(members, rb_str_new2("first"));
|
2872
2839
|
}
|
2873
2840
|
|
2874
2841
|
/* Document-class: Node::ALLOCA
|
@@ -2886,6 +2853,12 @@ void define_node_subclass_methods()
|
|
2886
2853
|
rb_iv_set(rb_cALLOCA, "__type__", INT2NUM(NODE_ALLOCA));
|
2887
2854
|
rb_define_singleton_method(rb_cALLOCA, "members", node_s_members, 0);
|
2888
2855
|
|
2856
|
+
/* Document-method: cnt
|
2857
|
+
* the number of bytes allocated
|
2858
|
+
*/
|
2859
|
+
rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
|
2860
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2861
|
+
|
2889
2862
|
/* Document-method: cfnc
|
2890
2863
|
* a pointer to the allocated memory
|
2891
2864
|
*/
|
@@ -2897,12 +2870,6 @@ void define_node_subclass_methods()
|
|
2897
2870
|
*/
|
2898
2871
|
rb_define_method(rb_cALLOCA, "value", node_value, 0);
|
2899
2872
|
rb_ary_push(members, rb_str_new2("value"));
|
2900
|
-
|
2901
|
-
/* Document-method: cnt
|
2902
|
-
* the number of bytes allocated
|
2903
|
-
*/
|
2904
|
-
rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
|
2905
|
-
rb_ary_push(members, rb_str_new2("cnt"));
|
2906
2873
|
}
|
2907
2874
|
#endif
|
2908
2875
|
|
@@ -2921,17 +2888,17 @@ void define_node_subclass_methods()
|
|
2921
2888
|
rb_iv_set(rb_cAND, "__type__", INT2NUM(NODE_AND));
|
2922
2889
|
rb_define_singleton_method(rb_cAND, "members", node_s_members, 0);
|
2923
2890
|
|
2924
|
-
/* Document-method: first
|
2925
|
-
* the expression on the left hand side
|
2926
|
-
*/
|
2927
|
-
rb_define_method(rb_cAND, "first", node_1st, 0);
|
2928
|
-
rb_ary_push(members, rb_str_new2("first"));
|
2929
|
-
|
2930
2891
|
/* Document-method: second
|
2931
2892
|
* the expression on the right hand side
|
2932
2893
|
*/
|
2933
2894
|
rb_define_method(rb_cAND, "second", node_2nd, 0);
|
2934
2895
|
rb_ary_push(members, rb_str_new2("second"));
|
2896
|
+
|
2897
|
+
/* Document-method: first
|
2898
|
+
* the expression on the left hand side
|
2899
|
+
*/
|
2900
|
+
rb_define_method(rb_cAND, "first", node_1st, 0);
|
2901
|
+
rb_ary_push(members, rb_str_new2("first"));
|
2935
2902
|
}
|
2936
2903
|
|
2937
2904
|
/* Document-class: Node::ARGS
|
@@ -2945,11 +2912,11 @@ void define_node_subclass_methods()
|
|
2945
2912
|
rb_iv_set(rb_cARGS, "__type__", INT2NUM(NODE_ARGS));
|
2946
2913
|
rb_define_singleton_method(rb_cARGS, "members", node_s_members, 0);
|
2947
2914
|
|
2948
|
-
/* Document-method:
|
2949
|
-
*
|
2915
|
+
/* Document-method: cnt
|
2916
|
+
* the number of required arguments
|
2950
2917
|
*/
|
2951
|
-
rb_define_method(rb_cARGS, "
|
2952
|
-
rb_ary_push(members, rb_str_new2("
|
2918
|
+
rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
|
2919
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2953
2920
|
|
2954
2921
|
/* Document-method: opt
|
2955
2922
|
* a list of assignment nodes to assign default values to the
|
@@ -2958,11 +2925,11 @@ void define_node_subclass_methods()
|
|
2958
2925
|
rb_define_method(rb_cARGS, "opt", node_opt, 0);
|
2959
2926
|
rb_ary_push(members, rb_str_new2("opt"));
|
2960
2927
|
|
2961
|
-
/* Document-method:
|
2962
|
-
* the
|
2928
|
+
/* Document-method: rest
|
2929
|
+
* an assignment node to assign the rest arg, if it is present
|
2963
2930
|
*/
|
2964
|
-
rb_define_method(rb_cARGS, "
|
2965
|
-
rb_ary_push(members, rb_str_new2("
|
2931
|
+
rb_define_method(rb_cARGS, "rest", node_rest, 0);
|
2932
|
+
rb_ary_push(members, rb_str_new2("rest"));
|
2966
2933
|
}
|
2967
2934
|
|
2968
2935
|
/* Document-class: Node::ARGSCAT
|
@@ -3058,12 +3025,6 @@ void define_node_subclass_methods()
|
|
3058
3025
|
rb_iv_set(rb_cATTRASGN, "__type__", INT2NUM(NODE_ATTRASGN));
|
3059
3026
|
rb_define_singleton_method(rb_cATTRASGN, "members", node_s_members, 0);
|
3060
3027
|
|
3061
|
-
/* Document-method: args
|
3062
|
-
* the arguments to the method
|
3063
|
-
*/
|
3064
|
-
rb_define_method(rb_cATTRASGN, "args", node_args, 0);
|
3065
|
-
rb_ary_push(members, rb_str_new2("args"));
|
3066
|
-
|
3067
3028
|
/* Document-method: mid
|
3068
3029
|
* the id of the attribute, with a trailing '=' sign
|
3069
3030
|
*/
|
@@ -3075,6 +3036,12 @@ void define_node_subclass_methods()
|
|
3075
3036
|
*/
|
3076
3037
|
rb_define_method(rb_cATTRASGN, "recv", node_recv, 0);
|
3077
3038
|
rb_ary_push(members, rb_str_new2("recv"));
|
3039
|
+
|
3040
|
+
/* Document-method: args
|
3041
|
+
* the arguments to the method
|
3042
|
+
*/
|
3043
|
+
rb_define_method(rb_cATTRASGN, "args", node_args, 0);
|
3044
|
+
rb_ary_push(members, rb_str_new2("args"));
|
3078
3045
|
}
|
3079
3046
|
|
3080
3047
|
/* Document-class: Node::ATTRSET
|
@@ -3113,19 +3080,19 @@ void define_node_subclass_methods()
|
|
3113
3080
|
rb_iv_set(rb_cBACK_REF, "__type__", INT2NUM(NODE_BACK_REF));
|
3114
3081
|
rb_define_singleton_method(rb_cBACK_REF, "members", node_s_members, 0);
|
3115
3082
|
|
3116
|
-
/* Document-method: nth
|
3117
|
-
* the integer representation of the character of the variable to
|
3118
|
-
* reference, one of '&', '`', '\'', or '+'
|
3119
|
-
*/
|
3120
|
-
rb_define_method(rb_cBACK_REF, "nth", node_nth, 0);
|
3121
|
-
rb_ary_push(members, rb_str_new2("nth"));
|
3122
|
-
|
3123
3083
|
/* Document-method: cnt
|
3124
3084
|
* the index into the local variable table where the match data is
|
3125
3085
|
* stored
|
3126
3086
|
*/
|
3127
3087
|
rb_define_method(rb_cBACK_REF, "cnt", node_cnt, 0);
|
3128
3088
|
rb_ary_push(members, rb_str_new2("cnt"));
|
3089
|
+
|
3090
|
+
/* Document-method: nth
|
3091
|
+
* the integer representation of the character of the variable to
|
3092
|
+
* reference, one of '&', '`', '\'', or '+'
|
3093
|
+
*/
|
3094
|
+
rb_define_method(rb_cBACK_REF, "nth", node_nth, 0);
|
3095
|
+
rb_ary_push(members, rb_str_new2("nth"));
|
3129
3096
|
}
|
3130
3097
|
|
3131
3098
|
/* Document-class: Node::BEGIN
|
@@ -3213,17 +3180,17 @@ void define_node_subclass_methods()
|
|
3213
3180
|
rb_iv_set(rb_cBLOCK_PASS, "__type__", INT2NUM(NODE_BLOCK_PASS));
|
3214
3181
|
rb_define_singleton_method(rb_cBLOCK_PASS, "members", node_s_members, 0);
|
3215
3182
|
|
3216
|
-
/* Document-method: body
|
3217
|
-
* the object to pass as a block
|
3218
|
-
*/
|
3219
|
-
rb_define_method(rb_cBLOCK_PASS, "body", node_body, 0);
|
3220
|
-
rb_ary_push(members, rb_str_new2("body"));
|
3221
|
-
|
3222
3183
|
/* Document-method: iter
|
3223
3184
|
* an expression which calls a method
|
3224
3185
|
*/
|
3225
3186
|
rb_define_method(rb_cBLOCK_PASS, "iter", node_iter, 0);
|
3226
3187
|
rb_ary_push(members, rb_str_new2("iter"));
|
3188
|
+
|
3189
|
+
/* Document-method: body
|
3190
|
+
* the object to pass as a block
|
3191
|
+
*/
|
3192
|
+
rb_define_method(rb_cBLOCK_PASS, "body", node_body, 0);
|
3193
|
+
rb_ary_push(members, rb_str_new2("body"));
|
3227
3194
|
}
|
3228
3195
|
|
3229
3196
|
/* Document-class: Node::BMETHOD
|
@@ -3280,12 +3247,6 @@ void define_node_subclass_methods()
|
|
3280
3247
|
rb_iv_set(rb_cCALL, "__type__", INT2NUM(NODE_CALL));
|
3281
3248
|
rb_define_singleton_method(rb_cCALL, "members", node_s_members, 0);
|
3282
3249
|
|
3283
|
-
/* Document-method: args
|
3284
|
-
* the arguments to the method
|
3285
|
-
*/
|
3286
|
-
rb_define_method(rb_cCALL, "args", node_args, 0);
|
3287
|
-
rb_ary_push(members, rb_str_new2("args"));
|
3288
|
-
|
3289
3250
|
/* Document-method: mid
|
3290
3251
|
* the method id
|
3291
3252
|
*/
|
@@ -3297,6 +3258,12 @@ void define_node_subclass_methods()
|
|
3297
3258
|
*/
|
3298
3259
|
rb_define_method(rb_cCALL, "recv", node_recv, 0);
|
3299
3260
|
rb_ary_push(members, rb_str_new2("recv"));
|
3261
|
+
|
3262
|
+
/* Document-method: args
|
3263
|
+
* the arguments to the method
|
3264
|
+
*/
|
3265
|
+
rb_define_method(rb_cCALL, "args", node_args, 0);
|
3266
|
+
rb_ary_push(members, rb_str_new2("args"));
|
3300
3267
|
}
|
3301
3268
|
|
3302
3269
|
/* Document-class: Node::CASE
|
@@ -3342,17 +3309,17 @@ void define_node_subclass_methods()
|
|
3342
3309
|
rb_iv_set(rb_cCDECL, "__type__", INT2NUM(NODE_CDECL));
|
3343
3310
|
rb_define_singleton_method(rb_cCDECL, "members", node_s_members, 0);
|
3344
3311
|
|
3345
|
-
/* Document-method: value
|
3346
|
-
* the value to be assigned to the constant
|
3347
|
-
*/
|
3348
|
-
rb_define_method(rb_cCDECL, "value", node_value, 0);
|
3349
|
-
rb_ary_push(members, rb_str_new2("value"));
|
3350
|
-
|
3351
3312
|
/* Document-method: vid
|
3352
3313
|
* the name of the constant to be assigned, all uppercase
|
3353
3314
|
*/
|
3354
3315
|
rb_define_method(rb_cCDECL, "vid", node_vid, 0);
|
3355
3316
|
rb_ary_push(members, rb_str_new2("vid"));
|
3317
|
+
|
3318
|
+
/* Document-method: value
|
3319
|
+
* the value to be assigned to the constant
|
3320
|
+
*/
|
3321
|
+
rb_define_method(rb_cCDECL, "value", node_value, 0);
|
3322
|
+
rb_ary_push(members, rb_str_new2("value"));
|
3356
3323
|
}
|
3357
3324
|
|
3358
3325
|
/* Document-class: Node::CFUNC
|
@@ -3395,12 +3362,6 @@ void define_node_subclass_methods()
|
|
3395
3362
|
rb_iv_set(rb_cCLASS, "__type__", INT2NUM(NODE_CLASS));
|
3396
3363
|
rb_define_singleton_method(rb_cCLASS, "members", node_s_members, 0);
|
3397
3364
|
|
3398
|
-
/* Document-method: cpath
|
3399
|
-
* the name of the class to define
|
3400
|
-
*/
|
3401
|
-
rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
|
3402
|
-
rb_ary_push(members, rb_str_new2("cpath"));
|
3403
|
-
|
3404
3365
|
/* Document-method: body
|
3405
3366
|
* the body of the class definition
|
3406
3367
|
*/
|
@@ -3413,6 +3374,12 @@ void define_node_subclass_methods()
|
|
3413
3374
|
*/
|
3414
3375
|
rb_define_method(rb_cCLASS, "super", node_super, 0);
|
3415
3376
|
rb_ary_push(members, rb_str_new2("super"));
|
3377
|
+
|
3378
|
+
/* Document-method: cpath
|
3379
|
+
* the name of the class to define
|
3380
|
+
*/
|
3381
|
+
rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
|
3382
|
+
rb_ary_push(members, rb_str_new2("cpath"));
|
3416
3383
|
}
|
3417
3384
|
|
3418
3385
|
/* Document-class: Node::COLON2
|
@@ -3514,18 +3481,18 @@ void define_node_subclass_methods()
|
|
3514
3481
|
rb_iv_set(rb_cCVASGN, "__type__", INT2NUM(NODE_CVASGN));
|
3515
3482
|
rb_define_singleton_method(rb_cCVASGN, "members", node_s_members, 0);
|
3516
3483
|
|
3484
|
+
/* Document-method: vid
|
3485
|
+
* the name of the class variable to assign
|
3486
|
+
*/
|
3487
|
+
rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
|
3488
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
3489
|
+
|
3517
3490
|
/* Document-method: value
|
3518
3491
|
* an expression whose result is the new value of the class
|
3519
3492
|
* variable
|
3520
3493
|
*/
|
3521
3494
|
rb_define_method(rb_cCVASGN, "value", node_value, 0);
|
3522
3495
|
rb_ary_push(members, rb_str_new2("value"));
|
3523
|
-
|
3524
|
-
/* Document-method: vid
|
3525
|
-
* the name of the class variable to assign
|
3526
|
-
*/
|
3527
|
-
rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
|
3528
|
-
rb_ary_push(members, rb_str_new2("vid"));
|
3529
3496
|
}
|
3530
3497
|
|
3531
3498
|
/* Document-class: Node::CVDECL
|
@@ -3541,18 +3508,18 @@ void define_node_subclass_methods()
|
|
3541
3508
|
rb_iv_set(rb_cCVDECL, "__type__", INT2NUM(NODE_CVDECL));
|
3542
3509
|
rb_define_singleton_method(rb_cCVDECL, "members", node_s_members, 0);
|
3543
3510
|
|
3511
|
+
/* Document-method: vid
|
3512
|
+
* the name of the class variable to assign
|
3513
|
+
*/
|
3514
|
+
rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
|
3515
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
3516
|
+
|
3544
3517
|
/* Document-method: value
|
3545
3518
|
* an expression whose result is the new value of the class
|
3546
3519
|
* variable
|
3547
3520
|
*/
|
3548
3521
|
rb_define_method(rb_cCVDECL, "value", node_value, 0);
|
3549
3522
|
rb_ary_push(members, rb_str_new2("value"));
|
3550
|
-
|
3551
|
-
/* Document-method: vid
|
3552
|
-
* the name of the class variable to assign
|
3553
|
-
*/
|
3554
|
-
rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
|
3555
|
-
rb_ary_push(members, rb_str_new2("vid"));
|
3556
3523
|
}
|
3557
3524
|
|
3558
3525
|
/* Document-class: Node::DASGN
|
@@ -3575,17 +3542,17 @@ void define_node_subclass_methods()
|
|
3575
3542
|
rb_iv_set(rb_cDASGN, "__type__", INT2NUM(NODE_DASGN));
|
3576
3543
|
rb_define_singleton_method(rb_cDASGN, "members", node_s_members, 0);
|
3577
3544
|
|
3578
|
-
/* Document-method: value
|
3579
|
-
* the value to assign to the local variable
|
3580
|
-
*/
|
3581
|
-
rb_define_method(rb_cDASGN, "value", node_value, 0);
|
3582
|
-
rb_ary_push(members, rb_str_new2("value"));
|
3583
|
-
|
3584
3545
|
/* Document-method: vid
|
3585
3546
|
* the name of the local variable
|
3586
3547
|
*/
|
3587
3548
|
rb_define_method(rb_cDASGN, "vid", node_vid, 0);
|
3588
3549
|
rb_ary_push(members, rb_str_new2("vid"));
|
3550
|
+
|
3551
|
+
/* Document-method: value
|
3552
|
+
* the value to assign to the local variable
|
3553
|
+
*/
|
3554
|
+
rb_define_method(rb_cDASGN, "value", node_value, 0);
|
3555
|
+
rb_ary_push(members, rb_str_new2("value"));
|
3589
3556
|
}
|
3590
3557
|
|
3591
3558
|
/* Document-class: Node::DASGN_CURR
|
@@ -3600,17 +3567,17 @@ void define_node_subclass_methods()
|
|
3600
3567
|
rb_iv_set(rb_cDASGN_CURR, "__type__", INT2NUM(NODE_DASGN_CURR));
|
3601
3568
|
rb_define_singleton_method(rb_cDASGN_CURR, "members", node_s_members, 0);
|
3602
3569
|
|
3603
|
-
/* Document-method: value
|
3604
|
-
* the value to assign to the local variable
|
3605
|
-
*/
|
3606
|
-
rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
|
3607
|
-
rb_ary_push(members, rb_str_new2("value"));
|
3608
|
-
|
3609
3570
|
/* Document-method: vid
|
3610
3571
|
* the name of the local variable
|
3611
3572
|
*/
|
3612
3573
|
rb_define_method(rb_cDASGN_CURR, "vid", node_vid, 0);
|
3613
3574
|
rb_ary_push(members, rb_str_new2("vid"));
|
3575
|
+
|
3576
|
+
/* Document-method: value
|
3577
|
+
* the value to assign to the local variable
|
3578
|
+
*/
|
3579
|
+
rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
|
3580
|
+
rb_ary_push(members, rb_str_new2("value"));
|
3614
3581
|
}
|
3615
3582
|
|
3616
3583
|
/* Document-class: Node::DEFINED
|
@@ -3646,18 +3613,18 @@ void define_node_subclass_methods()
|
|
3646
3613
|
rb_iv_set(rb_cDEFN, "__type__", INT2NUM(NODE_DEFN));
|
3647
3614
|
rb_define_singleton_method(rb_cDEFN, "members", node_s_members, 0);
|
3648
3615
|
|
3649
|
-
/* Document-method: defn
|
3650
|
-
* the body of the method definition
|
3651
|
-
*/
|
3652
|
-
rb_define_method(rb_cDEFN, "defn", node_defn, 0);
|
3653
|
-
rb_ary_push(members, rb_str_new2("defn"));
|
3654
|
-
|
3655
3616
|
/* Document-method: mid
|
3656
3617
|
* the name of the method* defn the body of the method
|
3657
3618
|
*/
|
3658
3619
|
rb_define_method(rb_cDEFN, "mid", node_mid, 0);
|
3659
3620
|
rb_ary_push(members, rb_str_new2("mid"));
|
3660
3621
|
|
3622
|
+
/* Document-method: defn
|
3623
|
+
* the body of the method definition
|
3624
|
+
*/
|
3625
|
+
rb_define_method(rb_cDEFN, "defn", node_defn, 0);
|
3626
|
+
rb_ary_push(members, rb_str_new2("defn"));
|
3627
|
+
|
3661
3628
|
/* Document-method: noex
|
3662
3629
|
* the flags which should be used to define the method
|
3663
3630
|
*/
|
@@ -3678,14 +3645,14 @@ void define_node_subclass_methods()
|
|
3678
3645
|
rb_iv_set(rb_cDEFS, "__member__", members);
|
3679
3646
|
rb_iv_set(rb_cDEFS, "__type__", INT2NUM(NODE_DEFS));
|
3680
3647
|
rb_define_singleton_method(rb_cDEFS, "members", node_s_members, 0);
|
3681
|
-
rb_define_method(rb_cDEFS, "defn", node_defn, 0);
|
3682
|
-
rb_ary_push(members, rb_str_new2("defn"));
|
3683
3648
|
|
3684
3649
|
/* Document-method: mid
|
3685
3650
|
* the name of the method* defn the body of the method
|
3686
3651
|
*/
|
3687
3652
|
rb_define_method(rb_cDEFS, "mid", node_mid, 0);
|
3688
3653
|
rb_ary_push(members, rb_str_new2("mid"));
|
3654
|
+
rb_define_method(rb_cDEFS, "defn", node_defn, 0);
|
3655
|
+
rb_ary_push(members, rb_str_new2("defn"));
|
3689
3656
|
|
3690
3657
|
/* Document-method: recv
|
3691
3658
|
* the object to whose singleton class the new method is to be added
|
@@ -3707,12 +3674,6 @@ void define_node_subclass_methods()
|
|
3707
3674
|
rb_iv_set(rb_cDOT2, "__type__", INT2NUM(NODE_DOT2));
|
3708
3675
|
rb_define_singleton_method(rb_cDOT2, "members", node_s_members, 0);
|
3709
3676
|
|
3710
|
-
/* Document-method: beg
|
3711
|
-
* the beginning of the range
|
3712
|
-
*/
|
3713
|
-
rb_define_method(rb_cDOT2, "beg", node_beg, 0);
|
3714
|
-
rb_ary_push(members, rb_str_new2("beg"));
|
3715
|
-
|
3716
3677
|
/* Document-method: end
|
3717
3678
|
* the end of the range
|
3718
3679
|
*/
|
@@ -3720,6 +3681,12 @@ void define_node_subclass_methods()
|
|
3720
3681
|
rb_ary_push(members, rb_str_new2("end"));
|
3721
3682
|
rb_define_method(rb_cDOT2, "state", node_state, 0);
|
3722
3683
|
rb_ary_push(members, rb_str_new2("state"));
|
3684
|
+
|
3685
|
+
/* Document-method: beg
|
3686
|
+
* the beginning of the range
|
3687
|
+
*/
|
3688
|
+
rb_define_method(rb_cDOT2, "beg", node_beg, 0);
|
3689
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
3723
3690
|
}
|
3724
3691
|
|
3725
3692
|
/* Document-class: Node::DOT3
|
@@ -3735,12 +3702,6 @@ void define_node_subclass_methods()
|
|
3735
3702
|
rb_iv_set(rb_cDOT3, "__type__", INT2NUM(NODE_DOT3));
|
3736
3703
|
rb_define_singleton_method(rb_cDOT3, "members", node_s_members, 0);
|
3737
3704
|
|
3738
|
-
/* Document-method: beg
|
3739
|
-
* the beginning of the range
|
3740
|
-
*/
|
3741
|
-
rb_define_method(rb_cDOT3, "beg", node_beg, 0);
|
3742
|
-
rb_ary_push(members, rb_str_new2("beg"));
|
3743
|
-
|
3744
3705
|
/* Document-method: end
|
3745
3706
|
* the end of the range
|
3746
3707
|
*/
|
@@ -3748,6 +3709,12 @@ void define_node_subclass_methods()
|
|
3748
3709
|
rb_ary_push(members, rb_str_new2("end"));
|
3749
3710
|
rb_define_method(rb_cDOT3, "state", node_state, 0);
|
3750
3711
|
rb_ary_push(members, rb_str_new2("state"));
|
3712
|
+
|
3713
|
+
/* Document-method: beg
|
3714
|
+
* the beginning of the range
|
3715
|
+
*/
|
3716
|
+
rb_define_method(rb_cDOT3, "beg", node_beg, 0);
|
3717
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
3751
3718
|
}
|
3752
3719
|
|
3753
3720
|
/* Document-class: Node::DREGX
|
@@ -4003,64 +3970,32 @@ void define_node_subclass_methods()
|
|
4003
3970
|
rb_define_singleton_method(rb_cFALSE, "members", node_s_members, 0);
|
4004
3971
|
}
|
4005
3972
|
|
4006
|
-
/* Document-class: Node::
|
4007
|
-
*
|
4008
|
-
*
|
4009
|
-
*
|
3973
|
+
/* Document-class: Node::FCALL
|
3974
|
+
* Represents a method call in the form:
|
3975
|
+
* mid(args).
|
3976
|
+
*
|
3977
|
+
* This makes a method call on an object using self as the implicit
|
3978
|
+
* receiver.
|
4010
3979
|
*/
|
4011
3980
|
{
|
4012
|
-
VALUE
|
4013
|
-
members = rb_ary_new();
|
4014
|
-
rb_cNodeSubclass[NODE_FBODY] = rb_cFBODY;
|
4015
|
-
rb_iv_set(rb_cFBODY, "__member__", members);
|
4016
|
-
rb_iv_set(rb_cFBODY, "__type__", INT2NUM(NODE_FBODY));
|
4017
|
-
rb_define_singleton_method(rb_cFBODY, "members", node_s_members, 0);
|
4018
|
-
|
4019
|
-
/* Document-method: body
|
4020
|
-
* the method body
|
4021
|
-
*/
|
4022
|
-
rb_define_method(rb_cFBODY, "body", node_body, 0);
|
4023
|
-
rb_ary_push(members, rb_str_new2("body"));
|
4024
|
-
|
4025
|
-
/* Document-method: cnt
|
4026
|
-
* the method's flags
|
4027
|
-
*/
|
4028
|
-
rb_define_method(rb_cFBODY, "cnt", node_cnt, 0);
|
4029
|
-
rb_ary_push(members, rb_str_new2("cnt"));
|
4030
|
-
|
4031
|
-
/* Document-method: oid
|
4032
|
-
* the original name of the method
|
4033
|
-
*/
|
4034
|
-
rb_define_method(rb_cFBODY, "oid", node_oid, 0);
|
4035
|
-
rb_ary_push(members, rb_str_new2("oid"));
|
4036
|
-
}
|
4037
|
-
|
4038
|
-
/* Document-class: Node::FCALL
|
4039
|
-
* Represents a method call in the form:
|
4040
|
-
* mid(args).
|
4041
|
-
*
|
4042
|
-
* This makes a method call on an object using self as the implicit
|
4043
|
-
* receiver.
|
4044
|
-
*/
|
4045
|
-
{
|
4046
|
-
VALUE rb_cFCALL = rb_define_class_under(rb_cNode, "FCALL", rb_cNode);
|
3981
|
+
VALUE rb_cFCALL = rb_define_class_under(rb_cNode, "FCALL", rb_cNode);
|
4047
3982
|
members = rb_ary_new();
|
4048
3983
|
rb_cNodeSubclass[NODE_FCALL] = rb_cFCALL;
|
4049
3984
|
rb_iv_set(rb_cFCALL, "__member__", members);
|
4050
3985
|
rb_iv_set(rb_cFCALL, "__type__", INT2NUM(NODE_FCALL));
|
4051
3986
|
rb_define_singleton_method(rb_cFCALL, "members", node_s_members, 0);
|
4052
3987
|
|
4053
|
-
/* Document-method: args
|
4054
|
-
* the arguments to the method
|
4055
|
-
*/
|
4056
|
-
rb_define_method(rb_cFCALL, "args", node_args, 0);
|
4057
|
-
rb_ary_push(members, rb_str_new2("args"));
|
4058
|
-
|
4059
3988
|
/* Document-method: mid
|
4060
3989
|
* the method id
|
4061
3990
|
*/
|
4062
3991
|
rb_define_method(rb_cFCALL, "mid", node_mid, 0);
|
4063
3992
|
rb_ary_push(members, rb_str_new2("mid"));
|
3993
|
+
|
3994
|
+
/* Document-method: args
|
3995
|
+
* the arguments to the method
|
3996
|
+
*/
|
3997
|
+
rb_define_method(rb_cFCALL, "args", node_args, 0);
|
3998
|
+
rb_ary_push(members, rb_str_new2("args"));
|
4064
3999
|
}
|
4065
4000
|
|
4066
4001
|
/* Document-class: Node::FLIP2
|
@@ -4077,11 +4012,12 @@ void define_node_subclass_methods()
|
|
4077
4012
|
rb_iv_set(rb_cFLIP2, "__type__", INT2NUM(NODE_FLIP2));
|
4078
4013
|
rb_define_singleton_method(rb_cFLIP2, "members", node_s_members, 0);
|
4079
4014
|
|
4080
|
-
/* Document-method:
|
4081
|
-
* the
|
4015
|
+
/* Document-method: cnt
|
4016
|
+
* the index into the local variable table of the special variable
|
4017
|
+
* to use in the flip-flop expression (usually 2 for $_)
|
4082
4018
|
*/
|
4083
|
-
rb_define_method(rb_cFLIP2, "
|
4084
|
-
rb_ary_push(members, rb_str_new2("
|
4019
|
+
rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
|
4020
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
4085
4021
|
|
4086
4022
|
/* Document-method: end
|
4087
4023
|
* the end of the range
|
@@ -4089,12 +4025,11 @@ void define_node_subclass_methods()
|
|
4089
4025
|
rb_define_method(rb_cFLIP2, "end", node_end, 0);
|
4090
4026
|
rb_ary_push(members, rb_str_new2("end"));
|
4091
4027
|
|
4092
|
-
/* Document-method:
|
4093
|
-
* the
|
4094
|
-
* to use in the flip-flop expression (usually 2 for $_)
|
4028
|
+
/* Document-method: beg
|
4029
|
+
* the beginning of the range
|
4095
4030
|
*/
|
4096
|
-
rb_define_method(rb_cFLIP2, "
|
4097
|
-
rb_ary_push(members, rb_str_new2("
|
4031
|
+
rb_define_method(rb_cFLIP2, "beg", node_beg, 0);
|
4032
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
4098
4033
|
}
|
4099
4034
|
|
4100
4035
|
/* Document-class: Node::FLIP3
|
@@ -4111,11 +4046,12 @@ void define_node_subclass_methods()
|
|
4111
4046
|
rb_iv_set(rb_cFLIP3, "__type__", INT2NUM(NODE_FLIP3));
|
4112
4047
|
rb_define_singleton_method(rb_cFLIP3, "members", node_s_members, 0);
|
4113
4048
|
|
4114
|
-
/* Document-method:
|
4115
|
-
* the
|
4049
|
+
/* Document-method: cnt
|
4050
|
+
* the index into the local variable table of the special variable
|
4051
|
+
* to use in the flip-flop expression (usually 2 for $_)
|
4116
4052
|
*/
|
4117
|
-
rb_define_method(rb_cFLIP3, "
|
4118
|
-
rb_ary_push(members, rb_str_new2("
|
4053
|
+
rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
|
4054
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
4119
4055
|
|
4120
4056
|
/* Document-method: end
|
4121
4057
|
* the end of the range
|
@@ -4123,12 +4059,11 @@ void define_node_subclass_methods()
|
|
4123
4059
|
rb_define_method(rb_cFLIP3, "end", node_end, 0);
|
4124
4060
|
rb_ary_push(members, rb_str_new2("end"));
|
4125
4061
|
|
4126
|
-
/* Document-method:
|
4127
|
-
* the
|
4128
|
-
* to use in the flip-flop expression (usually 2 for $_)
|
4062
|
+
/* Document-method: beg
|
4063
|
+
* the beginning of the range
|
4129
4064
|
*/
|
4130
|
-
rb_define_method(rb_cFLIP3, "
|
4131
|
-
rb_ary_push(members, rb_str_new2("
|
4065
|
+
rb_define_method(rb_cFLIP3, "beg", node_beg, 0);
|
4066
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
4132
4067
|
}
|
4133
4068
|
|
4134
4069
|
/* Document-class: Node::FOR
|
@@ -4153,18 +4088,18 @@ void define_node_subclass_methods()
|
|
4153
4088
|
rb_iv_set(rb_cFOR, "__type__", INT2NUM(NODE_FOR));
|
4154
4089
|
rb_define_singleton_method(rb_cFOR, "members", node_s_members, 0);
|
4155
4090
|
|
4156
|
-
/* Document-method: body
|
4157
|
-
* the body of the loop
|
4158
|
-
*/
|
4159
|
-
rb_define_method(rb_cFOR, "body", node_body, 0);
|
4160
|
-
rb_ary_push(members, rb_str_new2("body"));
|
4161
|
-
|
4162
4091
|
/* Document-method: iter
|
4163
4092
|
* the sequence over which to iterate
|
4164
4093
|
*/
|
4165
4094
|
rb_define_method(rb_cFOR, "iter", node_iter, 0);
|
4166
4095
|
rb_ary_push(members, rb_str_new2("iter"));
|
4167
4096
|
|
4097
|
+
/* Document-method: body
|
4098
|
+
* the body of the loop
|
4099
|
+
*/
|
4100
|
+
rb_define_method(rb_cFOR, "body", node_body, 0);
|
4101
|
+
rb_ary_push(members, rb_str_new2("body"));
|
4102
|
+
|
4168
4103
|
/* Document-method: var
|
4169
4104
|
* an assignment node which assigns the next value in the sequence
|
4170
4105
|
* to a variable, which may or may not be local. May also be a
|
@@ -4185,12 +4120,6 @@ void define_node_subclass_methods()
|
|
4185
4120
|
rb_iv_set(rb_cGASGN, "__type__", INT2NUM(NODE_GASGN));
|
4186
4121
|
rb_define_singleton_method(rb_cGASGN, "members", node_s_members, 0);
|
4187
4122
|
|
4188
|
-
/* Document-method: value
|
4189
|
-
* an expression whose result is the new value of the global variable
|
4190
|
-
*/
|
4191
|
-
rb_define_method(rb_cGASGN, "value", node_value, 0);
|
4192
|
-
rb_ary_push(members, rb_str_new2("value"));
|
4193
|
-
|
4194
4123
|
/* Document-method: vid
|
4195
4124
|
* the name of the global variable, with a leading '$' character.
|
4196
4125
|
*/
|
@@ -4198,6 +4127,12 @@ void define_node_subclass_methods()
|
|
4198
4127
|
rb_ary_push(members, rb_str_new2("vid"));
|
4199
4128
|
rb_define_method(rb_cGASGN, "entry", node_entry, 0);
|
4200
4129
|
rb_ary_push(members, rb_str_new2("entry"));
|
4130
|
+
|
4131
|
+
/* Document-method: value
|
4132
|
+
* an expression whose result is the new value of the global variable
|
4133
|
+
*/
|
4134
|
+
rb_define_method(rb_cGASGN, "value", node_value, 0);
|
4135
|
+
rb_ary_push(members, rb_str_new2("value"));
|
4201
4136
|
}
|
4202
4137
|
|
4203
4138
|
/* Document-class: Node::GVAR
|
@@ -4250,17 +4185,17 @@ void define_node_subclass_methods()
|
|
4250
4185
|
rb_iv_set(rb_cIASGN, "__type__", INT2NUM(NODE_IASGN));
|
4251
4186
|
rb_define_singleton_method(rb_cIASGN, "members", node_s_members, 0);
|
4252
4187
|
|
4253
|
-
/* Document-method: value
|
4254
|
-
* the value to assign to the instance variable
|
4255
|
-
*/
|
4256
|
-
rb_define_method(rb_cIASGN, "value", node_value, 0);
|
4257
|
-
rb_ary_push(members, rb_str_new2("value"));
|
4258
|
-
|
4259
4188
|
/* Document-method: vid
|
4260
4189
|
* the name of the instance variable, with a leading '@' sign
|
4261
4190
|
*/
|
4262
4191
|
rb_define_method(rb_cIASGN, "vid", node_vid, 0);
|
4263
4192
|
rb_ary_push(members, rb_str_new2("vid"));
|
4193
|
+
|
4194
|
+
/* Document-method: value
|
4195
|
+
* the value to assign to the instance variable
|
4196
|
+
*/
|
4197
|
+
rb_define_method(rb_cIASGN, "value", node_value, 0);
|
4198
|
+
rb_ary_push(members, rb_str_new2("value"));
|
4264
4199
|
}
|
4265
4200
|
|
4266
4201
|
/* Document-class: Node::IF
|
@@ -4292,12 +4227,6 @@ void define_node_subclass_methods()
|
|
4292
4227
|
rb_iv_set(rb_cIF, "__type__", INT2NUM(NODE_IF));
|
4293
4228
|
rb_define_singleton_method(rb_cIF, "members", node_s_members, 0);
|
4294
4229
|
|
4295
|
-
/* Document-method: cond
|
4296
|
-
* the condition to evaluate
|
4297
|
-
*/
|
4298
|
-
rb_define_method(rb_cIF, "cond", node_cond, 0);
|
4299
|
-
rb_ary_push(members, rb_str_new2("cond"));
|
4300
|
-
|
4301
4230
|
/* Document-method: body
|
4302
4231
|
* the expression to evaluate if the expression is true, or false
|
4303
4232
|
* if the expression is empty
|
@@ -4305,6 +4234,12 @@ void define_node_subclass_methods()
|
|
4305
4234
|
rb_define_method(rb_cIF, "body", node_body, 0);
|
4306
4235
|
rb_ary_push(members, rb_str_new2("body"));
|
4307
4236
|
|
4237
|
+
/* Document-method: cond
|
4238
|
+
* the condition to evaluate
|
4239
|
+
*/
|
4240
|
+
rb_define_method(rb_cIF, "cond", node_cond, 0);
|
4241
|
+
rb_ary_push(members, rb_str_new2("cond"));
|
4242
|
+
|
4308
4243
|
/* Document-method: else
|
4309
4244
|
* the expression to evaluate if the expression is false, or false
|
4310
4245
|
* if the expression is empty
|
@@ -4324,6 +4259,12 @@ void define_node_subclass_methods()
|
|
4324
4259
|
rb_iv_set(rb_cIFUNC, "__type__", INT2NUM(NODE_IFUNC));
|
4325
4260
|
rb_define_singleton_method(rb_cIFUNC, "members", node_s_members, 0);
|
4326
4261
|
|
4262
|
+
/* Document-method: state
|
4263
|
+
* always 0
|
4264
|
+
*/
|
4265
|
+
rb_define_method(rb_cIFUNC, "state", node_state, 0);
|
4266
|
+
rb_ary_push(members, rb_str_new2("state"));
|
4267
|
+
|
4327
4268
|
/* Document-method: cfnc
|
4328
4269
|
* a pointer to the C function to which to yield
|
4329
4270
|
*/
|
@@ -4336,12 +4277,6 @@ void define_node_subclass_methods()
|
|
4336
4277
|
*/
|
4337
4278
|
rb_define_method(rb_cIFUNC, "tval", node_tval, 0);
|
4338
4279
|
rb_ary_push(members, rb_str_new2("tval"));
|
4339
|
-
|
4340
|
-
/* Document-method: state
|
4341
|
-
* always 0
|
4342
|
-
*/
|
4343
|
-
rb_define_method(rb_cIFUNC, "state", node_state, 0);
|
4344
|
-
rb_ary_push(members, rb_str_new2("state"));
|
4345
4280
|
}
|
4346
4281
|
|
4347
4282
|
/* Document-class: Node::ITER
|
@@ -4365,12 +4300,6 @@ void define_node_subclass_methods()
|
|
4365
4300
|
rb_iv_set(rb_cITER, "__type__", INT2NUM(NODE_ITER));
|
4366
4301
|
rb_define_singleton_method(rb_cITER, "members", node_s_members, 0);
|
4367
4302
|
|
4368
|
-
/* Document-method: body
|
4369
|
-
* the body of the loop
|
4370
|
-
*/
|
4371
|
-
rb_define_method(rb_cITER, "body", node_body, 0);
|
4372
|
-
rb_ary_push(members, rb_str_new2("body"));
|
4373
|
-
|
4374
4303
|
/* Document-method: iter
|
4375
4304
|
* an expression which calls the desired iteration method, usually
|
4376
4305
|
* recv.each
|
@@ -4378,6 +4307,12 @@ void define_node_subclass_methods()
|
|
4378
4307
|
rb_define_method(rb_cITER, "iter", node_iter, 0);
|
4379
4308
|
rb_ary_push(members, rb_str_new2("iter"));
|
4380
4309
|
|
4310
|
+
/* Document-method: body
|
4311
|
+
* the body of the loop
|
4312
|
+
*/
|
4313
|
+
rb_define_method(rb_cITER, "body", node_body, 0);
|
4314
|
+
rb_ary_push(members, rb_str_new2("body"));
|
4315
|
+
|
4381
4316
|
/* Document-method: var
|
4382
4317
|
* an assignment node which assigns the next value in the sequence
|
4383
4318
|
* to a variable, which may or may not be local. May also be a
|
@@ -4418,20 +4353,20 @@ void define_node_subclass_methods()
|
|
4418
4353
|
rb_iv_set(rb_cLASGN, "__member__", members);
|
4419
4354
|
rb_iv_set(rb_cLASGN, "__type__", INT2NUM(NODE_LASGN));
|
4420
4355
|
rb_define_singleton_method(rb_cLASGN, "members", node_s_members, 0);
|
4421
|
-
|
4422
|
-
|
4423
|
-
* the value to assign to the local variable
|
4424
|
-
*/
|
4425
|
-
rb_define_method(rb_cLASGN, "value", node_value, 0);
|
4426
|
-
rb_ary_push(members, rb_str_new2("value"));
|
4356
|
+
rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
|
4357
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
4427
4358
|
|
4428
4359
|
/* Document-method: vid
|
4429
4360
|
* the name of the local variable
|
4430
4361
|
*/
|
4431
4362
|
rb_define_method(rb_cLASGN, "vid", node_vid, 0);
|
4432
4363
|
rb_ary_push(members, rb_str_new2("vid"));
|
4433
|
-
|
4434
|
-
|
4364
|
+
|
4365
|
+
/* Document-method: value
|
4366
|
+
* the value to assign to the local variable
|
4367
|
+
*/
|
4368
|
+
rb_define_method(rb_cLASGN, "value", node_value, 0);
|
4369
|
+
rb_ary_push(members, rb_str_new2("value"));
|
4435
4370
|
}
|
4436
4371
|
|
4437
4372
|
/* Document-class: Node::LIT
|
@@ -4463,14 +4398,14 @@ void define_node_subclass_methods()
|
|
4463
4398
|
rb_iv_set(rb_cLVAR, "__member__", members);
|
4464
4399
|
rb_iv_set(rb_cLVAR, "__type__", INT2NUM(NODE_LVAR));
|
4465
4400
|
rb_define_singleton_method(rb_cLVAR, "members", node_s_members, 0);
|
4401
|
+
rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
|
4402
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
4466
4403
|
|
4467
4404
|
/* Document-method: vid
|
4468
4405
|
* the name of the local variable to retrieve.
|
4469
4406
|
*/
|
4470
4407
|
rb_define_method(rb_cLVAR, "vid", node_vid, 0);
|
4471
4408
|
rb_ary_push(members, rb_str_new2("vid"));
|
4472
|
-
rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
|
4473
|
-
rb_ary_push(members, rb_str_new2("cnt"));
|
4474
4409
|
}
|
4475
4410
|
|
4476
4411
|
/* Document-class: Node::MASGN
|
@@ -4484,18 +4419,18 @@ void define_node_subclass_methods()
|
|
4484
4419
|
rb_iv_set(rb_cMASGN, "__type__", INT2NUM(NODE_MASGN));
|
4485
4420
|
rb_define_singleton_method(rb_cMASGN, "members", node_s_members, 0);
|
4486
4421
|
|
4487
|
-
/* Document-method: args
|
4488
|
-
* TODO
|
4489
|
-
*/
|
4490
|
-
rb_define_method(rb_cMASGN, "args", node_args, 0);
|
4491
|
-
rb_ary_push(members, rb_str_new2("args"));
|
4492
|
-
|
4493
4422
|
/* Document-method: head
|
4494
4423
|
* TODO
|
4495
4424
|
*/
|
4496
4425
|
rb_define_method(rb_cMASGN, "head", node_head, 0);
|
4497
4426
|
rb_ary_push(members, rb_str_new2("head"));
|
4498
4427
|
|
4428
|
+
/* Document-method: args
|
4429
|
+
* TODO
|
4430
|
+
*/
|
4431
|
+
rb_define_method(rb_cMASGN, "args", node_args, 0);
|
4432
|
+
rb_ary_push(members, rb_str_new2("args"));
|
4433
|
+
|
4499
4434
|
/* Document-method: value
|
4500
4435
|
* TODO
|
4501
4436
|
*/
|
@@ -4563,6 +4498,13 @@ void define_node_subclass_methods()
|
|
4563
4498
|
rb_iv_set(rb_cMATCH2, "__type__", INT2NUM(NODE_MATCH2));
|
4564
4499
|
rb_define_singleton_method(rb_cMATCH2, "members", node_s_members, 0);
|
4565
4500
|
|
4501
|
+
/* Document-method: recv
|
4502
|
+
* the regular expression on the left hand side of the match
|
4503
|
+
* operator
|
4504
|
+
*/
|
4505
|
+
rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
|
4506
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
4507
|
+
|
4566
4508
|
/* Document-method: value
|
4567
4509
|
* the expression on the right hand side of the match operator, or
|
4568
4510
|
* an expression returning $_ if there is nothing on the right hand
|
@@ -4570,13 +4512,6 @@ void define_node_subclass_methods()
|
|
4570
4512
|
*/
|
4571
4513
|
rb_define_method(rb_cMATCH2, "value", node_value, 0);
|
4572
4514
|
rb_ary_push(members, rb_str_new2("value"));
|
4573
|
-
|
4574
|
-
/* Document-method: recv
|
4575
|
-
* the regular expression on the left hand side of the match
|
4576
|
-
* operator
|
4577
|
-
*/
|
4578
|
-
rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
|
4579
|
-
rb_ary_push(members, rb_str_new2("recv"));
|
4580
4515
|
}
|
4581
4516
|
|
4582
4517
|
/* Document-class: Node::MATCH3
|
@@ -4594,17 +4529,17 @@ void define_node_subclass_methods()
|
|
4594
4529
|
rb_iv_set(rb_cMATCH3, "__type__", INT2NUM(NODE_MATCH3));
|
4595
4530
|
rb_define_singleton_method(rb_cMATCH3, "members", node_s_members, 0);
|
4596
4531
|
|
4597
|
-
/* Document-method: value
|
4598
|
-
* the right hand side of the match
|
4599
|
-
*/
|
4600
|
-
rb_define_method(rb_cMATCH3, "value", node_value, 0);
|
4601
|
-
rb_ary_push(members, rb_str_new2("value"));
|
4602
|
-
|
4603
4532
|
/* Document-method: recv
|
4604
4533
|
* the left hand side of the match
|
4605
4534
|
*/
|
4606
4535
|
rb_define_method(rb_cMATCH3, "recv", node_recv, 0);
|
4607
4536
|
rb_ary_push(members, rb_str_new2("recv"));
|
4537
|
+
|
4538
|
+
/* Document-method: value
|
4539
|
+
* the right hand side of the match
|
4540
|
+
*/
|
4541
|
+
rb_define_method(rb_cMATCH3, "value", node_value, 0);
|
4542
|
+
rb_ary_push(members, rb_str_new2("value"));
|
4608
4543
|
}
|
4609
4544
|
|
4610
4545
|
/* Document-class: Node::MEMO
|
@@ -4630,42 +4565,6 @@ void define_node_subclass_methods()
|
|
4630
4565
|
rb_define_singleton_method(rb_cMEMO, "members", node_s_members, 0);
|
4631
4566
|
}
|
4632
4567
|
|
4633
|
-
/* Document-class: Node::METHOD
|
4634
|
-
* A placeholder for a method entry in a class's method table.
|
4635
|
-
*
|
4636
|
-
* On ruby 1.9 this node type is also known as RUBY_VM_METHOD_NODE.
|
4637
|
-
* Its use differs from that of NODE_METHOD in that it is used as the
|
4638
|
-
* body of another METHOD node and is used to store the method's
|
4639
|
-
* instruction sequence.
|
4640
|
-
*/
|
4641
|
-
{
|
4642
|
-
VALUE rb_cMETHOD = rb_define_class_under(rb_cNode, "METHOD", rb_cNode);
|
4643
|
-
members = rb_ary_new();
|
4644
|
-
rb_cNodeSubclass[NODE_METHOD] = rb_cMETHOD;
|
4645
|
-
rb_iv_set(rb_cMETHOD, "__member__", members);
|
4646
|
-
rb_iv_set(rb_cMETHOD, "__type__", INT2NUM(NODE_METHOD));
|
4647
|
-
rb_define_singleton_method(rb_cMETHOD, "members", node_s_members, 0);
|
4648
|
-
|
4649
|
-
/* Document-method: body
|
4650
|
-
* the body of the method
|
4651
|
-
*/
|
4652
|
-
rb_define_method(rb_cMETHOD, "body", node_body, 0);
|
4653
|
-
rb_ary_push(members, rb_str_new2("body"));
|
4654
|
-
|
4655
|
-
/* Document-method: clss
|
4656
|
-
* the class to which the method was added or the instruction
|
4657
|
-
* sequence used to implement this method
|
4658
|
-
*/
|
4659
|
-
rb_define_method(rb_cMETHOD, "clss", node_clss, 0);
|
4660
|
-
rb_ary_push(members, rb_str_new2("clss"));
|
4661
|
-
|
4662
|
-
/* Document-method: noex
|
4663
|
-
* the method's flags
|
4664
|
-
*/
|
4665
|
-
rb_define_method(rb_cMETHOD, "noex", node_noex, 0);
|
4666
|
-
rb_ary_push(members, rb_str_new2("noex"));
|
4667
|
-
}
|
4668
|
-
|
4669
4568
|
/* Document-class: Node::MODULE
|
4670
4569
|
* Represents a module definition, e.g.:
|
4671
4570
|
* module cpath
|
@@ -4685,17 +4584,17 @@ void define_node_subclass_methods()
|
|
4685
4584
|
rb_iv_set(rb_cMODULE, "__type__", INT2NUM(NODE_MODULE));
|
4686
4585
|
rb_define_singleton_method(rb_cMODULE, "members", node_s_members, 0);
|
4687
4586
|
|
4688
|
-
/* Document-method: cpath
|
4689
|
-
* the name of the module to define
|
4690
|
-
*/
|
4691
|
-
rb_define_method(rb_cMODULE, "cpath", node_cpath, 0);
|
4692
|
-
rb_ary_push(members, rb_str_new2("cpath"));
|
4693
|
-
|
4694
4587
|
/* Document-method: body
|
4695
4588
|
* the body of the module definition
|
4696
4589
|
*/
|
4697
4590
|
rb_define_method(rb_cMODULE, "body", node_body, 0);
|
4698
4591
|
rb_ary_push(members, rb_str_new2("body"));
|
4592
|
+
|
4593
|
+
/* Document-method: cpath
|
4594
|
+
* the name of the module to define
|
4595
|
+
*/
|
4596
|
+
rb_define_method(rb_cMODULE, "cpath", node_cpath, 0);
|
4597
|
+
rb_ary_push(members, rb_str_new2("cpath"));
|
4699
4598
|
}
|
4700
4599
|
|
4701
4600
|
/* Document-class: Node::NEXT
|
@@ -4737,17 +4636,17 @@ void define_node_subclass_methods()
|
|
4737
4636
|
rb_iv_set(rb_cNTH_REF, "__type__", INT2NUM(NODE_NTH_REF));
|
4738
4637
|
rb_define_singleton_method(rb_cNTH_REF, "members", node_s_members, 0);
|
4739
4638
|
|
4740
|
-
/* Document-method: nth
|
4741
|
-
* the index of the match data item to retrieve
|
4742
|
-
*/
|
4743
|
-
rb_define_method(rb_cNTH_REF, "nth", node_nth, 0);
|
4744
|
-
rb_ary_push(members, rb_str_new2("nth"));
|
4745
|
-
|
4746
4639
|
/* Document-method: cnt
|
4747
4640
|
* the index into the local variable table where the match data is stored
|
4748
4641
|
*/
|
4749
4642
|
rb_define_method(rb_cNTH_REF, "cnt", node_cnt, 0);
|
4750
4643
|
rb_ary_push(members, rb_str_new2("cnt"));
|
4644
|
+
|
4645
|
+
/* Document-method: nth
|
4646
|
+
* the index of the match data item to retrieve
|
4647
|
+
*/
|
4648
|
+
rb_define_method(rb_cNTH_REF, "nth", node_nth, 0);
|
4649
|
+
rb_ary_push(members, rb_str_new2("nth"));
|
4751
4650
|
}
|
4752
4651
|
|
4753
4652
|
/* Document-class: Node::OPT_N
|
@@ -4800,12 +4699,6 @@ void define_node_subclass_methods()
|
|
4800
4699
|
rb_iv_set(rb_cOP_ASGN1, "__type__", INT2NUM(NODE_OP_ASGN1));
|
4801
4700
|
rb_define_singleton_method(rb_cOP_ASGN1, "members", node_s_members, 0);
|
4802
4701
|
|
4803
|
-
/* Document-method: args
|
4804
|
-
* the arguments to the assigment
|
4805
|
-
*/
|
4806
|
-
rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
|
4807
|
-
rb_ary_push(members, rb_str_new2("args"));
|
4808
|
-
|
4809
4702
|
/* Document-method: mid
|
4810
4703
|
* 0, 1, or the name a method to call to calculate the value of the
|
4811
4704
|
* rhs
|
@@ -4818,6 +4711,12 @@ void define_node_subclass_methods()
|
|
4818
4711
|
*/
|
4819
4712
|
rb_define_method(rb_cOP_ASGN1, "recv", node_recv, 0);
|
4820
4713
|
rb_ary_push(members, rb_str_new2("recv"));
|
4714
|
+
|
4715
|
+
/* Document-method: args
|
4716
|
+
* the arguments to the assigment
|
4717
|
+
*/
|
4718
|
+
rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
|
4719
|
+
rb_ary_push(members, rb_str_new2("args"));
|
4821
4720
|
}
|
4822
4721
|
|
4823
4722
|
/* Document-class: Node::OP_ASGN2
|
@@ -4840,11 +4739,11 @@ void define_node_subclass_methods()
|
|
4840
4739
|
rb_iv_set(rb_cOP_ASGN2, "__type__", INT2NUM(NODE_OP_ASGN2));
|
4841
4740
|
rb_define_singleton_method(rb_cOP_ASGN2, "members", node_s_members, 0);
|
4842
4741
|
|
4843
|
-
/* Document-method:
|
4844
|
-
* the
|
4742
|
+
/* Document-method: recv
|
4743
|
+
* the receiver of the attribute
|
4845
4744
|
*/
|
4846
|
-
rb_define_method(rb_cOP_ASGN2, "
|
4847
|
-
rb_ary_push(members, rb_str_new2("
|
4745
|
+
rb_define_method(rb_cOP_ASGN2, "recv", node_recv, 0);
|
4746
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
4848
4747
|
|
4849
4748
|
/* Document-method: next
|
4850
4749
|
* another node of type OP_ASGN2 which contains more information
|
@@ -4853,11 +4752,11 @@ void define_node_subclass_methods()
|
|
4853
4752
|
rb_define_method(rb_cOP_ASGN2, "next", node_next, 0);
|
4854
4753
|
rb_ary_push(members, rb_str_new2("next"));
|
4855
4754
|
|
4856
|
-
/* Document-method:
|
4857
|
-
* the
|
4755
|
+
/* Document-method: value
|
4756
|
+
* the value to assign to the attribute
|
4858
4757
|
*/
|
4859
|
-
rb_define_method(rb_cOP_ASGN2, "
|
4860
|
-
rb_ary_push(members, rb_str_new2("
|
4758
|
+
rb_define_method(rb_cOP_ASGN2, "value", node_value, 0);
|
4759
|
+
rb_ary_push(members, rb_str_new2("value"));
|
4861
4760
|
}
|
4862
4761
|
|
4863
4762
|
/* Document-class: Node::OP_ASGN2_ARG
|
@@ -4873,6 +4772,14 @@ void define_node_subclass_methods()
|
|
4873
4772
|
rb_iv_set(rb_cOP_ASGN2_ARG, "__type__", INT2NUM(NODE_OP_ASGN2_ARG));
|
4874
4773
|
rb_define_singleton_method(rb_cOP_ASGN2_ARG, "members", node_s_members, 0);
|
4875
4774
|
|
4775
|
+
/* Document-method: mid
|
4776
|
+
* The operation to apply to the attribute before setting it. May
|
4777
|
+
* be 0 (false) to indicate "logical or" or 1 (nil) to indicate
|
4778
|
+
* "logical and".
|
4779
|
+
*/
|
4780
|
+
rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
|
4781
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
4782
|
+
|
4876
4783
|
/* Document-method: vid
|
4877
4784
|
* The method to call on the receiver to retrieve the attribute
|
4878
4785
|
*/
|
@@ -4884,14 +4791,6 @@ void define_node_subclass_methods()
|
|
4884
4791
|
*/
|
4885
4792
|
rb_define_method(rb_cOP_ASGN2_ARG, "aid", node_aid, 0);
|
4886
4793
|
rb_ary_push(members, rb_str_new2("aid"));
|
4887
|
-
|
4888
|
-
/* Document-method: mid
|
4889
|
-
* The operation to apply to the attribute before setting it. May
|
4890
|
-
* be 0 (false) to indicate "logical or" or 1 (nil) to indicate
|
4891
|
-
* "logical and".
|
4892
|
-
*/
|
4893
|
-
rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
|
4894
|
-
rb_ary_push(members, rb_str_new2("mid"));
|
4895
4794
|
}
|
4896
4795
|
|
4897
4796
|
/* Document-class: Node::OP_ASGN_AND
|
@@ -4910,18 +4809,18 @@ void define_node_subclass_methods()
|
|
4910
4809
|
rb_iv_set(rb_cOP_ASGN_AND, "__type__", INT2NUM(NODE_OP_ASGN_AND));
|
4911
4810
|
rb_define_singleton_method(rb_cOP_ASGN_AND, "members", node_s_members, 0);
|
4912
4811
|
|
4812
|
+
/* Document-method: recv
|
4813
|
+
* an expression representing the left hand side of the assignment
|
4814
|
+
*/
|
4815
|
+
rb_define_method(rb_cOP_ASGN_AND, "recv", node_recv, 0);
|
4816
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
4817
|
+
|
4913
4818
|
/* Document-method: value
|
4914
4819
|
* an expression representing the assignment that should be
|
4915
4820
|
* performed if the left hand side is true
|
4916
4821
|
*/
|
4917
4822
|
rb_define_method(rb_cOP_ASGN_AND, "value", node_value, 0);
|
4918
4823
|
rb_ary_push(members, rb_str_new2("value"));
|
4919
|
-
|
4920
|
-
/* Document-method: recv
|
4921
|
-
* an expression representing the left hand side of the assignment
|
4922
|
-
*/
|
4923
|
-
rb_define_method(rb_cOP_ASGN_AND, "recv", node_recv, 0);
|
4924
|
-
rb_ary_push(members, rb_str_new2("recv"));
|
4925
4824
|
}
|
4926
4825
|
|
4927
4826
|
/* Document-class: Node::OP_ASGN_OR
|
@@ -4940,6 +4839,12 @@ void define_node_subclass_methods()
|
|
4940
4839
|
rb_iv_set(rb_cOP_ASGN_OR, "__type__", INT2NUM(NODE_OP_ASGN_OR));
|
4941
4840
|
rb_define_singleton_method(rb_cOP_ASGN_OR, "members", node_s_members, 0);
|
4942
4841
|
|
4842
|
+
/* Document-method: recv
|
4843
|
+
* the receiver of the assignment
|
4844
|
+
*/
|
4845
|
+
rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
|
4846
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
4847
|
+
|
4943
4848
|
/* Document-method: aid
|
4944
4849
|
* if this indicator is nonzero, ruby will check to see if the
|
4945
4850
|
* provided expression is defined, otherwise it will assume that
|
@@ -4953,12 +4858,6 @@ void define_node_subclass_methods()
|
|
4953
4858
|
*/
|
4954
4859
|
rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
|
4955
4860
|
rb_ary_push(members, rb_str_new2("value"));
|
4956
|
-
|
4957
|
-
/* Document-method: recv
|
4958
|
-
* the receiver of the assignment
|
4959
|
-
*/
|
4960
|
-
rb_define_method(rb_cOP_ASGN_OR, "recv", node_recv, 0);
|
4961
|
-
rb_ary_push(members, rb_str_new2("recv"));
|
4962
4861
|
}
|
4963
4862
|
|
4964
4863
|
/* Document-class: Node::OR
|
@@ -4976,17 +4875,17 @@ void define_node_subclass_methods()
|
|
4976
4875
|
rb_iv_set(rb_cOR, "__type__", INT2NUM(NODE_OR));
|
4977
4876
|
rb_define_singleton_method(rb_cOR, "members", node_s_members, 0);
|
4978
4877
|
|
4979
|
-
/* Document-method: first
|
4980
|
-
* the expression on the left hand side
|
4981
|
-
*/
|
4982
|
-
rb_define_method(rb_cOR, "first", node_1st, 0);
|
4983
|
-
rb_ary_push(members, rb_str_new2("first"));
|
4984
|
-
|
4985
4878
|
/* Document-method: second
|
4986
4879
|
* the expression on the right hand side
|
4987
4880
|
*/
|
4988
4881
|
rb_define_method(rb_cOR, "second", node_2nd, 0);
|
4989
4882
|
rb_ary_push(members, rb_str_new2("second"));
|
4883
|
+
|
4884
|
+
/* Document-method: first
|
4885
|
+
* the expression on the left hand side
|
4886
|
+
*/
|
4887
|
+
rb_define_method(rb_cOR, "first", node_1st, 0);
|
4888
|
+
rb_ary_push(members, rb_str_new2("first"));
|
4990
4889
|
}
|
4991
4890
|
|
4992
4891
|
/* Document-class: Node::POSTEXE
|
@@ -5044,17 +4943,17 @@ void define_node_subclass_methods()
|
|
5044
4943
|
rb_define_method(rb_cRESBODY, "head", node_head, 0);
|
5045
4944
|
rb_ary_push(members, rb_str_new2("head"));
|
5046
4945
|
|
5047
|
-
/* Document-method: args
|
5048
|
-
* the expression type to match against
|
5049
|
-
*/
|
5050
|
-
rb_define_method(rb_cRESBODY, "args", node_args, 0);
|
5051
|
-
rb_ary_push(members, rb_str_new2("args"));
|
5052
|
-
|
5053
4946
|
/* Document-method: body
|
5054
4947
|
* the expresion to evaluate if the exception type matches
|
5055
4948
|
*/
|
5056
4949
|
rb_define_method(rb_cRESBODY, "body", node_body, 0);
|
5057
4950
|
rb_ary_push(members, rb_str_new2("body"));
|
4951
|
+
|
4952
|
+
/* Document-method: args
|
4953
|
+
* the expression type to match against
|
4954
|
+
*/
|
4955
|
+
rb_define_method(rb_cRESBODY, "args", node_args, 0);
|
4956
|
+
rb_ary_push(members, rb_str_new2("args"));
|
5058
4957
|
}
|
5059
4958
|
|
5060
4959
|
/* Document-class: Node::RESCUE
|
@@ -5100,17 +4999,17 @@ void define_node_subclass_methods()
|
|
5100
4999
|
rb_define_method(rb_cRESCUE, "head", node_head, 0);
|
5101
5000
|
rb_ary_push(members, rb_str_new2("head"));
|
5102
5001
|
|
5103
|
-
/* Document-method: else
|
5104
|
-
* the expression to be evaluated if no exception is raised
|
5105
|
-
*/
|
5106
|
-
rb_define_method(rb_cRESCUE, "else", node_else, 0);
|
5107
|
-
rb_ary_push(members, rb_str_new2("else"));
|
5108
|
-
|
5109
5002
|
/* Document-method: resq
|
5110
5003
|
* the expression to be evaluated if an exception is raised
|
5111
5004
|
*/
|
5112
5005
|
rb_define_method(rb_cRESCUE, "resq", node_resq, 0);
|
5113
5006
|
rb_ary_push(members, rb_str_new2("resq"));
|
5007
|
+
|
5008
|
+
/* Document-method: else
|
5009
|
+
* the expression to be evaluated if no exception is raised
|
5010
|
+
*/
|
5011
|
+
rb_define_method(rb_cRESCUE, "else", node_else, 0);
|
5012
|
+
rb_ary_push(members, rb_str_new2("else"));
|
5114
5013
|
}
|
5115
5014
|
|
5116
5015
|
/* Document-class: Node::RETRY
|
@@ -5200,13 +5099,6 @@ void define_node_subclass_methods()
|
|
5200
5099
|
rb_iv_set(rb_cSCOPE, "__type__", INT2NUM(NODE_SCOPE));
|
5201
5100
|
rb_define_singleton_method(rb_cSCOPE, "members", node_s_members, 0);
|
5202
5101
|
|
5203
|
-
/* Document-method: tbl
|
5204
|
-
* the names of the local variables* next the first expression in
|
5205
|
-
* the scope
|
5206
|
-
*/
|
5207
|
-
rb_define_method(rb_cSCOPE, "tbl", node_tbl, 0);
|
5208
|
-
rb_ary_push(members, rb_str_new2("tbl"));
|
5209
|
-
|
5210
5102
|
/* Document-method: rval
|
5211
5103
|
* holds information about which class(es) to search for constants
|
5212
5104
|
* in this scope
|
@@ -5214,6 +5106,13 @@ void define_node_subclass_methods()
|
|
5214
5106
|
rb_define_method(rb_cSCOPE, "rval", node_rval, 0);
|
5215
5107
|
rb_ary_push(members, rb_str_new2("rval"));
|
5216
5108
|
|
5109
|
+
/* Document-method: tbl
|
5110
|
+
* the names of the local variables* next the first expression in
|
5111
|
+
* the scope
|
5112
|
+
*/
|
5113
|
+
rb_define_method(rb_cSCOPE, "tbl", node_tbl, 0);
|
5114
|
+
rb_ary_push(members, rb_str_new2("tbl"));
|
5115
|
+
|
5217
5116
|
/* Document-method: next
|
5218
5117
|
* the body of the lexical scope
|
5219
5118
|
*/
|
@@ -5360,6 +5259,8 @@ void define_node_subclass_methods()
|
|
5360
5259
|
rb_iv_set(rb_cUNTIL, "__member__", members);
|
5361
5260
|
rb_iv_set(rb_cUNTIL, "__type__", INT2NUM(NODE_UNTIL));
|
5362
5261
|
rb_define_singleton_method(rb_cUNTIL, "members", node_s_members, 0);
|
5262
|
+
rb_define_method(rb_cUNTIL, "state", node_state, 0);
|
5263
|
+
rb_ary_push(members, rb_str_new2("state"));
|
5363
5264
|
|
5364
5265
|
/* Document-method: body
|
5365
5266
|
* the body of the loop
|
@@ -5372,8 +5273,6 @@ void define_node_subclass_methods()
|
|
5372
5273
|
*/
|
5373
5274
|
rb_define_method(rb_cUNTIL, "cond", node_cond, 0);
|
5374
5275
|
rb_ary_push(members, rb_str_new2("cond"));
|
5375
|
-
rb_define_method(rb_cUNTIL, "state", node_state, 0);
|
5376
|
-
rb_ary_push(members, rb_str_new2("state"));
|
5377
5276
|
}
|
5378
5277
|
|
5379
5278
|
/* Document-class: Node::VALIAS
|
@@ -5389,10 +5288,10 @@ void define_node_subclass_methods()
|
|
5389
5288
|
rb_iv_set(rb_cVALIAS, "__member__", members);
|
5390
5289
|
rb_iv_set(rb_cVALIAS, "__type__", INT2NUM(NODE_VALIAS));
|
5391
5290
|
rb_define_singleton_method(rb_cVALIAS, "members", node_s_members, 0);
|
5392
|
-
rb_define_method(rb_cVALIAS, "first", node_1st, 0);
|
5393
|
-
rb_ary_push(members, rb_str_new2("first"));
|
5394
5291
|
rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
|
5395
5292
|
rb_ary_push(members, rb_str_new2("second"));
|
5293
|
+
rb_define_method(rb_cVALIAS, "first", node_1st, 0);
|
5294
|
+
rb_ary_push(members, rb_str_new2("first"));
|
5396
5295
|
}
|
5397
5296
|
|
5398
5297
|
/* Document-class: Node::VCALL
|
@@ -5484,6 +5383,8 @@ void define_node_subclass_methods()
|
|
5484
5383
|
rb_iv_set(rb_cWHILE, "__member__", members);
|
5485
5384
|
rb_iv_set(rb_cWHILE, "__type__", INT2NUM(NODE_WHILE));
|
5486
5385
|
rb_define_singleton_method(rb_cWHILE, "members", node_s_members, 0);
|
5386
|
+
rb_define_method(rb_cWHILE, "state", node_state, 0);
|
5387
|
+
rb_ary_push(members, rb_str_new2("state"));
|
5487
5388
|
|
5488
5389
|
/* Document-method: body
|
5489
5390
|
* the body of the loop
|
@@ -5496,8 +5397,6 @@ void define_node_subclass_methods()
|
|
5496
5397
|
*/
|
5497
5398
|
rb_define_method(rb_cWHILE, "cond", node_cond, 0);
|
5498
5399
|
rb_ary_push(members, rb_str_new2("cond"));
|
5499
|
-
rb_define_method(rb_cWHILE, "state", node_state, 0);
|
5500
|
-
rb_ary_push(members, rb_str_new2("state"));
|
5501
5400
|
}
|
5502
5401
|
|
5503
5402
|
/* Document-class: Node::XSTR
|