summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog25
-rw-r--r--config.sub2
-rw-r--r--eval.c2
-rw-r--r--ext/nkf/MANIFEST2
-rw-r--r--ext/socket/socket.c8
-rw-r--r--hash.c24
-rw-r--r--io.c4
-rw-r--r--lib/telnet.rb20
-rw-r--r--lib/thread.rb3
-rw-r--r--node.h2
-rw-r--r--parse.c591
-rw-r--r--regex.c21
-rw-r--r--ruby.c63
-rw-r--r--version.h2
14 files changed, 435 insertions, 334 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c509ce..1aa0dd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+Thu Apr 15 23:46:20 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * ruby.c (rubylib_mangle): mangle path by RUBYLIB_PREFIX.
+
+Wed Apr 14 23:52:51 1999 SHIROYAMA Takayuki <psi@tokyo.stellar.co.jp>
+
+ * node.h (NODE_LMASK): should be long to avoid overflow.
+
+Wed Apr 14 12:19:09 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * lib/thread.rb: Queue#{enq,deq} added.
+
+Tue Apr 13 17:43:56 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * hash.c (rb_hash_s_create): Hash::[] acts more like casting.
+
+Tue Apr 13 00:33:52 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * io.c (rb_io_stdio_set): warning for assignment to the variables
+ $std{in,out,err}.
+
+Mon Apr 12 23:12:32 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * io.c (rb_io_reopen): check for reopening same IO.
+
Fri Apr 9 17:45:11 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* parse.y (rb_compile_string): bug for nested eval().
diff --git a/config.sub b/config.sub
index e1b83ba..aa22412 100644
--- a/config.sub
+++ b/config.sub
@@ -723,7 +723,7 @@ case $os in
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux* | -uxpv* | -beos*)
+ | -mingw32* | -linux* | -uxpv* | -beos* | -rhapsody* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sunos5*)
diff --git a/eval.c b/eval.c
index e012f56..65d4f47 100644
--- a/eval.c
+++ b/eval.c
@@ -4252,7 +4252,7 @@ rb_f_eval(argc, argv, self)
}
Check_SafeStr(src);
- return eval(self, src, scope, file, line-1);
+ return eval(self, src, scope, file, line);
}
static VALUE
diff --git a/ext/nkf/MANIFEST b/ext/nkf/MANIFEST
index 5e01e6e..5114a37 100644
--- a/ext/nkf/MANIFEST
+++ b/ext/nkf/MANIFEST
@@ -3,5 +3,5 @@ depend
extconf.rb
lib/kconv.rb
nkf.c
-1.7/nkf.c
+nkf1.7/nkf.c
test.rb
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index c630a4b..197c8e7 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -535,14 +535,12 @@ thread_connect(fd, sockaddr, len, type)
}
if (status < 0) {
switch (errno) {
-#ifdef EINPROGRESS
- case EINPROGRESS:
#ifdef EAGAIN
case EAGAIN:
+#ifdef EINPROGRESS
+ case EINPROGRESS:
#endif
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
- rb_thread_select(fd+1, 0, &fds, 0, 0);
+ rb_thread_fd_writable(fd);
continue;
#endif
diff --git a/hash.c b/hash.c
index 34b02df..69e6eb3 100644
--- a/hash.c
+++ b/hash.c
@@ -241,17 +241,23 @@ rb_hash_s_create(argc, argv, klass)
VALUE hash;
int i;
- if (argc == 1 && TYPE(argv[0]) == T_HASH) {
- NEWOBJ(hash, struct RHash);
- OBJSETUP(hash, klass, T_HASH);
+ if (argc == 1) {
+ if (TYPE(argv[0]) == T_HASH) {
+ NEWOBJ(hash, struct RHash);
+ OBJSETUP(hash, klass, T_HASH);
- hash->iter_lev = 0;
- hash->ifnone = Qnil;
- hash->tbl = 0; /* avoid GC crashing */
- hash->tbl = (st_table*)st_copy(RHASH(argv[0])->tbl);
- rb_obj_call_init((VALUE)hash, argc, argv);
+ hash->iter_lev = 0;
+ hash->ifnone = Qnil;
+ hash->tbl = 0; /* avoid GC crashing */
+ hash->tbl = st_copy(RHASH(argv[0])->tbl);
+ rb_obj_call_init((VALUE)hash, argc, argv);
- return (VALUE)hash;
+ return (VALUE)hash;
+ }
+ else {
+ VALUE a = rb_Array(argv[0]);
+ return rb_hash_s_create(RARRAY(a)->len, RARRAY(a)->ptr, klass);
+ }
}
if (argc % 2 != 0) {
diff --git a/io.c b/io.c
index 81f1003..d65eff0 100644
--- a/io.c
+++ b/io.c
@@ -1607,6 +1607,7 @@ rb_io_reopen(io, nfile)
nfile = rb_io_get_io(nfile);
GetOpenFile(nfile, orig);
+ if (fptr == orig) return io;
if (orig->f2) {
fflush(orig->f2);
}
@@ -1999,6 +2000,9 @@ rb_io_stdio_set(val, id, var)
if (TYPE(val) != T_FILE) {
rb_raise(rb_eTypeError, "%s must be IO object", rb_id2name(id));
}
+ if (ruby_verbose) {
+ rb_warn("assignment for %s is done by reopen", rb_id2name(id));
+ }
GetOpenFile(*var, fptr);
fd = fileno(fptr->f);
GetOpenFile(val, fptr);
diff --git a/lib/telnet.rb b/lib/telnet.rb
index 098cbc9..a841803 100644
--- a/lib/telnet.rb
+++ b/lib/telnet.rb
@@ -2,7 +2,7 @@
= simple telnet cliant library
-telnet.rb ver0.162 1999/03/18
+telnet.rb ver0.163 1999/04/11
Wakou Aoyama <wakou@fsinet.or.jp>
@@ -30,6 +30,17 @@ if set "Telnetmode" option FALSE. not TELNET command interpretation.
the same character as "Prompt" is included in the data, and, when
the network or the host is very heavy, the value is enlarged.
+=== status output
+
+ host = Telnet.new({"Hosh" => "localhost"){|c| print c }
+
+connection status output.
+
+example
+
+Trying localhost...
+Connected to localhost.
+
== waitfor (wait for match)
@@ -133,6 +144,9 @@ of cource, set sync=TRUE or flush is necessary.
= history
+ver0.163 1999/04/11
+STDOUT.write(message) --> yield(message) if iterator?
+
ver0.162 1999/03/17
add "Proxy" option
required timeout.rb
@@ -291,7 +305,7 @@ class Telnet < SimpleDelegator
end
else
message = "Trying " + @options["Host"] + "...\n"
- STDOUT.write(message)
+ yield(message) if iterator?
@log.write(message) if @options.include?("Output_log")
@dumplog.write(message) if @options.include?("Dump_log")
@@ -310,7 +324,7 @@ class Telnet < SimpleDelegator
@sock.binmode
message = "Connected to " + @options["Host"] + ".\n"
- STDOUT.write(message)
+ yield(message) if iterator?
@log.write(message) if @options.include?("Output_log")
@dumplog.write(message) if @options.include?("Dump_log")
end
diff --git a/lib/thread.rb b/lib/thread.rb
index 4e6d765..936768f 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -120,6 +120,7 @@ class Queue
Thread.critical = false
t.run if t
end
+ alias enq push
def pop non_block=false
Thread.critical = true
@@ -139,6 +140,8 @@ class Queue
Thread.critical = false
end
end
+ alias shift pop
+ alias deq pop
def empty?
@que.length == 0
diff --git a/node.h b/node.h
index 3d6002f..d848412 100644
--- a/node.h
+++ b/node.h
@@ -144,7 +144,7 @@ typedef struct RNode {
RNODE(n)->flags=((RNODE(n)->flags&~FL_UMASK)|(((t)<<FL_USHIFT)&FL_UMASK))
#define NODE_LSHIFT (FL_USHIFT+8)
-#define NODE_LMASK ((1<<(sizeof(NODE*)*CHAR_BIT-NODE_LSHIFT))-1)
+#define NODE_LMASK (((long)1<<(sizeof(NODE*)*CHAR_BIT-NODE_LSHIFT))-1)
#define nd_line(n) (((RNODE(n))->flags>>NODE_LSHIFT)&NODE_LMASK)
#define nd_set_line(n,l) \
RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))
diff --git a/parse.c b/parse.c
index c93f781..56b85fc 100644
--- a/parse.c
+++ b/parse.c
@@ -104,7 +104,6 @@
#include "node.h"
#include "st.h"
#include <stdio.h>
-#include <string.h>
#include <errno.h>
/* hack for bison */
@@ -198,7 +197,7 @@ static NODE *cur_cref;
static void top_local_init();
static void top_local_setup();
-#line 116 "parse.y"
+#line 115 "parse.y"
typedef union {
NODE *node;
VALUE val;
@@ -418,43 +417,43 @@ static const short yyrhs[] = { -1,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 238, 247, 266, 272, 273, 277, 281, 286, 287, 288,
- 293, 299, 308, 313, 319, 325, 331, 341, 351, 358,
- 365, 373, 378, 380, 386, 393, 398, 399, 403, 407,
- 412, 417, 419, 424, 430, 436, 444, 445, 450, 451,
- 456, 460, 464, 468, 472, 477, 478, 483, 488, 492,
- 497, 501, 505, 509, 515, 519, 523, 527, 533, 537,
- 539, 540, 541, 542, 547, 553, 557, 558, 562, 563,
- 564, 565, 566, 567, 568, 569, 570, 571, 572, 573,
- 574, 575, 576, 577, 578, 579, 580, 581, 582, 583,
- 584, 585, 586, 587, 588, 590, 590, 590, 590, 591,
- 591, 591, 591, 591, 591, 591, 592, 592, 592, 592,
- 592, 592, 592, 593, 593, 593, 593, 593, 593, 593,
- 594, 594, 594, 594, 594, 594, 594, 595, 595, 595,
- 595, 595, 595, 596, 596, 598, 603, 604, 619, 634,
- 645, 656, 661, 665, 669, 673, 677, 681, 685, 689,
- 693, 697, 701, 705, 709, 713, 717, 721, 725, 729,
- 733, 737, 741, 745, 749, 753, 758, 762, 766, 770,
- 774, 778, 779, 783, 789, 794, 802, 803, 805, 810,
- 814, 818, 823, 827, 832, 837, 842, 846, 851, 856,
- 858, 864, 868, 870, 871, 873, 878, 884, 896, 901,
- 907, 921, 922, 924, 928, 933, 937, 941, 942, 946,
- 947, 948, 949, 950, 955, 963, 967, 974, 980, 986,
- 991, 995, 999, 999, 1004, 1008, 1013, 1014, 1023, 1032,
- 1041, 1049, 1057, 1065, 1073, 1093, 1097, 1107, 1115, 1122,
- 1130, 1139, 1147, 1155, 1164, 1165, 1172, 1180, 1184, 1188,
- 1192, 1197, 1198, 1199, 1201, 1202, 1204, 1205, 1214, 1215,
- 1220, 1221, 1223, 1224, 1228, 1232, 1237, 1242, 1250, 1255,
- 1262, 1266, 1270, 1274, 1275, 1277, 1287, 1292, 1298, 1304,
- 1310, 1315, 1322, 1331, 1332, 1334, 1341, 1342, 1347, 1353,
- 1354, 1356, 1363, 1365, 1366, 1371, 1372, 1376, 1378, 1379,
- 1380, 1382, 1383, 1385, 1386, 1387, 1388, 1389, 1390, 1391,
- 1392, 1393, 1394, 1396, 1401, 1402, 1404, 1408, 1412, 1416,
- 1418, 1423, 1428, 1432, 1436, 1440, 1444, 1448, 1452, 1456,
- 1460, 1465, 1472, 1480, 1487, 1492, 1497, 1504, 1509, 1513,
- 1515, 1528, 1546, 1547, 1551, 1559, 1560, 1565, 1570, 1571,
- 1572, 1574, 1575, 1577, 1578, 1580, 1581, 1583, 1584, 1586,
- 1587, 1588, 1590, 1591, 1593, 1594, 1596
+ 237, 246, 265, 271, 272, 276, 280, 285, 286, 287,
+ 292, 298, 307, 312, 318, 324, 330, 340, 350, 357,
+ 364, 372, 377, 379, 385, 392, 397, 398, 402, 406,
+ 411, 416, 418, 423, 429, 435, 443, 444, 449, 450,
+ 455, 459, 463, 467, 471, 476, 477, 482, 487, 491,
+ 496, 500, 504, 508, 514, 518, 522, 526, 532, 536,
+ 538, 539, 540, 541, 546, 552, 556, 557, 561, 562,
+ 563, 564, 565, 566, 567, 568, 569, 570, 571, 572,
+ 573, 574, 575, 576, 577, 578, 579, 580, 581, 582,
+ 583, 584, 585, 586, 587, 589, 589, 589, 589, 590,
+ 590, 590, 590, 590, 590, 590, 591, 591, 591, 591,
+ 591, 591, 591, 592, 592, 592, 592, 592, 592, 592,
+ 593, 593, 593, 593, 593, 593, 593, 594, 594, 594,
+ 594, 594, 594, 595, 595, 597, 602, 603, 618, 633,
+ 644, 655, 660, 664, 668, 672, 676, 680, 684, 688,
+ 692, 696, 700, 704, 708, 712, 716, 720, 724, 728,
+ 732, 736, 740, 744, 748, 752, 757, 761, 765, 769,
+ 773, 777, 778, 782, 788, 793, 801, 802, 804, 809,
+ 813, 817, 822, 826, 831, 836, 841, 845, 850, 855,
+ 857, 863, 867, 869, 870, 872, 877, 883, 895, 900,
+ 906, 920, 921, 923, 927, 932, 936, 940, 941, 945,
+ 946, 947, 948, 949, 954, 962, 966, 973, 979, 985,
+ 990, 994, 998, 998, 1003, 1007, 1012, 1013, 1022, 1031,
+ 1040, 1048, 1056, 1064, 1072, 1092, 1096, 1106, 1114, 1121,
+ 1129, 1138, 1146, 1154, 1163, 1164, 1171, 1179, 1183, 1187,
+ 1191, 1196, 1197, 1198, 1200, 1201, 1203, 1204, 1213, 1214,
+ 1219, 1220, 1222, 1223, 1227, 1231, 1236, 1241, 1249, 1254,
+ 1261, 1265, 1269, 1273, 1274, 1276, 1286, 1291, 1297, 1303,
+ 1309, 1314, 1321, 1330, 1331, 1333, 1340, 1341, 1346, 1352,
+ 1353, 1355, 1362, 1364, 1365, 1370, 1371, 1375, 1377, 1378,
+ 1379, 1381, 1382, 1384, 1385, 1386, 1387, 1388, 1389, 1390,
+ 1391, 1392, 1393, 1395, 1400, 1401, 1403, 1407, 1411, 1415,
+ 1417, 1422, 1427, 1431, 1435, 1439, 1443, 1447, 1451, 1455,
+ 1459, 1464, 1471, 1479, 1486, 1491, 1496, 1503, 1508, 1512,
+ 1514, 1527, 1545, 1546, 1550, 1558, 1559, 1564, 1569, 1570,
+ 1571, 1573, 1574, 1576, 1577, 1579, 1580, 1582, 1583, 1585,
+ 1586, 1587, 1589, 1590, 1592, 1593, 1595
};
#endif
@@ -2619,7 +2618,7 @@ yyreduce:
switch (yyn) {
case 1:
-#line 238 "parse.y"
+#line 237 "parse.y"
{
yyval.vars = ruby_dyna_vars;
lex_state = EXPR_BEG;
@@ -2630,7 +2629,7 @@ case 1:
;
break;}
case 2:
-#line 247 "parse.y"
+#line 246 "parse.y"
{
if (yyvsp[0].node && !compile_for_eval) {
/* last expression should not be void */
@@ -2651,36 +2650,36 @@ case 2:
;
break;}
case 3:
-#line 267 "parse.y"
+#line 266 "parse.y"
{
void_stmts(yyvsp[-1].node);
yyval.node = yyvsp[-1].node;
;
break;}
case 5:
-#line 274 "parse.y"
+#line 273 "parse.y"
{
yyval.node = newline_node(yyvsp[0].node);
;
break;}
case 6:
-#line 278 "parse.y"
+#line 277 "parse.y"
{
yyval.node = block_append(yyvsp[-2].node, newline_node(yyvsp[0].node));
;
break;}
case 7:
-#line 282 "parse.y"
+#line 281 "parse.y"
{
yyval.node = yyvsp[0].node;
;
break;}
case 9:
-#line 287 "parse.y"
+#line 286 "parse.y"
{lex_state = EXPR_FNAME;;
break;}
case 10:
-#line 288 "parse.y"
+#line 287 "parse.y"
{
if (cur_mid || in_single)
yyerror("alias within method");
@@ -2688,7 +2687,7 @@ case 10:
;
break;}
case 11:
-#line 294 "parse.y"
+#line 293 "parse.y"
{
if (cur_mid || in_single)
yyerror("alias within method");
@@ -2696,7 +2695,7 @@ case 11:
;
break;}
case 12:
-#line 300 "parse.y"
+#line 299 "parse.y"
{
char buf[3];
@@ -2707,14 +2706,14 @@ case 12:
;
break;}
case 13:
-#line 309 "parse.y"
+#line 308 "parse.y"
{
yyerror("can't make alias for the number variables");
yyval.node = 0;
;
break;}
case 14:
-#line 314 "parse.y"
+#line 313 "parse.y"
{
if (cur_mid || in_single)
yyerror("undef within method");
@@ -2722,7 +2721,7 @@ case 14:
;
break;}
case 15:
-#line 320 "parse.y"
+#line 319 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_IF(cond(yyvsp[0].node), yyvsp[-2].node, 0);
@@ -2730,7 +2729,7 @@ case 15:
;
break;}
case 16:
-#line 326 "parse.y"
+#line 325 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_UNLESS(cond(yyvsp[0].node), yyvsp[-2].node, 0);
@@ -2738,7 +2737,7 @@ case 16:
;
break;}
case 17:
-#line 332 "parse.y"
+#line 331 "parse.y"
{
value_expr(yyvsp[0].node);
if (nd_type(yyvsp[-2].node) == NODE_BEGIN) {
@@ -2750,7 +2749,7 @@ case 17:
;
break;}
case 18:
-#line 342 "parse.y"
+#line 341 "parse.y"
{
value_expr(yyvsp[0].node);
if (nd_type(yyvsp[-2].node) == NODE_BEGIN) {
@@ -2762,7 +2761,7 @@ case 18:
;
break;}
case 19:
-#line 352 "parse.y"
+#line 351 "parse.y"
{
if (cur_mid || in_single) {
yyerror("BEGIN in method");
@@ -2771,7 +2770,7 @@ case 19:
;
break;}
case 20:
-#line 359 "parse.y"
+#line 358 "parse.y"
{
ruby_eval_tree_begin = block_append(ruby_eval_tree_begin,
NEW_PREEXE(yyvsp[-1].node));
@@ -2780,7 +2779,7 @@ case 20:
;
break;}
case 21:
-#line 366 "parse.y"
+#line 365 "parse.y"
{
if (compile_for_eval && (cur_mid || in_single)) {
yyerror("END in method; use at_exit");
@@ -2790,14 +2789,14 @@ case 21:
;
break;}
case 22:
-#line 374 "parse.y"
+#line 373 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = node_assign(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 24:
-#line 381 "parse.y"
+#line 380 "parse.y"
{
value_expr(yyvsp[0].node);
yyvsp[-2].node->nd_value = yyvsp[0].node;
@@ -2805,7 +2804,7 @@ case 24:
;
break;}
case 25:
-#line 387 "parse.y"
+#line 386 "parse.y"
{
value_expr(yyvsp[0].node);
if (!compile_for_eval && !cur_mid && !in_single)
@@ -2814,47 +2813,47 @@ case 25:
;
break;}
case 26:
-#line 394 "parse.y"
+#line 393 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_YIELD(yyvsp[0].node);
;
break;}
case 28:
-#line 400 "parse.y"
+#line 399 "parse.y"
{
yyval.node = logop(NODE_AND, yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 29:
-#line 404 "parse.y"
+#line 403 "parse.y"
{
yyval.node = logop(NODE_OR, yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 30:
-#line 408 "parse.y"
+#line 407 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_NOT(cond(yyvsp[0].node));
;
break;}
case 31:
-#line 413 "parse.y"
+#line 412 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_NOT(cond(yyvsp[0].node));
;
break;}
case 33:
-#line 420 "parse.y"
+#line 419 "parse.y"
{
yyval.node = new_fcall(yyvsp[-1].id, yyvsp[0].node);
fixpos(yyval.node, yyvsp[0].node);
;
break;}
case 34:
-#line 425 "parse.y"
+#line 424 "parse.y"
{
value_expr(yyvsp[-3].node);
yyval.node = new_call(yyvsp[-3].node, yyvsp[-1].id, yyvsp[0].node);
@@ -2862,7 +2861,7 @@ case 34:
;
break;}
case 35:
-#line 431 "parse.y"
+#line 430 "parse.y"
{
value_expr(yyvsp[-3].node);
yyval.node = new_call(yyvsp[-3].node, yyvsp[-1].id, yyvsp[0].node);
@@ -2870,7 +2869,7 @@ case 35:
;
break;}
case 36:
-#line 437 "parse.y"
+#line 436 "parse.y"
{
if (!compile_for_eval && !cur_mid && !in_single)
yyerror("super called outside of method");
@@ -2879,278 +2878,278 @@ case 36:
;
break;}
case 38:
-#line 446 "parse.y"
+#line 445 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 40:
-#line 452 "parse.y"
+#line 451 "parse.y"
{
yyval.node = NEW_MASGN(NEW_LIST(yyvsp[-1].node), 0);
;
break;}
case 41:
-#line 457 "parse.y"
+#line 456 "parse.y"
{
yyval.node = NEW_MASGN(NEW_LIST(yyvsp[0].node), 0);
;
break;}
case 42:
-#line 461 "parse.y"
+#line 460 "parse.y"
{
yyval.node = NEW_MASGN(NEW_LIST(yyvsp[-2].node), yyvsp[0].node);
;
break;}
case 43:
-#line 465 "parse.y"
+#line 464 "parse.y"
{
yyval.node = NEW_MASGN(list_concat(NEW_LIST(yyvsp[-1].node),yyvsp[0].node), 0);
;
break;}
case 44:
-#line 469 "parse.y"
+#line 468 "parse.y"
{
yyval.node = NEW_MASGN(list_concat(NEW_LIST(yyvsp[-4].node),yyvsp[-3].node),yyvsp[0].node);
;
break;}
case 45:
-#line 473 "parse.y"
+#line 472 "parse.y"
{
yyval.node = NEW_MASGN(0, yyvsp[0].node);
;
break;}
case 47:
-#line 479 "parse.y"
+#line 478 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 48:
-#line 484 "parse.y"
+#line 483 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 49:
-#line 489 "parse.y"
+#line 488 "parse.y"
{
yyval.node = NEW_LIST(yyvsp[0].node);
;
break;}
case 50:
-#line 493 "parse.y"
+#line 492 "parse.y"
{
yyval.node = list_append(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 51:
-#line 498 "parse.y"
+#line 497 "parse.y"
{
yyval.node = assignable(yyvsp[0].id, 0);
;
break;}
case 52:
-#line 502 "parse.y"
+#line 501 "parse.y"
{
yyval.node = aryset(yyvsp[-3].node, yyvsp[-1].node);
;
break;}
case 53:
-#line 506 "parse.y"
+#line 505 "parse.y"
{
yyval.node = attrset(yyvsp[-2].node, yyvsp[0].id);
;
break;}
case 54:
-#line 510 "parse.y"
+#line 509 "parse.y"
{
rb_backref_error(yyvsp[0].node);
yyval.node = 0;
;
break;}
case 55:
-#line 516 "parse.y"
+#line 515 "parse.y"
{
yyval.node = assignable(yyvsp[0].id, 0);
;
break;}
case 56:
-#line 520 "parse.y"
+#line 519 "parse.y"
{
yyval.node = aryset(yyvsp[-3].node, yyvsp[-1].node);
;
break;}
case 57:
-#line 524 "parse.y"
+#line 523 "parse.y"
{
yyval.node = attrset(yyvsp[-2].node, yyvsp[0].id);
;
break;}
case 58:
-#line 528 "parse.y"
+#line 527 "parse.y"
{
rb_backref_error(yyvsp[0].node);
yyval.node = 0;
;
break;}
case 59:
-#line 534 "parse.y"
+#line 533 "parse.y"
{
yyerror("class/module name must be CONSTANT");
;
break;}
case 64:
-#line 543 "parse.y"
+#line 542 "parse.y"
{
lex_state = EXPR_END;
yyval.id = yyvsp[0].id;
;
break;}
case 65:
-#line 548 "parse.y"
+#line 547 "parse.y"
{
lex_state = EXPR_END;
yyval.id = yyvsp[0].id;
;
break;}
case 66:
-#line 554 "parse.y"
+#line 553 "parse.y"
{
yyval.node = NEW_UNDEF(yyvsp[0].id);
;
break;}
case 67:
-#line 557 "parse.y"
+#line 556 "parse.y"
{lex_state = EXPR_FNAME;;
break;}
case 68:
-#line 558 "parse.y"
+#line 557 "parse.y"
{
yyval.node = block_append(yyvsp[-3].node, NEW_UNDEF(yyvsp[0].id));
;
break;}
case 69:
-#line 562 "parse.y"
+#line 561 "parse.y"
{ yyval.id = tDOT2; ;
break;}
case 70:
-#line 563 "parse.y"
+#line 562 "parse.y"
{ yyval.id = '|'; ;
break;}
case 71:
-#line 564 "parse.y"
+#line 563 "parse.y"
{ yyval.id = '^'; ;
break;}
case 72:
-#line 565 "parse.y"
+#line 564 "parse.y"
{ yyval.id = '&'; ;
break;}
case 73:
-#line 566 "parse.y"
+#line 565 "parse.y"
{ yyval.id = tCMP; ;
break;}
case 74:
-#line 567 "parse.y"
+#line 566 "parse.y"
{ yyval.id = tEQ; ;
break;}
case 75:
-#line 568 "parse.y"
+#line 567 "parse.y"
{ yyval.id = tEQQ; ;
break;}
case 76:
-#line 569 "parse.y"
+#line 568 "parse.y"
{ yyval.id = tMATCH; ;
break;}
case 77:
-#line 570 "parse.y"
+#line 569 "parse.y"
{ yyval.id = '>'; ;
break;}
case 78:
-#line 571 "parse.y"
+#line 570 "parse.y"
{ yyval.id = tGEQ; ;
break;}
case 79:
-#line 572 "parse.y"
+#line 571 "parse.y"
{ yyval.id = '<'; ;
break;}
case 80:
-#line 573 "parse.y"
+#line 572 "parse.y"
{ yyval.id = tLEQ; ;
break;}
case 81:
-#line 574 "parse.y"
+#line 573 "parse.y"
{ yyval.id = tLSHFT; ;
break;}
case 82:
-#line 575 "parse.y"
+#line 574 "parse.y"
{ yyval.id = tRSHFT; ;
break;}
case 83:
-#line 576 "parse.y"
+#line 575 "parse.y"
{ yyval.id = '+'; ;
break;}
case 84:
-#line 577 "parse.y"
+#line 576 "parse.y"
{ yyval.id = '-'; ;
break;}
case 85:
-#line 578 "parse.y"
+#line 577 "parse.y"
{ yyval.id = '*'; ;
break;}
case 86:
-#line 579 "parse.y"
+#line 578 "parse.y"
{ yyval.id = '*'; ;
break;}
case 87:
-#line 580 "parse.y"
+#line 579 "parse.y"
{ yyval.id = '/'; ;
break;}
case 88:
-#line 581 "parse.y"
+#line 580 "parse.y"
{ yyval.id = '%'; ;
break;}
case 89:
-#line 582 "parse.y"
+#line 581 "parse.y"
{ yyval.id = tPOW; ;
break;}
case 90:
-#line 583 "parse.y"
+#line 582 "parse.y"
{ yyval.id = '~'; ;
break;}
case 91:
-#line 584 "parse.y"
+#line 583 "parse.y"
{ yyval.id = tUPLUS; ;
break;}
case 92:
-#line 585 "parse.y"
+#line 584 "parse.y"
{ yyval.id = tUMINUS; ;
break;}
case 93:
-#line 586 "parse.y"
+#line 585 "parse.y"
{ yyval.id = tAREF; ;
break;}
case 94:
-#line 587 "parse.y"
+#line 586 "parse.y"
{ yyval.id = tASET; ;
break;}
case 95:
-#line 588 "parse.y"
+#line 587 "parse.y"
{ yyval.id = '`'; ;
break;}
case 136:
-#line 599 "parse.y"
+#line 598 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = node_assign(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 137:
-#line 603 "parse.y"
+#line 602 "parse.y"
{yyval.node = assignable(yyvsp[-1].id, 0);;
break;}
case 138:
-#line 604 "parse.y"
+#line 603 "parse.y"
{
if (yyvsp[-2].id == tOROP) {
yyvsp[-1].node->nd_value = yyvsp[0].node;
@@ -3168,7 +3167,7 @@ case 138:
;
break;}
case 139:
-#line 620 "parse.y"
+#line 619 "parse.y"
{
NODE *args = NEW_LIST(yyvsp[0].node);
@@ -3185,7 +3184,7 @@ case 139:
;
break;}
case 140:
-#line 635 "parse.y"
+#line 634 "parse.y"
{
if (yyvsp[-1].id == tOROP) {
yyvsp[-1].id = 0;
@@ -3198,7 +3197,7 @@ case 140:
;
break;}
case 141:
-#line 646 "parse.y"
+#line 645 "parse.y"
{
if (yyvsp[-1].id == tOROP) {
yyvsp[-1].id = 0;
@@ -3211,200 +3210,200 @@ case 141:
;
break;}
case 142:
-#line 657 "parse.y"
+#line 656 "parse.y"
{
rb_backref_error(yyvsp[-2].node);
yyval.node = 0;
;
break;}
case 143:
-#line 662 "parse.y"
+#line 661 "parse.y"
{
yyval.node = NEW_DOT2(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 144:
-#line 666 "parse.y"
+#line 665 "parse.y"
{
yyval.node = NEW_DOT3(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 145:
-#line 670 "parse.y"
+#line 669 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '+', 1, yyvsp[0].node);
;
break;}
case 146:
-#line 674 "parse.y"
+#line 673 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '-', 1, yyvsp[0].node);
;
break;}
case 147:
-#line 678 "parse.y"
+#line 677 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '*', 1, yyvsp[0].node);
;
break;}
case 148:
-#line 682 "parse.y"
+#line 681 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '/', 1, yyvsp[0].node);
;
break;}
case 149:
-#line 686 "parse.y"
+#line 685 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '%', 1, yyvsp[0].node);
;
break;}
case 150:
-#line 690 "parse.y"
+#line 689 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, tPOW, 1, yyvsp[0].node);
;
break;}
case 151:
-#line 694 "parse.y"
+#line 693 "parse.y"
{
yyval.node = call_op(yyvsp[0].node, tUPLUS, 0);
;
break;}
case 152:
-#line 698 "parse.y"
+#line 697 "parse.y"
{
yyval.node = call_op(yyvsp[0].node, tUMINUS, 0);
;
break;}
case 153:
-#line 702 "parse.y"
+#line 701 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '|', 1, yyvsp[0].node);
;
break;}
case 154:
-#line 706 "parse.y"
+#line 705 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '^', 1, yyvsp[0].node);
;
break;}
case 155:
-#line 710 "parse.y"
+#line 709 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '&', 1, yyvsp[0].node);
;
break;}
case 156:
-#line 714 "parse.y"
+#line 713 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, tCMP, 1, yyvsp[0].node);
;
break;}
case 157:
-#line 718 "parse.y"
+#line 717 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '>', 1, yyvsp[0].node);
;
break;}
case 158:
-#line 722 "parse.y"
+#line 721 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, tGEQ, 1, yyvsp[0].node);
;
break;}
case 159:
-#line 726 "parse.y"
+#line 725 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, '<', 1, yyvsp[0].node);
;
break;}
case 160:
-#line 730 "parse.y"
+#line 729 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, tLEQ, 1, yyvsp[0].node);
;
break;}
case 161:
-#line 734 "parse.y"
+#line 733 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, tEQ, 1, yyvsp[0].node);
;
break;}
case 162:
-#line 738 "parse.y"
+#line 737 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, tEQQ, 1, yyvsp[0].node);
;
break;}
case 163:
-#line 742 "parse.y"
+#line 741 "parse.y"
{
yyval.node = NEW_NOT(call_op(yyvsp[-2].node, tEQ, 1, yyvsp[0].node));
;
break;}
case 164:
-#line 746 "parse.y"
+#line 745 "parse.y"
{
yyval.node = match_gen(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 165:
-#line 750 "parse.y"
+#line 749 "parse.y"
{
yyval.node = NEW_NOT(match_gen(yyvsp[-2].node, yyvsp[0].node));
;
break;}
case 166:
-#line 754 "parse.y"
+#line 753 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_NOT(cond(yyvsp[0].node));
;
break;}
case 167:
-#line 759 "parse.y"
+#line 758 "parse.y"
{
yyval.node = call_op(yyvsp[0].node, '~', 0);
;
break;}
case 168:
-#line 763 "parse.y"
+#line 762 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, tLSHFT, 1, yyvsp[0].node);
;
break;}
case 169:
-#line 767 "parse.y"
+#line 766 "parse.y"
{
yyval.node = call_op(yyvsp[-2].node, tRSHFT, 1, yyvsp[0].node);
;
break;}
case 170:
-#line 771 "parse.y"
+#line 770 "parse.y"
{
yyval.node = logop(NODE_AND, yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 171:
-#line 775 "parse.y"
+#line 774 "parse.y"
{
yyval.node = logop(NODE_OR, yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 172:
-#line 778 "parse.y"
+#line 777 "parse.y"
{in_defined = 1;;
break;}
case 173:
-#line 779 "parse.y"
+#line 778 "parse.y"
{
in_defined = 0;
yyval.node = NEW_DEFINED(yyvsp[0].node);
;
break;}
case 174:
-#line 784 "parse.y"
+#line 783 "parse.y"
{
value_expr(yyvsp[-4].node);
yyval.node = NEW_IF(cond(yyvsp[-4].node), yyvsp[-2].node, yyvsp[0].node);
@@ -3412,13 +3411,13 @@ case 174:
;
break;}
case 175:
-#line 790 "parse.y"
+#line 789 "parse.y"
{
yyval.node = yyvsp[0].node;
;
break;}
case 176:
-#line 795 "parse.y"
+#line 794 "parse.y"
{
if (yyvsp[0].node && nd_type(yyvsp[0].node) == NODE_BLOCK_PASS) {
rb_compile_error("block argument should not be given");
@@ -3427,107 +3426,107 @@ case 176:
;
break;}
case 179:
-#line 806 "parse.y"
+#line 805 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_LIST(yyvsp[0].node);
;
break;}
case 180:
-#line 811 "parse.y"
+#line 810 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 181:
-#line 815 "parse.y"
+#line 814 "parse.y"
{
yyval.node = arg_blk_pass(yyvsp[-1].node, yyvsp[0].node);
;
break;}
case 182:
-#line 819 "parse.y"
+#line 818 "parse.y"
{
yyval.node = arg_concat(yyvsp[-4].node, yyvsp[-1].node);
yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
;
break;}
case 183:
-#line 824 "parse.y"
+#line 823 "parse.y"
{
yyval.node = NEW_LIST(NEW_HASH(yyvsp[-1].node));
;
break;}
case 184:
-#line 828 "parse.y"
+#line 827 "parse.y"
{
yyval.node = NEW_LIST(NEW_HASH(yyvsp[-1].node));
yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
;
break;}
case 185:
-#line 833 "parse.y"
+#line 832 "parse.y"
{
yyval.node = arg_concat(NEW_LIST(NEW_HASH(yyvsp[-4].node)), yyvsp[-1].node);
yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
;
break;}
case 186:
-#line 838 "parse.y"
+#line 837 "parse.y"
{
yyval.node = list_append(yyvsp[-3].node, NEW_HASH(yyvsp[-1].node));
yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
;
break;}
case 187:
-#line 843 "parse.y"
+#line 842 "parse.y"
{
yyval.node = list_append(yyvsp[-3].node, NEW_HASH(yyvsp[-1].node));
;
break;}
case 188:
-#line 847 "parse.y"
+#line 846 "parse.y"
{
yyval.node = arg_concat(list_append(yyvsp[-6].node, NEW_HASH(yyvsp[-4].node)), yyvsp[-1].node);
yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
;
break;}
case 189:
-#line 852 "parse.y"
+#line 851 "parse.y"
{
value_expr(yyvsp[-1].node);
yyval.node = arg_blk_pass(NEW_RESTARGS(yyvsp[-1].node), yyvsp[0].node);
;
break;}
case 191:
-#line 859 "parse.y"
+#line 858 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_BLOCK_PASS(yyvsp[0].node);
;
break;}
case 192:
-#line 865 "parse.y"
+#line 864 "parse.y"
{
yyval.node = yyvsp[0].node;
;
break;}
case 196:
-#line 874 "parse.y"
+#line 873 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_LIST(yyvsp[0].node);
;
break;}
case 197:
-#line 879 "parse.y"
+#line 878 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = list_append(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 198:
-#line 885 "parse.y"
+#line 884 "parse.y"
{
if (yyvsp[0].node &&
nd_type(yyvsp[0].node) == NODE_ARRAY &&
@@ -3541,21 +3540,21 @@ case 198:
;
break;}
case 199:
-#line 897 "parse.y"
+#line 896 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = arg_concat(yyvsp[-3].node, yyvsp[0].node);
;
break;}
case 200:
-#line 902 "parse.y"
+#line 901 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = yyvsp[0].node;
;
break;}
case 201:
-#line 908 "parse.y"
+#line 907 "parse.y"
{
yyval.node = yyvsp[0].node;
if (yyvsp[0].node) {
@@ -3570,45 +3569,45 @@ case 201:
;
break;}
case 204:
-#line 925 "parse.y"
+#line 924 "parse.y"
{
yyval.node = NEW_LIT(yyvsp[0].val);
;
break;}
case 205:
-#line 929 "parse.y"
+#line 928 "parse.y"
{
value_expr(yyvsp[-2].node);
yyval.node = NEW_COLON2(yyvsp[-2].node, yyvsp[0].id);
;
break;}
case 206:
-#line 934 "parse.y"
+#line 933 "parse.y"
{
yyval.node = NEW_COLON3(yyvsp[0].id);
;
break;}
case 207:
-#line 938 "parse.y"
+#line 937 "parse.y"
{
yyval.node = NEW_STR(yyvsp[0].val);
;
break;}
case 209:
-#line 943 "parse.y"
+#line 942 "parse.y"
{
yyval.node = NEW_XSTR(yyvsp[0].val);
;
break;}
case 214:
-#line 951 "parse.y"
+#line 950 "parse.y"
{
value_expr(yyvsp[-3].node);
yyval.node = NEW_CALL(yyvsp[-3].node, tAREF, yyvsp[-1].node);
;
break;}
case 215:
-#line 956 "parse.y"
+#line 955 "parse.y"
{
if (yyvsp[-1].node == 0)
yyval.node = NEW_ZARRAY(); /* zero length array*/
@@ -3618,13 +3617,13 @@ case 215:
;
break;}
case 216:
-#line 964 "parse.y"
+#line 963 "parse.y"
{
yyval.node = NEW_HASH(yyvsp[-1].node);
;
break;}
case 217:
-#line 968 "parse.y"
+#line 967 "parse.y"
{
if (!compile_for_eval && !cur_mid && !in_single)
yyerror("return appeared outside of method");
@@ -3633,7 +3632,7 @@ case 217:
;
break;}
case 218:
-#line 975 "parse.y"
+#line 974 "parse.y"
{
if (!compile_for_eval && !cur_mid && !in_single)
yyerror("return appeared outside of method");
@@ -3641,7 +3640,7 @@ case 218:
;
break;}
case 219:
-#line 981 "parse.y"
+#line 980 "parse.y"
{
if (!compile_for_eval && !cur_mid && !in_single)
yyerror("return appeared outside of method");
@@ -3649,50 +3648,50 @@ case 219:
;
break;}
case 220:
-#line 987 "parse.y"
+#line 986 "parse.y"
{
value_expr(yyvsp[-1].node);
yyval.node = NEW_YIELD(yyvsp[-1].node);
;
break;}
case 221:
-#line 992 "parse.y"
+#line 991 "parse.y"
{
yyval.node = NEW_YIELD(0);
;
break;}
case 222:
-#line 996 "parse.y"
+#line 995 "parse.y"
{
yyval.node = NEW_YIELD(0);
;
break;}
case 223:
-#line 999 "parse.y"
+#line 998 "parse.y"
{in_defined = 1;;
break;}
case 224:
-#line 1000 "parse.y"
+#line 999 "parse.y"
{
in_defined = 0;
yyval.node = NEW_DEFINED(yyvsp[-1].node);
;
break;}
case 225:
-#line 1005 "parse.y"
+#line 1004 "parse.y"
{
yyval.node = NEW_VCALL(yyvsp[0].id);
;
break;}
case 226:
-#line 1009 "parse.y"
+#line 1008 "parse.y"
{
yyvsp[0].node->nd_iter = NEW_FCALL(yyvsp[-1].id, 0);
yyval.node = yyvsp[0].node;
;
break;}
case 228:
-#line 1015 "parse.y"
+#line 1014 "parse.y"
{
if (yyvsp[-1].node && nd_type(yyvsp[-1].node) == NODE_BLOCK_PASS) {
rb_compile_error("both block arg and actual block given");
@@ -3703,7 +3702,7 @@ case 228:
;
break;}
case 229:
-#line 1027 "parse.y"
+#line 1026 "parse.y"
{
value_expr(yyvsp[-4].node);
yyval.node = NEW_IF(cond(yyvsp[-4].node), yyvsp[-2].node, yyvsp[-1].node);
@@ -3711,7 +3710,7 @@ case 229:
;
break;}
case 230:
-#line 1036 "parse.y"
+#line 1035 "parse.y"
{
value_expr(yyvsp[-4].node);
yyval.node = NEW_UNLESS(cond(yyvsp[-4].node), yyvsp[-2].node, yyvsp[-1].node);
@@ -3719,7 +3718,7 @@ case 230:
;
break;}
case 231:
-#line 1044 "parse.y"
+#line 1043 "parse.y"
{
value_expr(yyvsp[-3].node);
yyval.node = NEW_WHILE(cond(yyvsp[-3].node), yyvsp[-1].node, 1);
@@ -3727,7 +3726,7 @@ case 231:
;
break;}
case 232:
-#line 1052 "parse.y"
+#line 1051 "parse.y"
{
value_expr(yyvsp[-3].node);
yyval.node = NEW_UNTIL(cond(yyvsp[-3].node), yyvsp[-1].node, 1);
@@ -3735,7 +3734,7 @@ case 232:
;
break;}
case 233:
-#line 1060 "parse.y"
+#line 1059 "parse.y"
{
value_expr(yyvsp[-2].node);
yyval.node = NEW_CASE(yyvsp[-2].node, yyvsp[-1].node);
@@ -3743,7 +3742,7 @@ case 233:
;
break;}
case 234:
-#line 1068 "parse.y"
+#line 1067 "parse.y"
{
value_expr(yyvsp[-5].node);
yyval.node = NEW_FOR(yyvsp[-5].node, yyvsp[-3].node, yyvsp[-1].node);
@@ -3751,7 +3750,7 @@ case 234:
;
break;}
case 235:
-#line 1079 "parse.y"
+#line 1078 "parse.y"
{
if (!yyvsp[-3].node && !yyvsp[-2].node && !yyvsp[-1].node)
yyval.node = NEW_BEGIN(yyvsp[-4].node);
@@ -3768,13 +3767,13 @@ case 235:
;
break;}
case 236:
-#line 1094 "parse.y"
+#line 1093 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 237:
-#line 1098 "parse.y"
+#line 1097 "parse.y"
{
if (cur_mid || in_single)
yyerror("class definition in method body");
@@ -3785,7 +3784,7 @@ case 237:
;
break;}
case 238:
-#line 1108 "parse.y"
+#line 1107 "parse.y"
{
yyval.node = NEW_CLASS(yyvsp[-4].id, yyvsp[-1].node, yyvsp[-3].node);
fixpos(yyval.node, yyvsp[-3].node);
@@ -3795,7 +3794,7 @@ case 238:
;
break;}
case 239:
-#line 1116 "parse.y"
+#line 1115 "parse.y"
{
class_nest++;
cref_push();
@@ -3803,7 +3802,7 @@ case 239:
;
break;}
case 240:
-#line 1123 "parse.y"
+#line 1122 "parse.y"
{
yyval.node = NEW_SCLASS(yyvsp[-4].node, yyvsp[-1].node);
fixpos(yyval.node, yyvsp[-4].node);
@@ -3813,7 +3812,7 @@ case 240:
;
break;}
case 241:
-#line 1131 "parse.y"
+#line 1130 "parse.y"
{
if (cur_mid || in_single)
yyerror("module definition in method body");
@@ -3823,7 +3822,7 @@ case 241:
;
break;}
case 242:
-#line 1140 "parse.y"
+#line 1139 "parse.y"
{
yyval.node = NEW_MODULE(yyvsp[-3].id, yyvsp[-1].node);
fixpos(yyval.node, yyvsp[-1].node);
@@ -3833,7 +3832,7 @@ case 242:
;
break;}
case 243:
-#line 1148 "parse.y"
+#line 1147 "parse.y"
{
if (cur_mid || in_single)
yyerror("nested method definition");
@@ -3842,7 +3841,7 @@ case 243:
;
break;}
case 244:
-#line 1157 "parse.y"
+#line 1156 "parse.y"
{
/* NOEX_PRIVATE for toplevel */
yyval.node = NEW_DEFN(yyvsp[-4].id, yyvsp[-2].node, yyvsp[-1].node, class_nest?0:1);
@@ -3852,11 +3851,11 @@ case 244:
;
break;}
case 245:
-#line 1164 "parse.y"
+#line 1163 "parse.y"
{lex_state = EXPR_FNAME;;
break;}
case 246:
-#line 1165 "parse.y"
+#line 1164 "parse.y"
{
value_expr(yyvsp[-3].node);
in_single++;
@@ -3865,7 +3864,7 @@ case 246:
;
break;}
case 247:
-#line 1174 "parse.y"
+#line 1173 "parse.y"
{
yyval.node = NEW_DEFS(yyvsp[-7].node, yyvsp[-4].id, yyvsp[-2].node, yyvsp[-1].node);
fixpos(yyval.node, yyvsp[-7].node);
@@ -3874,31 +3873,31 @@ case 247:
;
break;}
case 248:
-#line 1181 "parse.y"
+#line 1180 "parse.y"
{
yyval.node = NEW_BREAK();
;
break;}
case 249:
-#line 1185 "parse.y"
+#line 1184 "parse.y"
{
yyval.node = NEW_NEXT();
;
break;}
case 250:
-#line 1189 "parse.y"
+#line 1188 "parse.y"
{
yyval.node = NEW_REDO();
;
break;}
case 251:
-#line 1193 "parse.y"
+#line 1192 "parse.y"
{
yyval.node = NEW_RETRY();
;
break;}
case 258:
-#line 1208 "parse.y"
+#line 1207 "parse.y"
{
value_expr(yyvsp[-3].node);
yyval.node = NEW_IF(cond(yyvsp[-3].node), yyvsp[-1].node, yyvsp[0].node);
@@ -3906,37 +3905,37 @@ case 258:
;
break;}
case 260:
-#line 1216 "parse.y"
+#line 1215 "parse.y"
{
yyval.node = yyvsp[0].node;
;
break;}
case 264:
-#line 1225 "parse.y"
+#line 1224 "parse.y"
{
yyval.node = 0;
;
break;}
case 265:
-#line 1229 "parse.y"
+#line 1228 "parse.y"
{
yyval.node = 0;
;
break;}
case 266:
-#line 1233 "parse.y"
+#line 1232 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 267:
-#line 1238 "parse.y"
+#line 1237 "parse.y"
{
yyval.vars = dyna_push();
;
break;}
case 268:
-#line 1244 "parse.y"
+#line 1243 "parse.y"
{
yyval.node = NEW_ITER(yyvsp[-2].node, 0, yyvsp[-1].node);
fixpos(yyval.node, yyvsp[-2].node?yyvsp[-2].node:yyvsp[-1].node);
@@ -3944,13 +3943,13 @@ case 268:
;
break;}
case 269:
-#line 1251 "parse.y"
+#line 1250 "parse.y"
{
yyval.vars = dyna_push();
;
break;}
case 270:
-#line 1256 "parse.y"
+#line 1255 "parse.y"
{
yyval.node = NEW_ITER(yyvsp[-2].node, 0, yyvsp[-1].node);
fixpos(yyval.node, yyvsp[-2].node?yyvsp[-2].node:yyvsp[-1].node);
@@ -3958,25 +3957,25 @@ case 270:
;
break;}
case 271:
-#line 1263 "parse.y"
+#line 1262 "parse.y"
{
yyval.node = NEW_VCALL(yyvsp[0].id);
;
break;}
case 272:
-#line 1267 "parse.y"
+#line 1266 "parse.y"
{
yyval.node = NEW_VCALL(yyvsp[0].id);
;
break;}
case 273:
-#line 1271 "parse.y"
+#line 1270 "parse.y"
{
yyval.node = NEW_VCALL(yyvsp[0].id);
;
break;}
case 276:
-#line 1278 "parse.y"
+#line 1277 "parse.y"
{
if (yyvsp[-1].node && nd_type(yyvsp[-1].node) == NODE_BLOCK_PASS) {
rb_compile_error("both block arg and actual block given");
@@ -3987,14 +3986,14 @@ case 276:
;
break;}
case 277:
-#line 1288 "parse.y"
+#line 1287 "parse.y"
{
yyval.node = new_fcall(yyvsp[-3].id, yyvsp[-1].node);
fixpos(yyval.node, yyvsp[-1].node);
;
break;}
case 278:
-#line 1293 "parse.y"
+#line 1292 "parse.y"
{
value_expr(yyvsp[-5].node);
yyval.node = new_call(yyvsp[-5].node, yyvsp[-3].id, yyvsp[-1].node);
@@ -4002,7 +4001,7 @@ case 278:
;
break;}
case 279:
-#line 1299 "parse.y"
+#line 1298 "parse.y"
{
value_expr(yyvsp[-2].node);
yyval.node = new_call(yyvsp[-2].node, yyvsp[0].id, 0);
@@ -4010,7 +4009,7 @@ case 279:
;
break;}
case 280:
-#line 1305 "parse.y"
+#line 1304 "parse.y"
{
value_expr(yyvsp[-5].node);
yyval.node = new_call(yyvsp[-5].node, yyvsp[-3].id, yyvsp[-1].node);
@@ -4018,14 +4017,14 @@ case 280:
;
break;}
case 281:
-#line 1311 "parse.y"
+#line 1310 "parse.y"
{
value_expr(yyvsp[-2].node);
yyval.node = new_call(yyvsp[-2].node, yyvsp[0].id, 0);
;
break;}
case 282:
-#line 1316 "parse.y"
+#line 1315 "parse.y"
{
if (!compile_for_eval && !cur_mid &&
!in_single && !in_defined)
@@ -4034,7 +4033,7 @@ case 282:
;
break;}
case 283:
-#line 1323 "parse.y"
+#line 1322 "parse.y"
{
if (!compile_for_eval && !cur_mid &&
!in_single && !in_defined)
@@ -4043,165 +4042,165 @@ case 283:
;
break;}
case 286:
-#line 1337 "parse.y"
+#line 1336 "parse.y"
{
yyval.node = NEW_WHEN(yyvsp[-3].node, yyvsp[-1].node, yyvsp[0].node);
;
break;}
case 288:
-#line 1343 "parse.y"
+#line 1342 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = list_append(yyvsp[-3].node, NEW_WHEN(yyvsp[0].node, 0, 0));
;
break;}
case 289:
-#line 1348 "parse.y"
+#line 1347 "parse.y"
{
value_expr(yyvsp[0].node);
yyval.node = NEW_LIST(NEW_WHEN(yyvsp[0].node, 0, 0));
;
break;}
case 292:
-#line 1359 "parse.y"
+#line 1358 "parse.y"
{
yyval.node = NEW_RESBODY(yyvsp[-3].node, yyvsp[-1].node, yyvsp[0].node);
fixpos(yyval.node, yyvsp[-3].node?yyvsp[-3].node:yyvsp[-1].node);
;
break;}
case 295:
-#line 1367 "parse.y"
+#line 1366 "parse.y"
{
yyval.node = yyvsp[0].node;
;
break;}
case 297:
-#line 1373 "parse.y"
+#line 1372 "parse.y"
{
yyval.val = INT2FIX(yyvsp[0].id);
;
break;}
case 308:
-#line 1389 "parse.y"
+#line 1388 "parse.y"
{yyval.id = kNIL;;
break;}
case 309:
-#line 1390 "parse.y"
+#line 1389 "parse.y"
{yyval.id = kSELF;;
break;}
case 310:
-#line 1391 "parse.y"
+#line 1390 "parse.y"
{yyval.id = kTRUE;;
break;}
case 311:
-#line 1392 "parse.y"
+#line 1391 "parse.y"
{yyval.id = kFALSE;;
break;}
case 312:
-#line 1393 "parse.y"
+#line 1392 "parse.y"
{yyval.id = k__FILE__;;
break;}
case 313:
-#line 1394 "parse.y"
+#line 1393 "parse.y"
{yyval.id = k__LINE__;;
break;}
case 314:
-#line 1397 "parse.y"
+#line 1396 "parse.y"
{
yyval.node = gettable(yyvsp[0].id);
;
break;}
case 317:
-#line 1405 "parse.y"
+#line 1404 "parse.y"
{
yyval.node = 0;
;
break;}
case 318:
-#line 1409 "parse.y"
+#line 1408 "parse.y"
{
lex_state = EXPR_BEG;
;
break;}
case 319:
-#line 1413 "parse.y"
+#line 1412 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 320:
-#line 1416 "parse.y"
+#line 1415 "parse.y"
{yyerrok; yyval.node = 0;;
break;}
case 321:
-#line 1419 "parse.y"
+#line 1418 "parse.y"
{
yyval.node = yyvsp[-2].node;
lex_state = EXPR_BEG;
;
break;}
case 322:
-#line 1424 "parse.y"
+#line 1423 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 323:
-#line 1429 "parse.y"
+#line 1428 "parse.y"
{
yyval.node = block_append(NEW_ARGS(yyvsp[-5].num, yyvsp[-3].node, yyvsp[-1].id), yyvsp[0].node);
;
break;}
case 324:
-#line 1433 "parse.y"
+#line 1432 "parse.y"
{
yyval.node = block_append(NEW_ARGS(yyvsp[-3].num, yyvsp[-1].node, -1), yyvsp[0].node);
;
break;}
case 325:
-#line 1437 "parse.y"
+#line 1436 "parse.y"
{
yyval.node = block_append(NEW_ARGS(yyvsp[-3].num, 0, yyvsp[-1].id), yyvsp[0].node);
;
break;}
case 326:
-#line 1441 "parse.y"
+#line 1440 "parse.y"
{
yyval.node = block_append(NEW_ARGS(yyvsp[-1].num, 0, -1), yyvsp[0].node);
;
break;}
case 327:
-#line 1445 "parse.y"
+#line 1444 "parse.y"
{
yyval.node = block_append(NEW_ARGS(0, yyvsp[-3].node, yyvsp[-1].id), yyvsp[0].node);
;
break;}
case 328:
-#line 1449 "parse.y"
+#line 1448 "parse.y"
{
yyval.node = block_append(NEW_ARGS(0, yyvsp[-1].node, -1), yyvsp[0].node);
;
break;}
case 329:
-#line 1453 "parse.y"
+#line 1452 "parse.y"
{
yyval.node = block_append(NEW_ARGS(0, 0, yyvsp[-1].id), yyvsp[0].node);
;
break;}
case 330:
-#line 1457 "parse.y"
+#line 1456 "parse.y"
{
yyval.node = block_append(NEW_ARGS(0, 0, -1), yyvsp[0].node);
;
break;}
case 331:
-#line 1461 "parse.y"
+#line 1460 "parse.y"
{
yyval.node = NEW_ARGS(0, 0, -1);
;
break;}
case 332:
-#line 1466 "parse.y"
+#line 1465 "parse.y"
{
if (!is_local_id(yyvsp[0].id))
yyerror("formal argument must be local variable");
@@ -4210,7 +4209,7 @@ case 332:
;
break;}
case 333:
-#line 1473 "parse.y"
+#line 1472 "parse.y"
{
if (!is_local_id(yyvsp[0].id))
yyerror("formal argument must be local variable");
@@ -4219,7 +4218,7 @@ case 333:
;
break;}
case 334:
-#line 1481 "parse.y"
+#line 1480 "parse.y"
{
if (!is_local_id(yyvsp[-2].id))
yyerror("formal argument must be local variable");
@@ -4227,20 +4226,20 @@ case 334:
;
break;}
case 335:
-#line 1488 "parse.y"
+#line 1487 "parse.y"
{
yyval.node = NEW_BLOCK(yyvsp[0].node);
yyval.node->nd_end = yyval.node;
;
break;}
case 336:
-#line 1493 "parse.y"
+#line 1492 "parse.y"
{
yyval.node = block_append(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 337:
-#line 1498 "parse.y"
+#line 1497 "parse.y"
{
if (!is_local_id(yyvsp[0].id))
yyerror("rest argument must be local variable");
@@ -4248,19 +4247,19 @@ case 337:
;
break;}
case 338:
-#line 1505 "parse.y"
+#line 1504 "parse.y"
{
yyval.node = NEW_BLOCK_ARG(yyvsp[0].id);
;
break;}
case 339:
-#line 1510 "parse.y"
+#line 1509 "parse.y"
{
yyval.node = yyvsp[0].node;
;
break;}
case 341:
-#line 1516 "parse.y"
+#line 1515 "parse.y"
{
if (nd_type(yyvsp[0].node) == NODE_SELF) {
yyval.node = NEW_SELF();
@@ -4275,7 +4274,7 @@ case 341:
;
break;}
case 342:
-#line 1529 "parse.y"
+#line 1528 "parse.y"
{
switch (nd_type(yyvsp[-2].node)) {
case NODE_STR:
@@ -4294,13 +4293,13 @@ case 342:
;
break;}
case 344:
-#line 1548 "parse.y"
+#line 1547 "parse.y"
{
yyval.node = yyvsp[-1].node;
;
break;}
case 345:
-#line 1552 "parse.y"
+#line 1551 "parse.y"
{
if (yyvsp[-1].node->nd_alen%2 != 0) {
yyerror("odd number list for Hash");
@@ -4309,27 +4308,27 @@ case 345:
;
break;}
case 347:
-#line 1561 "parse.y"
+#line 1560 "parse.y"
{
yyval.node = list_concat(yyvsp[-2].node, yyvsp[0].node);
;
break;}
case 348:
-#line 1566 "parse.y"
+#line 1565 "parse.y"
{
yyval.node = list_append(NEW_LIST(yyvsp[-2].node), yyvsp[0].node);
;
break;}
case 363:
-#line 1590 "parse.y"
+#line 1589 "parse.y"
{yyerrok;;
break;}
case 366:
-#line 1594 "parse.y"
+#line 1593 "parse.y"
{yyerrok;;
break;}
case 367:
-#line 1597 "parse.y"
+#line 1596 "parse.y"
{
yyval.node = 0;
;
@@ -4556,7 +4555,7 @@ yyerrhandle:
}
return 1;
}
-#line 1600 "parse.y"
+#line 1599 "parse.y"
#include <ctype.h>
#include <sys/types.h>
@@ -4568,7 +4567,7 @@ yyerrhandle:
static char *tokenbuf = NULL;
static int tokidx, toksiz = 0;
-#ifndef strdup
+#ifndef HAVE_STRDUP
char *strdup();
#endif
@@ -4682,7 +4681,7 @@ rb_compile_string(f, s, line)
lex_gets_ptr = 0;
lex_input = s;
lex_pbeg = lex_p = lex_pend = 0;
- ruby_sourceline = line;
+ ruby_sourceline = line - 1;
compile_for_eval = 1;
return yycompile(f);
@@ -5032,7 +5031,7 @@ parse_regx(term, paren)
tokfix();
lex_state = EXPR_END;
if (list) {
- nd_set_line(list, re_start-1);
+ nd_set_line(list, re_start);
if (toklen() > 0) {
VALUE ss = rb_str_new(tok(), toklen());
list_append(list, NEW_STR(ss));
@@ -5121,7 +5120,7 @@ parse_string(func, term, paren)
lex_state = EXPR_END;
if (list) {
- nd_set_line(list, strstart-1);
+ nd_set_line(list, strstart);
if (toklen() > 0) {
VALUE ss = rb_str_new(tok(), toklen());
list_append(list, NEW_STR(ss));
@@ -5207,8 +5206,6 @@ parse_quotedword(term, paren)
return tDSTRING;
}
-char *strdup();
-
static int
here_document(term, indent)
char term;
@@ -5325,7 +5322,7 @@ here_document(term, indent)
ruby_sourceline = linesave;
if (list) {
- nd_set_line(list, linesave);
+ nd_set_line(list, linesave+1);
yylval.node = list;
}
switch (term) {
diff --git a/regex.c b/regex.c
index 6c3e83b..17cf330 100644
--- a/regex.c
+++ b/regex.c
@@ -3102,14 +3102,15 @@ typedef union
*stackp++ = (unsigned char*)0; /* non-greedy flag */ \
} while(0)
+#define NON_GREEDY ((unsigned char*)1)
/* This pops what PUSH_FAILURE_POINT pushes. */
#define POP_FAILURE_POINT() \
do { \
- int temp; \
+ long temp; \
stackp -= NUM_NONREG_ITEMS; /* Remove failure points (and flag). */ \
- temp = (int)*--stackp; /* How many regs pushed. */ \
+ temp = (long)*--stackp; /* How many regs pushed. */ \
temp *= NUM_REG_ITEMS; /* How much to take off the stack. */ \
stackp -= temp; /* Remove the register info. */ \
} while(0)
@@ -3320,7 +3321,7 @@ re_match(bufp, string_arg, size, pos, regs)
if (p == pend) {
/* If not end of string, try backtracking. Otherwise done. */
if (d != dend) {
- while (stackp != stackb && (int)stackp[-1] == 1) {
+ while (stackp != stackb && stackp[-1] == NON_GREEDY) {
if (best_regs_set) /* non-greedy, no need to backtrack */
goto restore_best_regs;
POP_FAILURE_POINT();
@@ -3462,7 +3463,7 @@ re_match(bufp, string_arg, size, pos, regs)
regstart[r] = old_regstart[r];
/* xx why this test? */
- if ((int)old_regend[r] >= (int)regstart[r])
+ if ((long)old_regend[r] >= (long)regstart[r])
regend[r] = old_regend[r];
}
}
@@ -3805,7 +3806,7 @@ re_match(bufp, string_arg, size, pos, regs)
EXTRACT_NUMBER_AND_INCR(mcnt, p);
if (p + mcnt < pend) {
PUSH_FAILURE_POINT(p, d);
- stackp[-1] = (unsigned char*)1;
+ stackp[-1] = NON_GREEDY;
}
p += mcnt;
continue;
@@ -3814,7 +3815,7 @@ re_match(bufp, string_arg, size, pos, regs)
POP_FAILURE_POINT();
EXTRACT_NUMBER_AND_INCR(mcnt, p);
PUSH_FAILURE_POINT(p + mcnt, d);
- stackp[-1] = (unsigned char*)1;
+ stackp[-1] = NON_GREEDY;
continue;
case finalize_push_n:
@@ -3831,7 +3832,7 @@ re_match(bufp, string_arg, size, pos, regs)
POP_FAILURE_POINT();
EXTRACT_NUMBER_AND_INCR(mcnt, p);
PUSH_FAILURE_POINT(p + mcnt, d);
- stackp[-1] = (unsigned char*)1;
+ stackp[-1] = NON_GREEDY;
p += 2; /* skip n */
}
/* If don't have to push any more, skip over the rest of command. */
@@ -3967,10 +3968,6 @@ re_match(bufp, string_arg, size, pos, regs)
SET_REGS_MATCHED;
break;
}
-#if 0
- while (stackp != stackb && (int)stackp[-1] == 1)
- POP_FAILURE_POINT();
-#endif
continue; /* Successfully executed one pattern command; keep going. */
/* Jump here if any matching operation fails. */
@@ -3981,7 +3978,7 @@ re_match(bufp, string_arg, size, pos, regs)
/* If this failure point is from a dummy_failure_point, just
skip it. */
- if (stackp[-3] == 0 || (best_regs_set && (int)stackp[-1] == 1)) {
+ if (stackp[-3] == 0 || (best_regs_set && stackp[-1] == NON_GREEDY)) {
POP_FAILURE_POINT();
goto fail;
}
diff --git a/ruby.c b/ruby.c
index f382af0..7fca55f 100644
--- a/ruby.c
+++ b/ruby.c
@@ -124,6 +124,63 @@ extern VALUE rb_load_path;
static FILE *e_fp;
static char *e_tmpname;
+#define STATIC_FILE_LENGTH 255
+
+#if defined(_WIN32) || defined(DJGPP)
+static char *
+rubylib_mangle(s, l)
+ char *s;
+ unsigned int l;
+{
+ static char *newp, *oldp;
+ static int newl, oldl, notfound;
+ static char ret[STATIC_FILE_LENGTH+1];
+
+ if (!newp && !notfound) {
+ newp = getenv("RUBYLIB_PREFIX");
+ if (newp) {
+ char *s;
+
+ oldp = newp;
+ while (*newp && !ISSPACE(*newp) && *newp != ';') {
+ newp++; oldl++; /* Skip digits. */
+ }
+ while (*newp && (ISSPACE(*newp) || *newp == ';')) {
+ newp++; /* Skip whitespace. */
+ }
+ newl = strlen(newp);
+ if (newl == 0 || oldl == 0) {
+ Fatal("malformed RUBYLIB_PREFIX");
+ }
+ strcpy(ret, newp);
+ s = ret;
+ while (*s) {
+ if (*s == '\\') *s = '/';
+ s++;
+ }
+ } else {
+ notfound = 1;
+ }
+ }
+ if (!newp) {
+ return s;
+ }
+ if (l == 0) {
+ l = strlen(s);
+ }
+ if (l < oldl || strncasecmp(oldp, s, oldl) != 0) {
+ return s;
+ }
+ if (l + newl - oldl > STATIC_FILE_LENGTH || newl > STATIC_FILE_LENGTH) {
+ Fatal("malformed RUBYLIB_PREFIX");
+ }
+ strcpy(ret + newl, s + oldl);
+ return ret;
+}
+#else
+#define rubylib_mangle(s, l) (s)
+#endif
+
static void
addpath(path)
const char *path;
@@ -146,18 +203,18 @@ addpath(path)
while (*p) {
while (*p == sep) p++;
if (s = strchr(p, sep)) {
- rb_ary_push(ary, rb_str_new(p, (int)(s-p)));
+ rb_ary_push(ary, rb_str_new2(rubylib_mangle(p, (int)(s-p))));
p = s + 1;
}
else {
- rb_ary_push(ary, rb_str_new2(p));
+ rb_ary_push(ary, rb_str_new2(rubylib_mangle(p, 0)));
break;
}
}
rb_load_path = rb_ary_plus(ary, rb_load_path);
}
else {
- rb_ary_unshift(rb_load_path, rb_str_new2(path));
+ rb_ary_unshift(rb_load_path, rb_str_new2(rubylib_mangle(path, 0)));
}
}
diff --git a/version.h b/version.h
index 606d7ea..6edd0f6 100644
--- a/version.h
+++ b/version.h
@@ -1,2 +1,2 @@
#define RUBY_VERSION "1.3.2"
-#define RUBY_RELEASE_DATE "1999-04-08"
+#define RUBY_RELEASE_DATE "1999-04-13"