ruby-internal 0.8.0 → 0.8.1
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/Rakefile +1 -1
- data/bin/ruby-internal-node-dump +1 -1
- data/bin/ruby-internal-obfuscate +1 -1
- data/ext/cached/ruby-1.8.4/internal/node/node_type_descrip.c +45 -45
- data/ext/cached/ruby-1.8.4/internal/node/nodeinfo.c +259 -258
- data/ext/cached/ruby-1.8.5/internal/node/node_type_descrip.c +43 -43
- data/ext/cached/ruby-1.8.5/internal/node/nodeinfo.c +261 -260
- data/ext/cached/ruby-1.8.6/internal/node/node_type_descrip.c +45 -45
- data/ext/cached/ruby-1.8.6/internal/node/nodeinfo.c +261 -260
- data/ext/cached/ruby-1.8.7/internal/node/node_type_descrip.c +37 -37
- data/ext/cached/ruby-1.8.7/internal/node/nodeinfo.c +219 -218
- data/ext/cached/ruby-1.9.1/internal/node/global_entry.h +4 -0
- data/ext/cached/ruby-1.9.1/internal/node/node_type_descrip.c +41 -41
- data/ext/cached/ruby-1.9.1/internal/node/nodeinfo.c +231 -230
- data/ext/cached/ruby-1.9.2/internal/node/global_entry.h +4 -0
- data/ext/cached/ruby-1.9.2/internal/node/node_type_descrip.c +37 -37
- data/ext/cached/ruby-1.9.2/internal/node/nodeinfo.c +206 -205
- data/ext/cached/ruby-1.9.3/internal/node/global_entry.h +4 -0
- data/ext/cached/ruby-1.9.3/internal/node/node_type_descrip.c +41 -41
- data/ext/cached/ruby-1.9.3/internal/node/nodeinfo.c +230 -229
- data/ext/internal/binding/block.h +0 -20
- data/ext/internal/method/internal_method.h +5 -5
- data/ext/internal/module/classpath.c +13 -18
- data/ext/internal/module/classpath.h +3 -3
- data/ext/internal/module/getcfp.h +12 -0
- data/ext/internal/node/block.h +0 -20
- data/ext/internal/node/global_entry.h +31 -42
- data/ext/internal/node/global_entry.h.rpp +1 -1
- data/ext/internal/node/node_type_descrip.c +38 -47
- data/ext/internal/node/nodeinfo.c +311 -626
- data/ext/internal/node/nodeinfo.h +4 -1
- data/ext/internal/proc/block.h +0 -20
- data/ext/internal/tag/tag.h +0 -10
- data/ext/internal/vm/instruction/insns_info.c +5974 -3
- data/ext/internal/vm/instruction/insns_info.h +878 -0
- metadata +37 -51
@@ -450,28 +450,8 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
450
450
|
return ID2SYM(n->nd_entry->id);
|
451
451
|
}
|
452
452
|
case NEN_FRML:
|
453
|
-
if(n->nd_frml)
|
454
453
|
{
|
455
|
-
|
456
|
-
if(0 && nd_type(n) == NODE_OP_ASGN2)
|
457
|
-
{
|
458
|
-
/* All children of NODE_OP_ASGN2 are NODE_OP_ASGN2_ARG */
|
459
|
-
node_type = NODE_OP_ASGN2_ARG;
|
460
|
-
}
|
461
|
-
else
|
462
|
-
{
|
463
|
-
node_type = nd_type(n->nd_frml);
|
464
|
-
}
|
465
|
-
|
466
|
-
dump_node_or_iseq_to_hash(
|
467
|
-
(VALUE)n->nd_frml,
|
468
|
-
node_type,
|
469
|
-
node_hash);
|
470
|
-
return node_id(n->nd_frml);
|
471
|
-
}
|
472
|
-
else
|
473
|
-
{
|
474
|
-
return Qnil;
|
454
|
+
return LONG2NUM((long)n->nd_frml);
|
475
455
|
}
|
476
456
|
case NEN_HEAD:
|
477
457
|
if(n->nd_head)
|
@@ -497,30 +477,6 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
497
477
|
{
|
498
478
|
return Qnil;
|
499
479
|
}
|
500
|
-
case NEN_IBDY:
|
501
|
-
if(n->nd_ibdy)
|
502
|
-
{
|
503
|
-
int node_type;
|
504
|
-
if(0 && nd_type(n) == NODE_OP_ASGN2)
|
505
|
-
{
|
506
|
-
/* All children of NODE_OP_ASGN2 are NODE_OP_ASGN2_ARG */
|
507
|
-
node_type = NODE_OP_ASGN2_ARG;
|
508
|
-
}
|
509
|
-
else
|
510
|
-
{
|
511
|
-
node_type = nd_type(n->nd_ibdy);
|
512
|
-
}
|
513
|
-
|
514
|
-
dump_node_or_iseq_to_hash(
|
515
|
-
(VALUE)n->nd_ibdy,
|
516
|
-
node_type,
|
517
|
-
node_hash);
|
518
|
-
return node_id(n->nd_ibdy);
|
519
|
-
}
|
520
|
-
else
|
521
|
-
{
|
522
|
-
return Qnil;
|
523
|
-
}
|
524
480
|
case NEN_ITER:
|
525
481
|
if(n->nd_iter)
|
526
482
|
{
|
@@ -645,6 +601,19 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
645
601
|
{
|
646
602
|
return LONG2NUM((long)n->nd_nth);
|
647
603
|
}
|
604
|
+
case NEN_OID:
|
605
|
+
if(n->nd_oid == 0)
|
606
|
+
{
|
607
|
+
return Qfalse;
|
608
|
+
}
|
609
|
+
else if(n->nd_oid == 1)
|
610
|
+
{
|
611
|
+
return Qtrue;
|
612
|
+
}
|
613
|
+
else
|
614
|
+
{
|
615
|
+
return ID2SYM(n->nd_oid);
|
616
|
+
}
|
648
617
|
case NEN_OPT:
|
649
618
|
if(n->nd_opt)
|
650
619
|
{
|
@@ -711,6 +680,23 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
711
680
|
INT2NUM(TYPE((VALUE)n->nd_orig)),
|
712
681
|
(VALUE)n->nd_orig);
|
713
682
|
}
|
683
|
+
case NEN_PID:
|
684
|
+
if(n->nd_pid == 0)
|
685
|
+
{
|
686
|
+
return Qfalse;
|
687
|
+
}
|
688
|
+
else if(n->nd_pid == 1)
|
689
|
+
{
|
690
|
+
return Qtrue;
|
691
|
+
}
|
692
|
+
else
|
693
|
+
{
|
694
|
+
return ID2SYM(n->nd_pid);
|
695
|
+
}
|
696
|
+
case NEN_PLEN:
|
697
|
+
{
|
698
|
+
return LONG2NUM((long)n->nd_plen);
|
699
|
+
}
|
714
700
|
case NEN_RECV:
|
715
701
|
if(n->nd_recv)
|
716
702
|
{
|
@@ -760,28 +746,17 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
760
746
|
return Qnil;
|
761
747
|
}
|
762
748
|
case NEN_REST:
|
763
|
-
if(n->nd_rest)
|
749
|
+
if(n->nd_rest == 0)
|
764
750
|
{
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
}
|
771
|
-
else
|
772
|
-
{
|
773
|
-
node_type = nd_type(n->nd_rest);
|
774
|
-
}
|
775
|
-
|
776
|
-
dump_node_or_iseq_to_hash(
|
777
|
-
(VALUE)n->nd_rest,
|
778
|
-
node_type,
|
779
|
-
node_hash);
|
780
|
-
return node_id(n->nd_rest);
|
751
|
+
return Qfalse;
|
752
|
+
}
|
753
|
+
else if(n->nd_rest == 1)
|
754
|
+
{
|
755
|
+
return Qtrue;
|
781
756
|
}
|
782
757
|
else
|
783
758
|
{
|
784
|
-
return
|
759
|
+
return ID2SYM(n->nd_rest);
|
785
760
|
}
|
786
761
|
case NEN_RVAL:
|
787
762
|
if(n->nd_2nd)
|
@@ -980,6 +955,10 @@ VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
|
980
955
|
{
|
981
956
|
return ID2SYM(n->nd_vid);
|
982
957
|
}
|
958
|
+
case NEN_VISI:
|
959
|
+
{
|
960
|
+
return LONG2NUM((long)n->nd_visi);
|
961
|
+
}
|
983
962
|
}
|
984
963
|
rb_raise(rb_eArgError, "Invalid Node_Elem_Name %d", nen);
|
985
964
|
}
|
@@ -1386,27 +1365,7 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1386
1365
|
}
|
1387
1366
|
case NEN_FRML:
|
1388
1367
|
{
|
1389
|
-
|
1390
|
-
{
|
1391
|
-
n->nd_frml = 0;
|
1392
|
-
}
|
1393
|
-
else
|
1394
|
-
{
|
1395
|
-
VALUE nid = rb_hash_aref(id_hash, v);
|
1396
|
-
if(RTEST(nid))
|
1397
|
-
{
|
1398
|
-
n->nd_frml = id_to_node(nid);
|
1399
|
-
}
|
1400
|
-
else
|
1401
|
-
{
|
1402
|
-
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
1403
|
-
v, node_hash, id_hash);
|
1404
|
-
if(nd_type(n->u1.node) == NODE_OP_ASGN2_ARG)
|
1405
|
-
{
|
1406
|
-
nd_set_type(n->u1.node, NODE_OP_ASGN2);
|
1407
|
-
}
|
1408
|
-
}
|
1409
|
-
}
|
1368
|
+
n->nd_frml = NUM2LONG(v);
|
1410
1369
|
return;
|
1411
1370
|
}
|
1412
1371
|
case NEN_HEAD:
|
@@ -1434,31 +1393,6 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1434
1393
|
}
|
1435
1394
|
return;
|
1436
1395
|
}
|
1437
|
-
case NEN_IBDY:
|
1438
|
-
{
|
1439
|
-
if(v == Qnil)
|
1440
|
-
{
|
1441
|
-
n->nd_ibdy = 0;
|
1442
|
-
}
|
1443
|
-
else
|
1444
|
-
{
|
1445
|
-
VALUE nid = rb_hash_aref(id_hash, v);
|
1446
|
-
if(RTEST(nid))
|
1447
|
-
{
|
1448
|
-
n->nd_ibdy = id_to_node(nid);
|
1449
|
-
}
|
1450
|
-
else
|
1451
|
-
{
|
1452
|
-
n->u2.node = (NODE *)load_node_or_iseq_from_hash(
|
1453
|
-
v, node_hash, id_hash);
|
1454
|
-
if(nd_type(n->u2.node) == NODE_OP_ASGN2_ARG)
|
1455
|
-
{
|
1456
|
-
nd_set_type(n->u2.node, NODE_OP_ASGN2);
|
1457
|
-
}
|
1458
|
-
}
|
1459
|
-
}
|
1460
|
-
return;
|
1461
|
-
}
|
1462
1396
|
case NEN_ITER:
|
1463
1397
|
{
|
1464
1398
|
if(v == Qnil)
|
@@ -1588,6 +1522,22 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1588
1522
|
n->nd_nth = NUM2LONG(v);
|
1589
1523
|
return;
|
1590
1524
|
}
|
1525
|
+
case NEN_OID:
|
1526
|
+
{
|
1527
|
+
if(v == Qfalse)
|
1528
|
+
{
|
1529
|
+
n->nd_oid = 0;
|
1530
|
+
}
|
1531
|
+
else if(v == Qfalse)
|
1532
|
+
{
|
1533
|
+
n->nd_oid = 1;
|
1534
|
+
}
|
1535
|
+
else
|
1536
|
+
{
|
1537
|
+
n->nd_oid = SYM2ID(v);
|
1538
|
+
}
|
1539
|
+
return;
|
1540
|
+
}
|
1591
1541
|
case NEN_OPT:
|
1592
1542
|
{
|
1593
1543
|
if(v == Qnil)
|
@@ -1650,6 +1600,27 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1650
1600
|
}
|
1651
1601
|
return;
|
1652
1602
|
}
|
1603
|
+
case NEN_PID:
|
1604
|
+
{
|
1605
|
+
if(v == Qfalse)
|
1606
|
+
{
|
1607
|
+
n->nd_pid = 0;
|
1608
|
+
}
|
1609
|
+
else if(v == Qfalse)
|
1610
|
+
{
|
1611
|
+
n->nd_pid = 1;
|
1612
|
+
}
|
1613
|
+
else
|
1614
|
+
{
|
1615
|
+
n->nd_pid = SYM2ID(v);
|
1616
|
+
}
|
1617
|
+
return;
|
1618
|
+
}
|
1619
|
+
case NEN_PLEN:
|
1620
|
+
{
|
1621
|
+
n->nd_plen = NUM2LONG(v);
|
1622
|
+
return;
|
1623
|
+
}
|
1653
1624
|
case NEN_RECV:
|
1654
1625
|
{
|
1655
1626
|
if(v == Qnil)
|
@@ -1702,26 +1673,17 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1702
1673
|
}
|
1703
1674
|
case NEN_REST:
|
1704
1675
|
{
|
1705
|
-
if(v ==
|
1676
|
+
if(v == Qfalse)
|
1706
1677
|
{
|
1707
1678
|
n->nd_rest = 0;
|
1708
1679
|
}
|
1680
|
+
else if(v == Qfalse)
|
1681
|
+
{
|
1682
|
+
n->nd_rest = 1;
|
1683
|
+
}
|
1709
1684
|
else
|
1710
1685
|
{
|
1711
|
-
|
1712
|
-
if(RTEST(nid))
|
1713
|
-
{
|
1714
|
-
n->nd_rest = id_to_node(nid);
|
1715
|
-
}
|
1716
|
-
else
|
1717
|
-
{
|
1718
|
-
n->u2.node = (NODE *)load_node_or_iseq_from_hash(
|
1719
|
-
v, node_hash, id_hash);
|
1720
|
-
if(nd_type(n->u2.node) == NODE_OP_ASGN2_ARG)
|
1721
|
-
{
|
1722
|
-
nd_set_type(n->u2.node, NODE_OP_ASGN2);
|
1723
|
-
}
|
1724
|
-
}
|
1686
|
+
n->nd_rest = SYM2ID(v);
|
1725
1687
|
}
|
1726
1688
|
return;
|
1727
1689
|
}
|
@@ -1959,6 +1921,11 @@ void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash,
|
|
1959
1921
|
}
|
1960
1922
|
return;
|
1961
1923
|
}
|
1924
|
+
case NEN_VISI:
|
1925
|
+
{
|
1926
|
+
n->nd_visi = NUM2LONG(v);
|
1927
|
+
return;
|
1928
|
+
}
|
1962
1929
|
}
|
1963
1930
|
rb_raise(rb_eRuntimeError, "Internal error: invalid Node_Elem_Name %d", nen);
|
1964
1931
|
}
|
@@ -2048,16 +2015,6 @@ static VALUE node_alen(VALUE self)
|
|
2048
2015
|
Data_Get_Struct(self, NODE, n);
|
2049
2016
|
return LONG2NUM(n->nd_alen);
|
2050
2017
|
}
|
2051
|
-
/*
|
2052
|
-
* Return the Node's _argc_ member. The return type is an
|
2053
|
-
* Integer.
|
2054
|
-
*/
|
2055
|
-
static VALUE node_argc(VALUE self)
|
2056
|
-
{
|
2057
|
-
NODE * n;
|
2058
|
-
Data_Get_Struct(self, NODE, n);
|
2059
|
-
return LONG2NUM(n->nd_argc);
|
2060
|
-
}
|
2061
2018
|
/*
|
2062
2019
|
* Return the Node's _args_ member. The return type is
|
2063
2020
|
* either a Node or an Object.
|
@@ -2155,33 +2112,6 @@ static VALUE node_cfnc(VALUE self)
|
|
2155
2112
|
Data_Get_Struct(self, NODE, n);
|
2156
2113
|
return LONG2NUM((long)(n->nd_cfnc));
|
2157
2114
|
}
|
2158
|
-
/*
|
2159
|
-
* Return the Node's _clss_ member. The return type is
|
2160
|
-
* either a Node or an Object.
|
2161
|
-
*/
|
2162
|
-
static VALUE node_clss(VALUE self)
|
2163
|
-
{
|
2164
|
-
NODE * n;
|
2165
|
-
Data_Get_Struct(self, NODE, n);
|
2166
|
-
|
2167
|
-
if(TYPE(n->nd_clss) == T_NODE)
|
2168
|
-
{
|
2169
|
-
if(0 && nd_type(n) == NODE_OP_ASGN2)
|
2170
|
-
{
|
2171
|
-
return wrap_node_as(
|
2172
|
-
(NODE *)n->nd_clss,
|
2173
|
-
rb_cNodeSubclass[NODE_OP_ASGN2_ARG]);
|
2174
|
-
}
|
2175
|
-
else
|
2176
|
-
{
|
2177
|
-
return wrap_node((NODE *)n->nd_clss);
|
2178
|
-
}
|
2179
|
-
}
|
2180
|
-
else
|
2181
|
-
{
|
2182
|
-
return (VALUE)n->nd_clss;
|
2183
|
-
}
|
2184
|
-
}
|
2185
2115
|
/*
|
2186
2116
|
* Return the Node's _cnt_ member. The return type is an
|
2187
2117
|
* Integer.
|
@@ -2574,33 +2504,6 @@ static VALUE node_opt(VALUE self)
|
|
2574
2504
|
return (VALUE)n->nd_opt;
|
2575
2505
|
}
|
2576
2506
|
}
|
2577
|
-
/*
|
2578
|
-
* Return the Node's _orig_ member. The return type is
|
2579
|
-
* either a Node or an Object.
|
2580
|
-
*/
|
2581
|
-
static VALUE node_orig(VALUE self)
|
2582
|
-
{
|
2583
|
-
NODE * n;
|
2584
|
-
Data_Get_Struct(self, NODE, n);
|
2585
|
-
|
2586
|
-
if(TYPE(n->nd_orig) == T_NODE)
|
2587
|
-
{
|
2588
|
-
if(0 && nd_type(n) == NODE_OP_ASGN2)
|
2589
|
-
{
|
2590
|
-
return wrap_node_as(
|
2591
|
-
(NODE *)n->nd_orig,
|
2592
|
-
rb_cNodeSubclass[NODE_OP_ASGN2_ARG]);
|
2593
|
-
}
|
2594
|
-
else
|
2595
|
-
{
|
2596
|
-
return wrap_node((NODE *)n->nd_orig);
|
2597
|
-
}
|
2598
|
-
}
|
2599
|
-
else
|
2600
|
-
{
|
2601
|
-
return (VALUE)n->nd_orig;
|
2602
|
-
}
|
2603
|
-
}
|
2604
2507
|
/*
|
2605
2508
|
* Return the Node's _recv_ member. The return type is
|
2606
2509
|
* either a Node or an Object.
|
@@ -2656,30 +2559,24 @@ static VALUE node_resq(VALUE self)
|
|
2656
2559
|
}
|
2657
2560
|
}
|
2658
2561
|
/*
|
2659
|
-
* Return the Node's _rest_ member. The return type is
|
2660
|
-
*
|
2562
|
+
* Return the Node's _rest_ member. The return type is a
|
2563
|
+
* Symbol.
|
2661
2564
|
*/
|
2662
2565
|
static VALUE node_rest(VALUE self)
|
2663
2566
|
{
|
2664
2567
|
NODE * n;
|
2665
2568
|
Data_Get_Struct(self, NODE, n);
|
2666
|
-
|
2667
|
-
if(TYPE(n->nd_rest) == T_NODE)
|
2569
|
+
if(n->nd_rest == 0)
|
2668
2570
|
{
|
2669
|
-
|
2670
|
-
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2674
|
-
}
|
2675
|
-
else
|
2676
|
-
{
|
2677
|
-
return wrap_node((NODE *)n->nd_rest);
|
2678
|
-
}
|
2571
|
+
return Qfalse;
|
2572
|
+
}
|
2573
|
+
else if(n->nd_rest == 1)
|
2574
|
+
{
|
2575
|
+
return Qtrue;
|
2679
2576
|
}
|
2680
2577
|
else
|
2681
2578
|
{
|
2682
|
-
return (
|
2579
|
+
return ID2SYM(n->nd_rest);
|
2683
2580
|
}
|
2684
2581
|
}
|
2685
2582
|
/*
|
@@ -2925,10 +2822,10 @@ void define_node_subclass_methods()
|
|
2925
2822
|
rb_iv_set(rb_cALIAS, "__member__", members);
|
2926
2823
|
rb_iv_set(rb_cALIAS, "__type__", INT2NUM(NODE_ALIAS));
|
2927
2824
|
rb_define_singleton_method(rb_cALIAS, "members", node_s_members, 0);
|
2928
|
-
rb_define_method(rb_cALIAS, "second", node_2nd, 0);
|
2929
|
-
rb_ary_push(members, rb_str_new2("second"));
|
2930
2825
|
rb_define_method(rb_cALIAS, "first", node_1st, 0);
|
2931
2826
|
rb_ary_push(members, rb_str_new2("first"));
|
2827
|
+
rb_define_method(rb_cALIAS, "second", node_2nd, 0);
|
2828
|
+
rb_ary_push(members, rb_str_new2("second"));
|
2932
2829
|
}
|
2933
2830
|
|
2934
2831
|
/* Document-class: Node::ALLOCA
|
@@ -2946,6 +2843,12 @@ void define_node_subclass_methods()
|
|
2946
2843
|
rb_iv_set(rb_cALLOCA, "__type__", INT2NUM(NODE_ALLOCA));
|
2947
2844
|
rb_define_singleton_method(rb_cALLOCA, "members", node_s_members, 0);
|
2948
2845
|
|
2846
|
+
/* Document-method: cfnc
|
2847
|
+
* a pointer to the allocated memory
|
2848
|
+
*/
|
2849
|
+
rb_define_method(rb_cALLOCA, "cfnc", node_cfnc, 0);
|
2850
|
+
rb_ary_push(members, rb_str_new2("cfnc"));
|
2851
|
+
|
2949
2852
|
/* Document-method: value
|
2950
2853
|
* a pointer to the previously allocated temporary node
|
2951
2854
|
*/
|
@@ -2957,12 +2860,6 @@ void define_node_subclass_methods()
|
|
2957
2860
|
*/
|
2958
2861
|
rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
|
2959
2862
|
rb_ary_push(members, rb_str_new2("cnt"));
|
2960
|
-
|
2961
|
-
/* Document-method: cfnc
|
2962
|
-
* a pointer to the allocated memory
|
2963
|
-
*/
|
2964
|
-
rb_define_method(rb_cALLOCA, "cfnc", node_cfnc, 0);
|
2965
|
-
rb_ary_push(members, rb_str_new2("cfnc"));
|
2966
2863
|
}
|
2967
2864
|
#endif
|
2968
2865
|
|
@@ -3011,24 +2908,24 @@ void define_node_subclass_methods()
|
|
3011
2908
|
rb_define_method(rb_cARGS, "rest", node_rest, 0);
|
3012
2909
|
rb_ary_push(members, rb_str_new2("rest"));
|
3013
2910
|
|
3014
|
-
/* Document-method: cnt
|
3015
|
-
* the number of required arguments
|
3016
|
-
*/
|
3017
|
-
rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
|
3018
|
-
rb_ary_push(members, rb_str_new2("cnt"));
|
3019
|
-
|
3020
2911
|
/* Document-method: opt
|
3021
2912
|
* a list of assignment nodes to assign default values to the
|
3022
2913
|
* optional arguments if no argument is specified
|
3023
2914
|
*/
|
3024
2915
|
rb_define_method(rb_cARGS, "opt", node_opt, 0);
|
3025
2916
|
rb_ary_push(members, rb_str_new2("opt"));
|
3026
|
-
}
|
3027
2917
|
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
2918
|
+
/* Document-method: cnt
|
2919
|
+
* the number of required arguments
|
2920
|
+
*/
|
2921
|
+
rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
|
2922
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2923
|
+
}
|
2924
|
+
|
2925
|
+
/* Document-class: Node::ARGSCAT
|
2926
|
+
* Represents the concatenation of a list of arguments and a splatted
|
2927
|
+
* value, e.g.:
|
2928
|
+
* a, b, *value
|
3032
2929
|
* Evaluates head to create an array. Evaluates body and performs a
|
3033
2930
|
* splat operation on the result to create another array (see SPLAT).
|
3034
2931
|
* Concatenates the the second array onto the end of the first to
|
@@ -3088,20 +2985,20 @@ void define_node_subclass_methods()
|
|
3088
2985
|
rb_iv_set(rb_cARRAY, "__member__", members);
|
3089
2986
|
rb_iv_set(rb_cARRAY, "__type__", INT2NUM(NODE_ARRAY));
|
3090
2987
|
rb_define_singleton_method(rb_cARRAY, "members", node_s_members, 0);
|
3091
|
-
|
3092
|
-
|
3093
|
-
* the tail of the array
|
3094
|
-
*/
|
3095
|
-
rb_define_method(rb_cARRAY, "next", node_next, 0);
|
3096
|
-
rb_ary_push(members, rb_str_new2("next"));
|
2988
|
+
rb_define_method(rb_cARRAY, "alen", node_alen, 0);
|
2989
|
+
rb_ary_push(members, rb_str_new2("alen"));
|
3097
2990
|
|
3098
2991
|
/* Document-method: head
|
3099
2992
|
* the first element of the array
|
3100
2993
|
*/
|
3101
2994
|
rb_define_method(rb_cARRAY, "head", node_head, 0);
|
3102
2995
|
rb_ary_push(members, rb_str_new2("head"));
|
3103
|
-
|
3104
|
-
|
2996
|
+
|
2997
|
+
/* Document-method: next
|
2998
|
+
* the tail of the array
|
2999
|
+
*/
|
3000
|
+
rb_define_method(rb_cARRAY, "next", node_next, 0);
|
3001
|
+
rb_ary_push(members, rb_str_new2("next"));
|
3105
3002
|
}
|
3106
3003
|
|
3107
3004
|
/* Document-class: Node::ATTRASGN
|
@@ -3118,12 +3015,6 @@ void define_node_subclass_methods()
|
|
3118
3015
|
rb_iv_set(rb_cATTRASGN, "__type__", INT2NUM(NODE_ATTRASGN));
|
3119
3016
|
rb_define_singleton_method(rb_cATTRASGN, "members", node_s_members, 0);
|
3120
3017
|
|
3121
|
-
/* Document-method: mid
|
3122
|
-
* the id of the attribute, with a trailing '=' sign
|
3123
|
-
*/
|
3124
|
-
rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
|
3125
|
-
rb_ary_push(members, rb_str_new2("mid"));
|
3126
|
-
|
3127
3018
|
/* Document-method: recv
|
3128
3019
|
* the receiver of the method
|
3129
3020
|
*/
|
@@ -3135,27 +3026,12 @@ void define_node_subclass_methods()
|
|
3135
3026
|
*/
|
3136
3027
|
rb_define_method(rb_cATTRASGN, "args", node_args, 0);
|
3137
3028
|
rb_ary_push(members, rb_str_new2("args"));
|
3138
|
-
}
|
3139
|
-
|
3140
|
-
/* Document-class: Node::ATTRSET
|
3141
|
-
* A placeholder for an attribute writer method, which can added to a
|
3142
|
-
* class by using attr_writer:
|
3143
|
-
* attr_writer :attribute
|
3144
|
-
* Its reader counterpart is IVAR.
|
3145
|
-
*/
|
3146
|
-
{
|
3147
|
-
VALUE rb_cATTRSET = rb_define_class_under(rb_cNode, "ATTRSET", rb_cNode);
|
3148
|
-
members = rb_ary_new();
|
3149
|
-
rb_cNodeSubclass[NODE_ATTRSET] = rb_cATTRSET;
|
3150
|
-
rb_iv_set(rb_cATTRSET, "__member__", members);
|
3151
|
-
rb_iv_set(rb_cATTRSET, "__type__", INT2NUM(NODE_ATTRSET));
|
3152
|
-
rb_define_singleton_method(rb_cATTRSET, "members", node_s_members, 0);
|
3153
3029
|
|
3154
|
-
/* Document-method:
|
3155
|
-
* the
|
3030
|
+
/* Document-method: mid
|
3031
|
+
* the id of the attribute, with a trailing '=' sign
|
3156
3032
|
*/
|
3157
|
-
rb_define_method(
|
3158
|
-
rb_ary_push(members, rb_str_new2("
|
3033
|
+
rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
|
3034
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
3159
3035
|
}
|
3160
3036
|
|
3161
3037
|
/* Document-class: Node::BACK_REF
|
@@ -3222,17 +3098,17 @@ void define_node_subclass_methods()
|
|
3222
3098
|
rb_iv_set(rb_cBLOCK, "__type__", INT2NUM(NODE_BLOCK));
|
3223
3099
|
rb_define_singleton_method(rb_cBLOCK, "members", node_s_members, 0);
|
3224
3100
|
|
3225
|
-
/* Document-method: next
|
3226
|
-
* the second expression in the block of code
|
3227
|
-
*/
|
3228
|
-
rb_define_method(rb_cBLOCK, "next", node_next, 0);
|
3229
|
-
rb_ary_push(members, rb_str_new2("next"));
|
3230
|
-
|
3231
3101
|
/* Document-method: head
|
3232
3102
|
* the first expression in the block of code
|
3233
3103
|
*/
|
3234
3104
|
rb_define_method(rb_cBLOCK, "head", node_head, 0);
|
3235
3105
|
rb_ary_push(members, rb_str_new2("head"));
|
3106
|
+
|
3107
|
+
/* Document-method: next
|
3108
|
+
* the second expression in the block of code
|
3109
|
+
*/
|
3110
|
+
rb_define_method(rb_cBLOCK, "next", node_next, 0);
|
3111
|
+
rb_ary_push(members, rb_str_new2("next"));
|
3236
3112
|
}
|
3237
3113
|
|
3238
3114
|
/* Document-class: Node::BLOCK_ARG
|
@@ -3340,6 +3216,12 @@ void define_node_subclass_methods()
|
|
3340
3216
|
rb_iv_set(rb_cCALL, "__type__", INT2NUM(NODE_CALL));
|
3341
3217
|
rb_define_singleton_method(rb_cCALL, "members", node_s_members, 0);
|
3342
3218
|
|
3219
|
+
/* Document-method: args
|
3220
|
+
* the arguments to the method
|
3221
|
+
*/
|
3222
|
+
rb_define_method(rb_cCALL, "args", node_args, 0);
|
3223
|
+
rb_ary_push(members, rb_str_new2("args"));
|
3224
|
+
|
3343
3225
|
/* Document-method: mid
|
3344
3226
|
* the method id
|
3345
3227
|
*/
|
@@ -3351,12 +3233,6 @@ void define_node_subclass_methods()
|
|
3351
3233
|
*/
|
3352
3234
|
rb_define_method(rb_cCALL, "recv", node_recv, 0);
|
3353
3235
|
rb_ary_push(members, rb_str_new2("recv"));
|
3354
|
-
|
3355
|
-
/* Document-method: args
|
3356
|
-
* the arguments to the method
|
3357
|
-
*/
|
3358
|
-
rb_define_method(rb_cCALL, "args", node_args, 0);
|
3359
|
-
rb_ary_push(members, rb_str_new2("args"));
|
3360
3236
|
}
|
3361
3237
|
|
3362
3238
|
/* Document-class: Node::CASE
|
@@ -3373,8 +3249,6 @@ void define_node_subclass_methods()
|
|
3373
3249
|
rb_iv_set(rb_cCASE, "__member__", members);
|
3374
3250
|
rb_iv_set(rb_cCASE, "__type__", INT2NUM(NODE_CASE));
|
3375
3251
|
rb_define_singleton_method(rb_cCASE, "members", node_s_members, 0);
|
3376
|
-
rb_define_method(rb_cCASE, "next", node_next, 0);
|
3377
|
-
rb_ary_push(members, rb_str_new2("next"));
|
3378
3252
|
|
3379
3253
|
/* Document-method: head
|
3380
3254
|
* the value to select on
|
@@ -3388,6 +3262,8 @@ void define_node_subclass_methods()
|
|
3388
3262
|
*/
|
3389
3263
|
rb_define_method(rb_cCASE, "body", node_body, 0);
|
3390
3264
|
rb_ary_push(members, rb_str_new2("body"));
|
3265
|
+
rb_define_method(rb_cCASE, "next", node_next, 0);
|
3266
|
+
rb_ary_push(members, rb_str_new2("next"));
|
3391
3267
|
}
|
3392
3268
|
|
3393
3269
|
/* Document-class: Node::CDECL
|
@@ -3415,22 +3291,6 @@ void define_node_subclass_methods()
|
|
3415
3291
|
rb_ary_push(members, rb_str_new2("vid"));
|
3416
3292
|
}
|
3417
3293
|
|
3418
|
-
/* Document-class: Node::CFUNC
|
3419
|
-
* A placeholder for a function implemented in C.
|
3420
|
-
*/
|
3421
|
-
{
|
3422
|
-
VALUE rb_cCFUNC = rb_define_class_under(rb_cNode, "CFUNC", rb_cNode);
|
3423
|
-
members = rb_ary_new();
|
3424
|
-
rb_cNodeSubclass[NODE_CFUNC] = rb_cCFUNC;
|
3425
|
-
rb_iv_set(rb_cCFUNC, "__member__", members);
|
3426
|
-
rb_iv_set(rb_cCFUNC, "__type__", INT2NUM(NODE_CFUNC));
|
3427
|
-
rb_define_singleton_method(rb_cCFUNC, "members", node_s_members, 0);
|
3428
|
-
rb_define_method(rb_cCFUNC, "cfnc", node_cfnc, 0);
|
3429
|
-
rb_ary_push(members, rb_str_new2("cfnc"));
|
3430
|
-
rb_define_method(rb_cCFUNC, "argc", node_argc, 0);
|
3431
|
-
rb_ary_push(members, rb_str_new2("argc"));
|
3432
|
-
}
|
3433
|
-
|
3434
3294
|
/* Document-class: Node::CLASS
|
3435
3295
|
* Represents a class definition, e.g.:
|
3436
3296
|
* class cpath
|
@@ -3491,17 +3351,17 @@ void define_node_subclass_methods()
|
|
3491
3351
|
rb_iv_set(rb_cCOLON2, "__type__", INT2NUM(NODE_COLON2));
|
3492
3352
|
rb_define_singleton_method(rb_cCOLON2, "members", node_s_members, 0);
|
3493
3353
|
|
3494
|
-
/* Document-method: mid
|
3495
|
-
* the name of the method or constant to call/look up
|
3496
|
-
*/
|
3497
|
-
rb_define_method(rb_cCOLON2, "mid", node_mid, 0);
|
3498
|
-
rb_ary_push(members, rb_str_new2("mid"));
|
3499
|
-
|
3500
3354
|
/* Document-method: head
|
3501
3355
|
* an expression specifying the class in which to do the lookup
|
3502
3356
|
*/
|
3503
3357
|
rb_define_method(rb_cCOLON2, "head", node_head, 0);
|
3504
3358
|
rb_ary_push(members, rb_str_new2("head"));
|
3359
|
+
|
3360
|
+
/* Document-method: mid
|
3361
|
+
* the name of the method or constant to call/look up
|
3362
|
+
*/
|
3363
|
+
rb_define_method(rb_cCOLON2, "mid", node_mid, 0);
|
3364
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
3505
3365
|
}
|
3506
3366
|
|
3507
3367
|
/* Document-class: Node::COLON3
|
@@ -3544,41 +3404,6 @@ void define_node_subclass_methods()
|
|
3544
3404
|
rb_ary_push(members, rb_str_new2("vid"));
|
3545
3405
|
}
|
3546
3406
|
|
3547
|
-
/* Document-class: Node::CREF
|
3548
|
-
* A temporary node used to store the value of ruby_cref or
|
3549
|
-
* ruby_top_cref and later restore it. The cref holds a reference to
|
3550
|
-
* the cbase, which, among other things, is used for constant and class
|
3551
|
-
* variable lookup.
|
3552
|
-
*
|
3553
|
-
* It should never be evaluated as an expression.
|
3554
|
-
*/
|
3555
|
-
{
|
3556
|
-
VALUE rb_cCREF = rb_define_class_under(rb_cNode, "CREF", rb_cNode);
|
3557
|
-
members = rb_ary_new();
|
3558
|
-
rb_cNodeSubclass[NODE_CREF] = rb_cCREF;
|
3559
|
-
rb_iv_set(rb_cCREF, "__member__", members);
|
3560
|
-
rb_iv_set(rb_cCREF, "__type__", INT2NUM(NODE_CREF));
|
3561
|
-
rb_define_singleton_method(rb_cCREF, "members", node_s_members, 0);
|
3562
|
-
|
3563
|
-
/* Document-method: next
|
3564
|
-
* the previous value of ruby_cref or ruby_top_cref
|
3565
|
-
*/
|
3566
|
-
rb_define_method(rb_cCREF, "next", node_next, 0);
|
3567
|
-
rb_ary_push(members, rb_str_new2("next"));
|
3568
|
-
|
3569
|
-
/* Document-method: body
|
3570
|
-
* always 0 (false)
|
3571
|
-
*/
|
3572
|
-
rb_define_method(rb_cCREF, "body", node_body, 0);
|
3573
|
-
rb_ary_push(members, rb_str_new2("body"));
|
3574
|
-
|
3575
|
-
/* Document-method: clss
|
3576
|
-
* the new class to use for the cbase.
|
3577
|
-
*/
|
3578
|
-
rb_define_method(rb_cCREF, "clss", node_clss, 0);
|
3579
|
-
rb_ary_push(members, rb_str_new2("clss"));
|
3580
|
-
}
|
3581
|
-
|
3582
3407
|
/* Document-class: Node::CVAR
|
3583
3408
|
* Represents a class variable retrieval. The result of the expression
|
3584
3409
|
* is the value of the class variable.
|
@@ -3741,6 +3566,12 @@ void define_node_subclass_methods()
|
|
3741
3566
|
rb_iv_set(rb_cDEFN, "__type__", INT2NUM(NODE_DEFN));
|
3742
3567
|
rb_define_singleton_method(rb_cDEFN, "members", node_s_members, 0);
|
3743
3568
|
|
3569
|
+
/* Document-method: defn
|
3570
|
+
* the body of the method definition
|
3571
|
+
*/
|
3572
|
+
rb_define_method(rb_cDEFN, "defn", node_defn, 0);
|
3573
|
+
rb_ary_push(members, rb_str_new2("defn"));
|
3574
|
+
|
3744
3575
|
/* Document-method: mid
|
3745
3576
|
* the name of the method* defn the body of the method
|
3746
3577
|
*/
|
@@ -3752,12 +3583,6 @@ void define_node_subclass_methods()
|
|
3752
3583
|
*/
|
3753
3584
|
rb_define_method(rb_cDEFN, "noex", node_noex, 0);
|
3754
3585
|
rb_ary_push(members, rb_str_new2("noex"));
|
3755
|
-
|
3756
|
-
/* Document-method: defn
|
3757
|
-
* the body of the method definition
|
3758
|
-
*/
|
3759
|
-
rb_define_method(rb_cDEFN, "defn", node_defn, 0);
|
3760
|
-
rb_ary_push(members, rb_str_new2("defn"));
|
3761
3586
|
}
|
3762
3587
|
|
3763
3588
|
/* Document-class: Node::DEFS
|
@@ -3773,12 +3598,6 @@ void define_node_subclass_methods()
|
|
3773
3598
|
rb_iv_set(rb_cDEFS, "__member__", members);
|
3774
3599
|
rb_iv_set(rb_cDEFS, "__type__", INT2NUM(NODE_DEFS));
|
3775
3600
|
rb_define_singleton_method(rb_cDEFS, "members", node_s_members, 0);
|
3776
|
-
|
3777
|
-
/* Document-method: mid
|
3778
|
-
* the name of the method* defn the body of the method
|
3779
|
-
*/
|
3780
|
-
rb_define_method(rb_cDEFS, "mid", node_mid, 0);
|
3781
|
-
rb_ary_push(members, rb_str_new2("mid"));
|
3782
3601
|
rb_define_method(rb_cDEFS, "defn", node_defn, 0);
|
3783
3602
|
rb_ary_push(members, rb_str_new2("defn"));
|
3784
3603
|
|
@@ -3787,29 +3606,12 @@ void define_node_subclass_methods()
|
|
3787
3606
|
*/
|
3788
3607
|
rb_define_method(rb_cDEFS, "recv", node_recv, 0);
|
3789
3608
|
rb_ary_push(members, rb_str_new2("recv"));
|
3790
|
-
}
|
3791
|
-
|
3792
|
-
/* Document-class: Node::DMETHOD
|
3793
|
-
* A placeholder for a method defined using define_method where the
|
3794
|
-
* passed block is created from a Method object, e.g.:
|
3795
|
-
* define_method(:name, method(:foo))
|
3796
|
-
*
|
3797
|
-
* See also BMETHOD.
|
3798
|
-
*/
|
3799
|
-
{
|
3800
|
-
VALUE rb_cDMETHOD = rb_define_class_under(rb_cNode, "DMETHOD", rb_cNode);
|
3801
|
-
members = rb_ary_new();
|
3802
|
-
rb_cNodeSubclass[NODE_DMETHOD] = rb_cDMETHOD;
|
3803
|
-
rb_iv_set(rb_cDMETHOD, "__member__", members);
|
3804
|
-
rb_iv_set(rb_cDMETHOD, "__type__", INT2NUM(NODE_DMETHOD));
|
3805
|
-
rb_define_singleton_method(rb_cDMETHOD, "members", node_s_members, 0);
|
3806
3609
|
|
3807
|
-
/* Document-method:
|
3808
|
-
* the
|
3809
|
-
* body of the method
|
3610
|
+
/* Document-method: mid
|
3611
|
+
* the name of the method* defn the body of the method
|
3810
3612
|
*/
|
3811
|
-
rb_define_method(
|
3812
|
-
rb_ary_push(members, rb_str_new2("
|
3613
|
+
rb_define_method(rb_cDEFS, "mid", node_mid, 0);
|
3614
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
3813
3615
|
}
|
3814
3616
|
|
3815
3617
|
/* Document-class: Node::DOT2
|
@@ -3824,20 +3626,20 @@ void define_node_subclass_methods()
|
|
3824
3626
|
rb_iv_set(rb_cDOT2, "__member__", members);
|
3825
3627
|
rb_iv_set(rb_cDOT2, "__type__", INT2NUM(NODE_DOT2));
|
3826
3628
|
rb_define_singleton_method(rb_cDOT2, "members", node_s_members, 0);
|
3827
|
-
rb_define_method(rb_cDOT2, "state", node_state, 0);
|
3828
|
-
rb_ary_push(members, rb_str_new2("state"));
|
3829
|
-
|
3830
|
-
/* Document-method: end
|
3831
|
-
* the end of the range
|
3832
|
-
*/
|
3833
|
-
rb_define_method(rb_cDOT2, "end", node_end, 0);
|
3834
|
-
rb_ary_push(members, rb_str_new2("end"));
|
3835
3629
|
|
3836
3630
|
/* Document-method: beg
|
3837
3631
|
* the beginning of the range
|
3838
3632
|
*/
|
3839
3633
|
rb_define_method(rb_cDOT2, "beg", node_beg, 0);
|
3840
3634
|
rb_ary_push(members, rb_str_new2("beg"));
|
3635
|
+
|
3636
|
+
/* Document-method: end
|
3637
|
+
* the end of the range
|
3638
|
+
*/
|
3639
|
+
rb_define_method(rb_cDOT2, "end", node_end, 0);
|
3640
|
+
rb_ary_push(members, rb_str_new2("end"));
|
3641
|
+
rb_define_method(rb_cDOT2, "state", node_state, 0);
|
3642
|
+
rb_ary_push(members, rb_str_new2("state"));
|
3841
3643
|
}
|
3842
3644
|
|
3843
3645
|
/* Document-class: Node::DOT3
|
@@ -3852,20 +3654,20 @@ void define_node_subclass_methods()
|
|
3852
3654
|
rb_iv_set(rb_cDOT3, "__member__", members);
|
3853
3655
|
rb_iv_set(rb_cDOT3, "__type__", INT2NUM(NODE_DOT3));
|
3854
3656
|
rb_define_singleton_method(rb_cDOT3, "members", node_s_members, 0);
|
3855
|
-
rb_define_method(rb_cDOT3, "state", node_state, 0);
|
3856
|
-
rb_ary_push(members, rb_str_new2("state"));
|
3857
|
-
|
3858
|
-
/* Document-method: end
|
3859
|
-
* the end of the range
|
3860
|
-
*/
|
3861
|
-
rb_define_method(rb_cDOT3, "end", node_end, 0);
|
3862
|
-
rb_ary_push(members, rb_str_new2("end"));
|
3863
3657
|
|
3864
3658
|
/* Document-method: beg
|
3865
3659
|
* the beginning of the range
|
3866
3660
|
*/
|
3867
3661
|
rb_define_method(rb_cDOT3, "beg", node_beg, 0);
|
3868
3662
|
rb_ary_push(members, rb_str_new2("beg"));
|
3663
|
+
|
3664
|
+
/* Document-method: end
|
3665
|
+
* the end of the range
|
3666
|
+
*/
|
3667
|
+
rb_define_method(rb_cDOT3, "end", node_end, 0);
|
3668
|
+
rb_ary_push(members, rb_str_new2("end"));
|
3669
|
+
rb_define_method(rb_cDOT3, "state", node_state, 0);
|
3670
|
+
rb_ary_push(members, rb_str_new2("state"));
|
3869
3671
|
}
|
3870
3672
|
|
3871
3673
|
/* Document-class: Node::DREGX
|
@@ -4121,38 +3923,6 @@ void define_node_subclass_methods()
|
|
4121
3923
|
rb_define_singleton_method(rb_cFALSE, "members", node_s_members, 0);
|
4122
3924
|
}
|
4123
3925
|
|
4124
|
-
/* Document-class: Node::FBODY
|
4125
|
-
* A placeholder for a method alias, which can be added to a class by
|
4126
|
-
* using alias or alias_method:
|
4127
|
-
* alias old new
|
4128
|
-
*/
|
4129
|
-
{
|
4130
|
-
VALUE rb_cFBODY = rb_define_class_under(rb_cNode, "FBODY", rb_cNode);
|
4131
|
-
members = rb_ary_new();
|
4132
|
-
rb_cNodeSubclass[NODE_FBODY] = rb_cFBODY;
|
4133
|
-
rb_iv_set(rb_cFBODY, "__member__", members);
|
4134
|
-
rb_iv_set(rb_cFBODY, "__type__", INT2NUM(NODE_FBODY));
|
4135
|
-
rb_define_singleton_method(rb_cFBODY, "members", node_s_members, 0);
|
4136
|
-
|
4137
|
-
/* Document-method: orig
|
4138
|
-
* the origin class
|
4139
|
-
*/
|
4140
|
-
rb_define_method(rb_cFBODY, "orig", node_orig, 0);
|
4141
|
-
rb_ary_push(members, rb_str_new2("orig"));
|
4142
|
-
|
4143
|
-
/* Document-method: mid
|
4144
|
-
* the name of the method
|
4145
|
-
*/
|
4146
|
-
rb_define_method(rb_cFBODY, "mid", node_mid, 0);
|
4147
|
-
rb_ary_push(members, rb_str_new2("mid"));
|
4148
|
-
|
4149
|
-
/* Document-method: head
|
4150
|
-
* the method body
|
4151
|
-
*/
|
4152
|
-
rb_define_method(rb_cFBODY, "head", node_head, 0);
|
4153
|
-
rb_ary_push(members, rb_str_new2("head"));
|
4154
|
-
}
|
4155
|
-
|
4156
3926
|
/* Document-class: Node::FCALL
|
4157
3927
|
* Represents a method call in the form:
|
4158
3928
|
* mid(args).
|
@@ -4168,17 +3938,17 @@ void define_node_subclass_methods()
|
|
4168
3938
|
rb_iv_set(rb_cFCALL, "__type__", INT2NUM(NODE_FCALL));
|
4169
3939
|
rb_define_singleton_method(rb_cFCALL, "members", node_s_members, 0);
|
4170
3940
|
|
4171
|
-
/* Document-method: mid
|
4172
|
-
* the method id
|
4173
|
-
*/
|
4174
|
-
rb_define_method(rb_cFCALL, "mid", node_mid, 0);
|
4175
|
-
rb_ary_push(members, rb_str_new2("mid"));
|
4176
|
-
|
4177
3941
|
/* Document-method: args
|
4178
3942
|
* the arguments to the method
|
4179
3943
|
*/
|
4180
3944
|
rb_define_method(rb_cFCALL, "args", node_args, 0);
|
4181
3945
|
rb_ary_push(members, rb_str_new2("args"));
|
3946
|
+
|
3947
|
+
/* Document-method: mid
|
3948
|
+
* the method id
|
3949
|
+
*/
|
3950
|
+
rb_define_method(rb_cFCALL, "mid", node_mid, 0);
|
3951
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
4182
3952
|
}
|
4183
3953
|
|
4184
3954
|
/* Document-class: Node::FLIP2
|
@@ -4202,17 +3972,17 @@ void define_node_subclass_methods()
|
|
4202
3972
|
rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
|
4203
3973
|
rb_ary_push(members, rb_str_new2("cnt"));
|
4204
3974
|
|
4205
|
-
/* Document-method: end
|
4206
|
-
* the end of the range
|
4207
|
-
*/
|
4208
|
-
rb_define_method(rb_cFLIP2, "end", node_end, 0);
|
4209
|
-
rb_ary_push(members, rb_str_new2("end"));
|
4210
|
-
|
4211
3975
|
/* Document-method: beg
|
4212
3976
|
* the beginning of the range
|
4213
3977
|
*/
|
4214
3978
|
rb_define_method(rb_cFLIP2, "beg", node_beg, 0);
|
4215
3979
|
rb_ary_push(members, rb_str_new2("beg"));
|
3980
|
+
|
3981
|
+
/* Document-method: end
|
3982
|
+
* the end of the range
|
3983
|
+
*/
|
3984
|
+
rb_define_method(rb_cFLIP2, "end", node_end, 0);
|
3985
|
+
rb_ary_push(members, rb_str_new2("end"));
|
4216
3986
|
}
|
4217
3987
|
|
4218
3988
|
/* Document-class: Node::FLIP3
|
@@ -4236,17 +4006,17 @@ void define_node_subclass_methods()
|
|
4236
4006
|
rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
|
4237
4007
|
rb_ary_push(members, rb_str_new2("cnt"));
|
4238
4008
|
|
4239
|
-
/* Document-method: end
|
4240
|
-
* the end of the range
|
4241
|
-
*/
|
4242
|
-
rb_define_method(rb_cFLIP3, "end", node_end, 0);
|
4243
|
-
rb_ary_push(members, rb_str_new2("end"));
|
4244
|
-
|
4245
4009
|
/* Document-method: beg
|
4246
4010
|
* the beginning of the range
|
4247
4011
|
*/
|
4248
4012
|
rb_define_method(rb_cFLIP3, "beg", node_beg, 0);
|
4249
4013
|
rb_ary_push(members, rb_str_new2("beg"));
|
4014
|
+
|
4015
|
+
/* Document-method: end
|
4016
|
+
* the end of the range
|
4017
|
+
*/
|
4018
|
+
rb_define_method(rb_cFLIP3, "end", node_end, 0);
|
4019
|
+
rb_ary_push(members, rb_str_new2("end"));
|
4250
4020
|
}
|
4251
4021
|
|
4252
4022
|
/* Document-class: Node::FOR
|
@@ -4271,14 +4041,6 @@ void define_node_subclass_methods()
|
|
4271
4041
|
rb_iv_set(rb_cFOR, "__type__", INT2NUM(NODE_FOR));
|
4272
4042
|
rb_define_singleton_method(rb_cFOR, "members", node_s_members, 0);
|
4273
4043
|
|
4274
|
-
/* Document-method: var
|
4275
|
-
* an assignment node which assigns the next value in the sequence
|
4276
|
-
* to a variable, which may or may not be local. May also be a
|
4277
|
-
* multiple assignment.
|
4278
|
-
*/
|
4279
|
-
rb_define_method(rb_cFOR, "var", node_var, 0);
|
4280
|
-
rb_ary_push(members, rb_str_new2("var"));
|
4281
|
-
|
4282
4044
|
/* Document-method: body
|
4283
4045
|
* the body of the loop
|
4284
4046
|
*/
|
@@ -4290,6 +4052,14 @@ void define_node_subclass_methods()
|
|
4290
4052
|
*/
|
4291
4053
|
rb_define_method(rb_cFOR, "iter", node_iter, 0);
|
4292
4054
|
rb_ary_push(members, rb_str_new2("iter"));
|
4055
|
+
|
4056
|
+
/* Document-method: var
|
4057
|
+
* an assignment node which assigns the next value in the sequence
|
4058
|
+
* to a variable, which may or may not be local. May also be a
|
4059
|
+
* multiple assignment.
|
4060
|
+
*/
|
4061
|
+
rb_define_method(rb_cFOR, "var", node_var, 0);
|
4062
|
+
rb_ary_push(members, rb_str_new2("var"));
|
4293
4063
|
}
|
4294
4064
|
|
4295
4065
|
/* Document-class: Node::GASGN
|
@@ -4401,6 +4171,7 @@ void define_node_subclass_methods()
|
|
4401
4171
|
*
|
4402
4172
|
* A conditional block using elsif has another IF node as the else
|
4403
4173
|
* expression.
|
4174
|
+
*
|
4404
4175
|
*/
|
4405
4176
|
{
|
4406
4177
|
VALUE rb_cIF = rb_define_class_under(rb_cNode, "IF", rb_cNode);
|
@@ -4410,6 +4181,12 @@ void define_node_subclass_methods()
|
|
4410
4181
|
rb_iv_set(rb_cIF, "__type__", INT2NUM(NODE_IF));
|
4411
4182
|
rb_define_singleton_method(rb_cIF, "members", node_s_members, 0);
|
4412
4183
|
|
4184
|
+
/* Document-method: cond
|
4185
|
+
* the condition to evaluate
|
4186
|
+
*/
|
4187
|
+
rb_define_method(rb_cIF, "cond", node_cond, 0);
|
4188
|
+
rb_ary_push(members, rb_str_new2("cond"));
|
4189
|
+
|
4413
4190
|
/* Document-method: body
|
4414
4191
|
* the expression to evaluate if the expression is true, or false
|
4415
4192
|
* if the expression is empty
|
@@ -4423,12 +4200,6 @@ void define_node_subclass_methods()
|
|
4423
4200
|
*/
|
4424
4201
|
rb_define_method(rb_cIF, "else", node_else, 0);
|
4425
4202
|
rb_ary_push(members, rb_str_new2("else"));
|
4426
|
-
|
4427
|
-
/* Document-method: cond
|
4428
|
-
* the condition to evaluate
|
4429
|
-
*/
|
4430
|
-
rb_define_method(rb_cIF, "cond", node_cond, 0);
|
4431
|
-
rb_ary_push(members, rb_str_new2("cond"));
|
4432
4203
|
}
|
4433
4204
|
|
4434
4205
|
/* Document-class: Node::IFUNC
|
@@ -4442,11 +4213,11 @@ void define_node_subclass_methods()
|
|
4442
4213
|
rb_iv_set(rb_cIFUNC, "__type__", INT2NUM(NODE_IFUNC));
|
4443
4214
|
rb_define_singleton_method(rb_cIFUNC, "members", node_s_members, 0);
|
4444
4215
|
|
4445
|
-
/* Document-method:
|
4446
|
-
*
|
4216
|
+
/* Document-method: cfnc
|
4217
|
+
* a pointer to the C function to which to yield
|
4447
4218
|
*/
|
4448
|
-
rb_define_method(rb_cIFUNC, "
|
4449
|
-
rb_ary_push(members, rb_str_new2("
|
4219
|
+
rb_define_method(rb_cIFUNC, "cfnc", node_cfnc, 0);
|
4220
|
+
rb_ary_push(members, rb_str_new2("cfnc"));
|
4450
4221
|
|
4451
4222
|
/* Document-method: tval
|
4452
4223
|
* the user-specified data to be passed as the second argument to
|
@@ -4455,11 +4226,11 @@ void define_node_subclass_methods()
|
|
4455
4226
|
rb_define_method(rb_cIFUNC, "tval", node_tval, 0);
|
4456
4227
|
rb_ary_push(members, rb_str_new2("tval"));
|
4457
4228
|
|
4458
|
-
/* Document-method:
|
4459
|
-
*
|
4229
|
+
/* Document-method: state
|
4230
|
+
* always 0
|
4460
4231
|
*/
|
4461
|
-
rb_define_method(rb_cIFUNC, "
|
4462
|
-
rb_ary_push(members, rb_str_new2("
|
4232
|
+
rb_define_method(rb_cIFUNC, "state", node_state, 0);
|
4233
|
+
rb_ary_push(members, rb_str_new2("state"));
|
4463
4234
|
}
|
4464
4235
|
|
4465
4236
|
/* Document-class: Node::ITER
|
@@ -4483,14 +4254,6 @@ void define_node_subclass_methods()
|
|
4483
4254
|
rb_iv_set(rb_cITER, "__type__", INT2NUM(NODE_ITER));
|
4484
4255
|
rb_define_singleton_method(rb_cITER, "members", node_s_members, 0);
|
4485
4256
|
|
4486
|
-
/* Document-method: var
|
4487
|
-
* an assignment node which assigns the next value in the sequence
|
4488
|
-
* to a variable, which may or may not be local. May also be a
|
4489
|
-
* multiple assignment.
|
4490
|
-
*/
|
4491
|
-
rb_define_method(rb_cITER, "var", node_var, 0);
|
4492
|
-
rb_ary_push(members, rb_str_new2("var"));
|
4493
|
-
|
4494
4257
|
/* Document-method: body
|
4495
4258
|
* the body of the loop
|
4496
4259
|
*/
|
@@ -4503,6 +4266,14 @@ void define_node_subclass_methods()
|
|
4503
4266
|
*/
|
4504
4267
|
rb_define_method(rb_cITER, "iter", node_iter, 0);
|
4505
4268
|
rb_ary_push(members, rb_str_new2("iter"));
|
4269
|
+
|
4270
|
+
/* Document-method: var
|
4271
|
+
* an assignment node which assigns the next value in the sequence
|
4272
|
+
* to a variable, which may or may not be local. May also be a
|
4273
|
+
* multiple assignment.
|
4274
|
+
*/
|
4275
|
+
rb_define_method(rb_cITER, "var", node_var, 0);
|
4276
|
+
rb_ary_push(members, rb_str_new2("var"));
|
4506
4277
|
}
|
4507
4278
|
|
4508
4279
|
/* Document-class: Node::IVAR
|
@@ -4542,14 +4313,14 @@ void define_node_subclass_methods()
|
|
4542
4313
|
*/
|
4543
4314
|
rb_define_method(rb_cLASGN, "value", node_value, 0);
|
4544
4315
|
rb_ary_push(members, rb_str_new2("value"));
|
4545
|
-
rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
|
4546
|
-
rb_ary_push(members, rb_str_new2("cnt"));
|
4547
4316
|
|
4548
4317
|
/* Document-method: vid
|
4549
4318
|
* the name of the local variable
|
4550
4319
|
*/
|
4551
4320
|
rb_define_method(rb_cLASGN, "vid", node_vid, 0);
|
4552
4321
|
rb_ary_push(members, rb_str_new2("vid"));
|
4322
|
+
rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
|
4323
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
4553
4324
|
}
|
4554
4325
|
|
4555
4326
|
/* Document-class: Node::LIT
|
@@ -4581,14 +4352,14 @@ void define_node_subclass_methods()
|
|
4581
4352
|
rb_iv_set(rb_cLVAR, "__member__", members);
|
4582
4353
|
rb_iv_set(rb_cLVAR, "__type__", INT2NUM(NODE_LVAR));
|
4583
4354
|
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"));
|
4586
4355
|
|
4587
4356
|
/* Document-method: vid
|
4588
4357
|
* the name of the local variable to retrieve.
|
4589
4358
|
*/
|
4590
4359
|
rb_define_method(rb_cLVAR, "vid", node_vid, 0);
|
4591
4360
|
rb_ary_push(members, rb_str_new2("vid"));
|
4361
|
+
rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
|
4362
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
4592
4363
|
}
|
4593
4364
|
|
4594
4365
|
/* Document-class: Node::MASGN
|
@@ -4602,11 +4373,11 @@ void define_node_subclass_methods()
|
|
4602
4373
|
rb_iv_set(rb_cMASGN, "__type__", INT2NUM(NODE_MASGN));
|
4603
4374
|
rb_define_singleton_method(rb_cMASGN, "members", node_s_members, 0);
|
4604
4375
|
|
4605
|
-
/* Document-method:
|
4376
|
+
/* Document-method: args
|
4606
4377
|
* TODO
|
4607
4378
|
*/
|
4608
|
-
rb_define_method(rb_cMASGN, "
|
4609
|
-
rb_ary_push(members, rb_str_new2("
|
4379
|
+
rb_define_method(rb_cMASGN, "args", node_args, 0);
|
4380
|
+
rb_ary_push(members, rb_str_new2("args"));
|
4610
4381
|
|
4611
4382
|
/* Document-method: head
|
4612
4383
|
* TODO
|
@@ -4614,11 +4385,11 @@ void define_node_subclass_methods()
|
|
4614
4385
|
rb_define_method(rb_cMASGN, "head", node_head, 0);
|
4615
4386
|
rb_ary_push(members, rb_str_new2("head"));
|
4616
4387
|
|
4617
|
-
/* Document-method:
|
4388
|
+
/* Document-method: value
|
4618
4389
|
* TODO
|
4619
4390
|
*/
|
4620
|
-
rb_define_method(rb_cMASGN, "
|
4621
|
-
rb_ary_push(members, rb_str_new2("
|
4391
|
+
rb_define_method(rb_cMASGN, "value", node_value, 0);
|
4392
|
+
rb_ary_push(members, rb_str_new2("value"));
|
4622
4393
|
}
|
4623
4394
|
|
4624
4395
|
/* Document-class: Node::MATCH
|
@@ -4643,17 +4414,17 @@ void define_node_subclass_methods()
|
|
4643
4414
|
rb_iv_set(rb_cMATCH, "__type__", INT2NUM(NODE_MATCH));
|
4644
4415
|
rb_define_singleton_method(rb_cMATCH, "members", node_s_members, 0);
|
4645
4416
|
|
4646
|
-
/* Document-method: value
|
4647
|
-
* the value to compare against
|
4648
|
-
*/
|
4649
|
-
rb_define_method(rb_cMATCH, "value", node_value, 0);
|
4650
|
-
rb_ary_push(members, rb_str_new2("value"));
|
4651
|
-
|
4652
4417
|
/* Document-method: lit
|
4653
4418
|
* the regular expression to use in the condition.
|
4654
4419
|
*/
|
4655
4420
|
rb_define_method(rb_cMATCH, "lit", node_lit, 0);
|
4656
4421
|
rb_ary_push(members, rb_str_new2("lit"));
|
4422
|
+
|
4423
|
+
/* Document-method: value
|
4424
|
+
* the value to compare against
|
4425
|
+
*/
|
4426
|
+
rb_define_method(rb_cMATCH, "value", node_value, 0);
|
4427
|
+
rb_ary_push(members, rb_str_new2("value"));
|
4657
4428
|
}
|
4658
4429
|
|
4659
4430
|
/* Document-class: Node::MATCH2
|
@@ -4681,6 +4452,13 @@ void define_node_subclass_methods()
|
|
4681
4452
|
rb_iv_set(rb_cMATCH2, "__type__", INT2NUM(NODE_MATCH2));
|
4682
4453
|
rb_define_singleton_method(rb_cMATCH2, "members", node_s_members, 0);
|
4683
4454
|
|
4455
|
+
/* Document-method: recv
|
4456
|
+
* the regular expression on the left hand side of the match
|
4457
|
+
* operator
|
4458
|
+
*/
|
4459
|
+
rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
|
4460
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
4461
|
+
|
4684
4462
|
/* Document-method: value
|
4685
4463
|
* the expression on the right hand side of the match operator, or
|
4686
4464
|
* an expression returning $_ if there is nothing on the right hand
|
@@ -4688,13 +4466,6 @@ void define_node_subclass_methods()
|
|
4688
4466
|
*/
|
4689
4467
|
rb_define_method(rb_cMATCH2, "value", node_value, 0);
|
4690
4468
|
rb_ary_push(members, rb_str_new2("value"));
|
4691
|
-
|
4692
|
-
/* Document-method: recv
|
4693
|
-
* the regular expression on the left hand side of the match
|
4694
|
-
* operator
|
4695
|
-
*/
|
4696
|
-
rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
|
4697
|
-
rb_ary_push(members, rb_str_new2("recv"));
|
4698
4469
|
}
|
4699
4470
|
|
4700
4471
|
/* Document-class: Node::MATCH3
|
@@ -4712,17 +4483,17 @@ void define_node_subclass_methods()
|
|
4712
4483
|
rb_iv_set(rb_cMATCH3, "__type__", INT2NUM(NODE_MATCH3));
|
4713
4484
|
rb_define_singleton_method(rb_cMATCH3, "members", node_s_members, 0);
|
4714
4485
|
|
4715
|
-
/* Document-method: value
|
4716
|
-
* the right hand side of the match
|
4717
|
-
*/
|
4718
|
-
rb_define_method(rb_cMATCH3, "value", node_value, 0);
|
4719
|
-
rb_ary_push(members, rb_str_new2("value"));
|
4720
|
-
|
4721
4486
|
/* Document-method: recv
|
4722
4487
|
* the left hand side of the match
|
4723
4488
|
*/
|
4724
4489
|
rb_define_method(rb_cMATCH3, "recv", node_recv, 0);
|
4725
4490
|
rb_ary_push(members, rb_str_new2("recv"));
|
4491
|
+
|
4492
|
+
/* Document-method: value
|
4493
|
+
* the right hand side of the match
|
4494
|
+
*/
|
4495
|
+
rb_define_method(rb_cMATCH3, "value", node_value, 0);
|
4496
|
+
rb_ary_push(members, rb_str_new2("value"));
|
4726
4497
|
}
|
4727
4498
|
|
4728
4499
|
/* Document-class: Node::MEMO
|
@@ -4748,30 +4519,6 @@ void define_node_subclass_methods()
|
|
4748
4519
|
rb_define_singleton_method(rb_cMEMO, "members", node_s_members, 0);
|
4749
4520
|
}
|
4750
4521
|
|
4751
|
-
/* Document-class: Node::METHOD
|
4752
|
-
* A placeholder for a method entry in a class's method table.
|
4753
|
-
*/
|
4754
|
-
{
|
4755
|
-
VALUE rb_cMETHOD = rb_define_class_under(rb_cNode, "METHOD", rb_cNode);
|
4756
|
-
members = rb_ary_new();
|
4757
|
-
rb_cNodeSubclass[NODE_METHOD] = rb_cMETHOD;
|
4758
|
-
rb_iv_set(rb_cMETHOD, "__member__", members);
|
4759
|
-
rb_iv_set(rb_cMETHOD, "__type__", INT2NUM(NODE_METHOD));
|
4760
|
-
rb_define_singleton_method(rb_cMETHOD, "members", node_s_members, 0);
|
4761
|
-
|
4762
|
-
/* Document-method: noex
|
4763
|
-
* the method's flags
|
4764
|
-
*/
|
4765
|
-
rb_define_method(rb_cMETHOD, "noex", node_noex, 0);
|
4766
|
-
rb_ary_push(members, rb_str_new2("noex"));
|
4767
|
-
|
4768
|
-
/* Document-method: body
|
4769
|
-
* the body of the method
|
4770
|
-
*/
|
4771
|
-
rb_define_method(rb_cMETHOD, "body", node_body, 0);
|
4772
|
-
rb_ary_push(members, rb_str_new2("body"));
|
4773
|
-
}
|
4774
|
-
|
4775
4522
|
/* Document-class: Node::MODULE
|
4776
4523
|
* Represents a module definition, e.g.:
|
4777
4524
|
* module cpath
|
@@ -4804,25 +4551,6 @@ void define_node_subclass_methods()
|
|
4804
4551
|
rb_ary_push(members, rb_str_new2("body"));
|
4805
4552
|
}
|
4806
4553
|
|
4807
|
-
/* Document-class: Node::NEWLINE
|
4808
|
-
* Represents the termination of a line. This is used for calling
|
4809
|
-
* event hooks when a new line of code is reached.
|
4810
|
-
*/
|
4811
|
-
{
|
4812
|
-
VALUE rb_cNEWLINE = rb_define_class_under(rb_cNode, "NEWLINE", rb_cNode);
|
4813
|
-
members = rb_ary_new();
|
4814
|
-
rb_cNodeSubclass[NODE_NEWLINE] = rb_cNEWLINE;
|
4815
|
-
rb_iv_set(rb_cNEWLINE, "__member__", members);
|
4816
|
-
rb_iv_set(rb_cNEWLINE, "__type__", INT2NUM(NODE_NEWLINE));
|
4817
|
-
rb_define_singleton_method(rb_cNEWLINE, "members", node_s_members, 0);
|
4818
|
-
|
4819
|
-
/* Document-method: next
|
4820
|
-
* the expression on the next line
|
4821
|
-
*/
|
4822
|
-
rb_define_method(rb_cNEWLINE, "next", node_next, 0);
|
4823
|
-
rb_ary_push(members, rb_str_new2("next"));
|
4824
|
-
}
|
4825
|
-
|
4826
4554
|
/* Document-class: Node::NEXT
|
4827
4555
|
* Represents the 'next' keyword.
|
4828
4556
|
* Causes control to be transferred to the end of the loop, causing the
|
@@ -4851,24 +4579,6 @@ void define_node_subclass_methods()
|
|
4851
4579
|
rb_define_singleton_method(rb_cNIL, "members", node_s_members, 0);
|
4852
4580
|
}
|
4853
4581
|
|
4854
|
-
/* Document-class: Node::NOT
|
4855
|
-
* Represents a logical negation.
|
4856
|
-
*/
|
4857
|
-
{
|
4858
|
-
VALUE rb_cNOT = rb_define_class_under(rb_cNode, "NOT", rb_cNode);
|
4859
|
-
members = rb_ary_new();
|
4860
|
-
rb_cNodeSubclass[NODE_NOT] = rb_cNOT;
|
4861
|
-
rb_iv_set(rb_cNOT, "__member__", members);
|
4862
|
-
rb_iv_set(rb_cNOT, "__type__", INT2NUM(NODE_NOT));
|
4863
|
-
rb_define_singleton_method(rb_cNOT, "members", node_s_members, 0);
|
4864
|
-
|
4865
|
-
/* Document-method: body
|
4866
|
-
* the value to negate.
|
4867
|
-
*/
|
4868
|
-
rb_define_method(rb_cNOT, "body", node_body, 0);
|
4869
|
-
rb_ary_push(members, rb_str_new2("body"));
|
4870
|
-
}
|
4871
|
-
|
4872
4582
|
/* Document-class: Node::NTH_REF
|
4873
4583
|
* Represents the nth match data item, e.g. $1, $2, etc.
|
4874
4584
|
*/
|
@@ -4943,6 +4653,12 @@ void define_node_subclass_methods()
|
|
4943
4653
|
rb_iv_set(rb_cOP_ASGN1, "__type__", INT2NUM(NODE_OP_ASGN1));
|
4944
4654
|
rb_define_singleton_method(rb_cOP_ASGN1, "members", node_s_members, 0);
|
4945
4655
|
|
4656
|
+
/* Document-method: args
|
4657
|
+
* the arguments to the assigment
|
4658
|
+
*/
|
4659
|
+
rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
|
4660
|
+
rb_ary_push(members, rb_str_new2("args"));
|
4661
|
+
|
4946
4662
|
/* Document-method: mid
|
4947
4663
|
* 0, 1, or the name a method to call to calculate the value of the
|
4948
4664
|
* rhs
|
@@ -4955,12 +4671,6 @@ void define_node_subclass_methods()
|
|
4955
4671
|
*/
|
4956
4672
|
rb_define_method(rb_cOP_ASGN1, "recv", node_recv, 0);
|
4957
4673
|
rb_ary_push(members, rb_str_new2("recv"));
|
4958
|
-
|
4959
|
-
/* Document-method: args
|
4960
|
-
* the arguments to the assigment
|
4961
|
-
*/
|
4962
|
-
rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
|
4963
|
-
rb_ary_push(members, rb_str_new2("args"));
|
4964
4674
|
}
|
4965
4675
|
|
4966
4676
|
/* Document-class: Node::OP_ASGN2
|
@@ -4983,11 +4693,11 @@ void define_node_subclass_methods()
|
|
4983
4693
|
rb_iv_set(rb_cOP_ASGN2, "__type__", INT2NUM(NODE_OP_ASGN2));
|
4984
4694
|
rb_define_singleton_method(rb_cOP_ASGN2, "members", node_s_members, 0);
|
4985
4695
|
|
4986
|
-
/* Document-method:
|
4987
|
-
* the
|
4696
|
+
/* Document-method: recv
|
4697
|
+
* the receiver of the attribute
|
4988
4698
|
*/
|
4989
|
-
rb_define_method(rb_cOP_ASGN2, "
|
4990
|
-
rb_ary_push(members, rb_str_new2("
|
4699
|
+
rb_define_method(rb_cOP_ASGN2, "recv", node_recv, 0);
|
4700
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
4991
4701
|
|
4992
4702
|
/* Document-method: next
|
4993
4703
|
* another node of type OP_ASGN2 which contains more information
|
@@ -4996,11 +4706,11 @@ void define_node_subclass_methods()
|
|
4996
4706
|
rb_define_method(rb_cOP_ASGN2, "next", node_next, 0);
|
4997
4707
|
rb_ary_push(members, rb_str_new2("next"));
|
4998
4708
|
|
4999
|
-
/* Document-method:
|
5000
|
-
* the
|
4709
|
+
/* Document-method: value
|
4710
|
+
* the value to assign to the attribute
|
5001
4711
|
*/
|
5002
|
-
rb_define_method(rb_cOP_ASGN2, "
|
5003
|
-
rb_ary_push(members, rb_str_new2("
|
4712
|
+
rb_define_method(rb_cOP_ASGN2, "value", node_value, 0);
|
4713
|
+
rb_ary_push(members, rb_str_new2("value"));
|
5004
4714
|
}
|
5005
4715
|
|
5006
4716
|
/* Document-class: Node::OP_ASGN2_ARG
|
@@ -5016,6 +4726,12 @@ void define_node_subclass_methods()
|
|
5016
4726
|
rb_iv_set(rb_cOP_ASGN2_ARG, "__type__", INT2NUM(NODE_OP_ASGN2_ARG));
|
5017
4727
|
rb_define_singleton_method(rb_cOP_ASGN2_ARG, "members", node_s_members, 0);
|
5018
4728
|
|
4729
|
+
/* Document-method: vid
|
4730
|
+
* The method to call on the receiver to retrieve the attribute
|
4731
|
+
*/
|
4732
|
+
rb_define_method(rb_cOP_ASGN2_ARG, "vid", node_vid, 0);
|
4733
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
4734
|
+
|
5019
4735
|
/* Document-method: aid
|
5020
4736
|
* The method to call on the receiver to set the attribute
|
5021
4737
|
*/
|
@@ -5029,12 +4745,6 @@ void define_node_subclass_methods()
|
|
5029
4745
|
*/
|
5030
4746
|
rb_define_method(rb_cOP_ASGN2_ARG, "mid", node_mid, 0);
|
5031
4747
|
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"));
|
5038
4748
|
}
|
5039
4749
|
|
5040
4750
|
/* Document-class: Node::OP_ASGN_AND
|
@@ -5053,18 +4763,18 @@ void define_node_subclass_methods()
|
|
5053
4763
|
rb_iv_set(rb_cOP_ASGN_AND, "__type__", INT2NUM(NODE_OP_ASGN_AND));
|
5054
4764
|
rb_define_singleton_method(rb_cOP_ASGN_AND, "members", node_s_members, 0);
|
5055
4765
|
|
4766
|
+
/* Document-method: recv
|
4767
|
+
* an expression representing the left hand side of the assignment
|
4768
|
+
*/
|
4769
|
+
rb_define_method(rb_cOP_ASGN_AND, "recv", node_recv, 0);
|
4770
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
4771
|
+
|
5056
4772
|
/* Document-method: value
|
5057
4773
|
* an expression representing the assignment that should be
|
5058
4774
|
* performed if the left hand side is true
|
5059
4775
|
*/
|
5060
4776
|
rb_define_method(rb_cOP_ASGN_AND, "value", node_value, 0);
|
5061
4777
|
rb_ary_push(members, rb_str_new2("value"));
|
5062
|
-
|
5063
|
-
/* Document-method: recv
|
5064
|
-
* an expression representing the left hand side of the assignment
|
5065
|
-
*/
|
5066
|
-
rb_define_method(rb_cOP_ASGN_AND, "recv", node_recv, 0);
|
5067
|
-
rb_ary_push(members, rb_str_new2("recv"));
|
5068
4778
|
}
|
5069
4779
|
|
5070
4780
|
/* Document-class: Node::OP_ASGN_OR
|
@@ -5237,18 +4947,18 @@ void define_node_subclass_methods()
|
|
5237
4947
|
rb_iv_set(rb_cRESCUE, "__type__", INT2NUM(NODE_RESCUE));
|
5238
4948
|
rb_define_singleton_method(rb_cRESCUE, "members", node_s_members, 0);
|
5239
4949
|
|
5240
|
-
/* Document-method: resq
|
5241
|
-
* the expression to be evaluated if an exception is raised
|
5242
|
-
*/
|
5243
|
-
rb_define_method(rb_cRESCUE, "resq", node_resq, 0);
|
5244
|
-
rb_ary_push(members, rb_str_new2("resq"));
|
5245
|
-
|
5246
4950
|
/* Document-method: head
|
5247
4951
|
* the body of the block to evaluate
|
5248
4952
|
*/
|
5249
4953
|
rb_define_method(rb_cRESCUE, "head", node_head, 0);
|
5250
4954
|
rb_ary_push(members, rb_str_new2("head"));
|
5251
4955
|
|
4956
|
+
/* Document-method: resq
|
4957
|
+
* the expression to be evaluated if an exception is raised
|
4958
|
+
*/
|
4959
|
+
rb_define_method(rb_cRESCUE, "resq", node_resq, 0);
|
4960
|
+
rb_ary_push(members, rb_str_new2("resq"));
|
4961
|
+
|
5252
4962
|
/* Document-method: else
|
5253
4963
|
* the expression to be evaluated if no exception is raised
|
5254
4964
|
*/
|
@@ -5350,18 +5060,18 @@ void define_node_subclass_methods()
|
|
5350
5060
|
rb_define_method(rb_cSCOPE, "tbl", node_tbl, 0);
|
5351
5061
|
rb_ary_push(members, rb_str_new2("tbl"));
|
5352
5062
|
|
5353
|
-
/* Document-method: next
|
5354
|
-
* the body of the lexical scope
|
5355
|
-
*/
|
5356
|
-
rb_define_method(rb_cSCOPE, "next", node_next, 0);
|
5357
|
-
rb_ary_push(members, rb_str_new2("next"));
|
5358
|
-
|
5359
5063
|
/* Document-method: rval
|
5360
5064
|
* holds information about which class(es) to search for constants
|
5361
5065
|
* in this scope
|
5362
5066
|
*/
|
5363
5067
|
rb_define_method(rb_cSCOPE, "rval", node_rval, 0);
|
5364
5068
|
rb_ary_push(members, rb_str_new2("rval"));
|
5069
|
+
|
5070
|
+
/* Document-method: next
|
5071
|
+
* the body of the lexical scope
|
5072
|
+
*/
|
5073
|
+
rb_define_method(rb_cSCOPE, "next", node_next, 0);
|
5074
|
+
rb_ary_push(members, rb_str_new2("next"));
|
5365
5075
|
}
|
5366
5076
|
|
5367
5077
|
/* Document-class: Node::SELF
|
@@ -5436,31 +5146,6 @@ void define_node_subclass_methods()
|
|
5436
5146
|
rb_ary_push(members, rb_str_new2("args"));
|
5437
5147
|
}
|
5438
5148
|
|
5439
|
-
/* Document-class: Node::SVALUE
|
5440
|
-
* Represents the collection of multiple values of the right hand side
|
5441
|
-
* of an assignment into a single value, for use in single assignment,
|
5442
|
-
* e.g.:
|
5443
|
-
* lhs = a, b, c
|
5444
|
-
* The argument to this node is an Array.
|
5445
|
-
* If it is length 0, returns nil.
|
5446
|
-
* If it is length 1, returns the first element in the array.
|
5447
|
-
* Otherwise, returns the array.
|
5448
|
-
*/
|
5449
|
-
{
|
5450
|
-
VALUE rb_cSVALUE = rb_define_class_under(rb_cNode, "SVALUE", rb_cNode);
|
5451
|
-
members = rb_ary_new();
|
5452
|
-
rb_cNodeSubclass[NODE_SVALUE] = rb_cSVALUE;
|
5453
|
-
rb_iv_set(rb_cSVALUE, "__member__", members);
|
5454
|
-
rb_iv_set(rb_cSVALUE, "__type__", INT2NUM(NODE_SVALUE));
|
5455
|
-
rb_define_singleton_method(rb_cSVALUE, "members", node_s_members, 0);
|
5456
|
-
|
5457
|
-
/* Document-method: head
|
5458
|
-
* an expression which returns an Array.
|
5459
|
-
*/
|
5460
|
-
rb_define_method(rb_cSVALUE, "head", node_head, 0);
|
5461
|
-
rb_ary_push(members, rb_str_new2("head"));
|
5462
|
-
}
|
5463
|
-
|
5464
5149
|
/* Document-class: Node::TO_ARY
|
5465
5150
|
* Represents a conversion from one object type to an array type.
|
5466
5151
|
* Evaluation of this node converts its argument to an array by calling
|
@@ -5528,8 +5213,6 @@ void define_node_subclass_methods()
|
|
5528
5213
|
rb_iv_set(rb_cUNTIL, "__member__", members);
|
5529
5214
|
rb_iv_set(rb_cUNTIL, "__type__", INT2NUM(NODE_UNTIL));
|
5530
5215
|
rb_define_singleton_method(rb_cUNTIL, "members", node_s_members, 0);
|
5531
|
-
rb_define_method(rb_cUNTIL, "state", node_state, 0);
|
5532
|
-
rb_ary_push(members, rb_str_new2("state"));
|
5533
5216
|
|
5534
5217
|
/* Document-method: body
|
5535
5218
|
* the body of the loop
|
@@ -5542,6 +5225,8 @@ void define_node_subclass_methods()
|
|
5542
5225
|
*/
|
5543
5226
|
rb_define_method(rb_cUNTIL, "cond", node_cond, 0);
|
5544
5227
|
rb_ary_push(members, rb_str_new2("cond"));
|
5228
|
+
rb_define_method(rb_cUNTIL, "state", node_state, 0);
|
5229
|
+
rb_ary_push(members, rb_str_new2("state"));
|
5545
5230
|
}
|
5546
5231
|
|
5547
5232
|
/* Document-class: Node::VALIAS
|
@@ -5557,10 +5242,10 @@ void define_node_subclass_methods()
|
|
5557
5242
|
rb_iv_set(rb_cVALIAS, "__member__", members);
|
5558
5243
|
rb_iv_set(rb_cVALIAS, "__type__", INT2NUM(NODE_VALIAS));
|
5559
5244
|
rb_define_singleton_method(rb_cVALIAS, "members", node_s_members, 0);
|
5560
|
-
rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
|
5561
|
-
rb_ary_push(members, rb_str_new2("second"));
|
5562
5245
|
rb_define_method(rb_cVALIAS, "first", node_1st, 0);
|
5563
5246
|
rb_ary_push(members, rb_str_new2("first"));
|
5247
|
+
rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
|
5248
|
+
rb_ary_push(members, rb_str_new2("second"));
|
5564
5249
|
}
|
5565
5250
|
|
5566
5251
|
/* Document-class: Node::VCALL
|
@@ -5620,12 +5305,6 @@ void define_node_subclass_methods()
|
|
5620
5305
|
rb_iv_set(rb_cWHEN, "__type__", INT2NUM(NODE_WHEN));
|
5621
5306
|
rb_define_singleton_method(rb_cWHEN, "members", node_s_members, 0);
|
5622
5307
|
|
5623
|
-
/* Document-method: next
|
5624
|
-
* the next expression to be evaluated if the condition is false
|
5625
|
-
*/
|
5626
|
-
rb_define_method(rb_cWHEN, "next", node_next, 0);
|
5627
|
-
rb_ary_push(members, rb_str_new2("next"));
|
5628
|
-
|
5629
5308
|
/* Document-method: head
|
5630
5309
|
* a value to compare against, or a condition to be tested
|
5631
5310
|
*/
|
@@ -5637,6 +5316,12 @@ void define_node_subclass_methods()
|
|
5637
5316
|
*/
|
5638
5317
|
rb_define_method(rb_cWHEN, "body", node_body, 0);
|
5639
5318
|
rb_ary_push(members, rb_str_new2("body"));
|
5319
|
+
|
5320
|
+
/* Document-method: next
|
5321
|
+
* the next expression to be evaluated if the condition is false
|
5322
|
+
*/
|
5323
|
+
rb_define_method(rb_cWHEN, "next", node_next, 0);
|
5324
|
+
rb_ary_push(members, rb_str_new2("next"));
|
5640
5325
|
}
|
5641
5326
|
|
5642
5327
|
/* Document-class: Node::WHILE
|
@@ -5652,8 +5337,6 @@ void define_node_subclass_methods()
|
|
5652
5337
|
rb_iv_set(rb_cWHILE, "__member__", members);
|
5653
5338
|
rb_iv_set(rb_cWHILE, "__type__", INT2NUM(NODE_WHILE));
|
5654
5339
|
rb_define_singleton_method(rb_cWHILE, "members", node_s_members, 0);
|
5655
|
-
rb_define_method(rb_cWHILE, "state", node_state, 0);
|
5656
|
-
rb_ary_push(members, rb_str_new2("state"));
|
5657
5340
|
|
5658
5341
|
/* Document-method: body
|
5659
5342
|
* the body of the loop
|
@@ -5666,6 +5349,8 @@ void define_node_subclass_methods()
|
|
5666
5349
|
*/
|
5667
5350
|
rb_define_method(rb_cWHILE, "cond", node_cond, 0);
|
5668
5351
|
rb_ary_push(members, rb_str_new2("cond"));
|
5352
|
+
rb_define_method(rb_cWHILE, "state", node_state, 0);
|
5353
|
+
rb_ary_push(members, rb_str_new2("state"));
|
5669
5354
|
}
|
5670
5355
|
|
5671
5356
|
/* Document-class: Node::XSTR
|
@@ -5702,17 +5387,17 @@ void define_node_subclass_methods()
|
|
5702
5387
|
rb_iv_set(rb_cYIELD, "__type__", INT2NUM(NODE_YIELD));
|
5703
5388
|
rb_define_singleton_method(rb_cYIELD, "members", node_s_members, 0);
|
5704
5389
|
|
5705
|
-
/* Document-method: state
|
5706
|
-
* if nonzero, splats the value before yielding
|
5707
|
-
*/
|
5708
|
-
rb_define_method(rb_cYIELD, "state", node_state, 0);
|
5709
|
-
rb_ary_push(members, rb_str_new2("state"));
|
5710
|
-
|
5711
5390
|
/* Document-method: head
|
5712
5391
|
* the value to yield
|
5713
5392
|
*/
|
5714
5393
|
rb_define_method(rb_cYIELD, "head", node_head, 0);
|
5715
5394
|
rb_ary_push(members, rb_str_new2("head"));
|
5395
|
+
|
5396
|
+
/* Document-method: state
|
5397
|
+
* if nonzero, splats the value before yielding
|
5398
|
+
*/
|
5399
|
+
rb_define_method(rb_cYIELD, "state", node_state, 0);
|
5400
|
+
rb_ary_push(members, rb_str_new2("state"));
|
5716
5401
|
}
|
5717
5402
|
|
5718
5403
|
/* Document-class: Node::ZARRAY
|