summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
commit73af1e949d5c017068e3f3fabb9e5260b91ffab0 (patch)
treeb87ecb9a91288193e781207cca394bd73dcfa21f /parse.y
parent1af83e49971e5ca5fa1b0c80a12e7b34d9271cac (diff)
2000-02-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y29
1 files changed, 24 insertions, 5 deletions
diff --git a/parse.y b/parse.y
index 3b23c32af2..63104b3ee2 100644
--- a/parse.y
+++ b/parse.y
@@ -6,7 +6,7 @@
$Date$
created at: Fri May 28 18:02:42 JST 1993
- Copyright (C) 1993-2000 Yukihiro Matsumoto
+ Copyright (C) 1993-1999 Yukihiro Matsumoto
************************************************/
@@ -527,6 +527,10 @@ mlhs_node : variable
{
$$ = attrset($1, $3);
}
+ | primary tCOLON2 tIDENTIFIER
+ {
+ $$ = attrset($1, $3);
+ }
| backref
{
rb_backref_error($1);
@@ -545,6 +549,10 @@ lhs : variable
{
$$ = attrset($1, $3);
}
+ | primary tCOLON2 tIDENTIFIER
+ {
+ $$ = attrset($1, $3);
+ }
| backref
{
rb_backref_error($1);
@@ -678,6 +686,17 @@ arg : lhs '=' arg
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
fixpos($$, $1);
}
+ | primary tCOLON2 tIDENTIFIER tOP_ASGN arg
+ {
+ if ($4 == tOROP) {
+ $4 = 0;
+ }
+ else if ($4 == tANDOP) {
+ $4 = 1;
+ }
+ $$ = NEW_OP_ASGN2($1, $3, $4, $5);
+ fixpos($$, $1);
+ }
| backref tOP_ASGN arg
{
rb_backref_error($1);
@@ -721,7 +740,7 @@ arg : lhs '=' arg
$$ = $2;
}
else {
- $$ = call_op($2, tUPLUS, 0);
+ $$ = call_op($2, tUPLUS, 0, 0);
}
}
| tUMINUS arg
@@ -733,7 +752,7 @@ arg : lhs '=' arg
$$ = $2;
}
else {
- $$ = call_op($2, tUMINUS, 0);
+ $$ = call_op($2, tUMINUS, 0, 0);
}
}
| arg '|' arg
@@ -795,7 +814,7 @@ arg : lhs '=' arg
}
| '~' arg
{
- $$ = call_op($2, '~', 0);
+ $$ = call_op($2, '~', 0, 0);
}
| arg tLSHFT arg
{
@@ -3779,7 +3798,7 @@ arg_add(node1, node2)
return list_append(node1, node2);
}
else {
- return NEW_ARGSCAT(node1, NEW_LIST(node2));
+ return NEW_ARGSCAT(node1, node2);
}
}