case 360:
// line 1318 "DefaultRubyParser.y"
{
Node node;
if (((Node)yyVals[-3+yyTop]) != null) {
node = support.appendToBlock(support.node_assign(((Node)yyVals[-3+yyTop]), new GlobalVarNode(getPosition(((Token)yyVals[-5+yyTop])), "$!")), ((Node)yyVals[-1+yyTop]));
if(((Node)yyVals[-1+yyTop]) != null) {
node.setPosition(support.unwrapNewlineNode(((Node)yyVals[-1+yyTop])).getPosition());
}
} else {
node = ((Node)yyVals[-1+yyTop]);
}
Node body = node == null ? NilImplicitNode.NIL : node;
yyVal = new RescueBodyNode(getPosition(((Token)yyVals[-5+yyTop]), true), ((Node)yyVals[-4+yyTop]), body, ((RescueBodyNode)yyVals[0+yyTop]));
}
break;
case 361:
// line 1331 "DefaultRubyParser.y"
{yyVal = null;}
break;
case 362:
// line 1333 "DefaultRubyParser.y"
{
yyVal = support.newArrayNode(((Node)yyVals[0+yyTop]).getPosition(), ((Node)yyVals[0+yyTop]));
}
break;
case 365:
// line 1339 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[0+yyTop]);
}
break;
case 367:
// line 1344 "DefaultRubyParser.y"
{
if (((Node)yyVals[0+yyTop]) != null) {
yyVal = ((Node)yyVals[0+yyTop]);
} else {
yyVal = new NilNode(getPosition(null));
}
}
break;
case 370:
// line 1355 "DefaultRubyParser.y"
{
/* FIXME: We may be intern'ing more than once.*/
yyVal = new SymbolNode(((Token)yyVals[0+yyTop]).getPosition(), ((String) ((Token)yyVals[0+yyTop]).getValue()).intern());
}
break;
case 372:
// line 1362 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[0+yyTop]) instanceof EvStrNode ? new DStrNode(getPosition(((Node)yyVals[0+yyTop]))).add(((Node)yyVals[0+yyTop])) : ((Node)yyVals[0+yyTop]);
}
break;
case 374:
// line 1368 "DefaultRubyParser.y"
{
yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 375:
// line 1373 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[-1+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
int extraLength = ((String) ((Token)yyVals[-2+yyTop]).getValue()).length() - 1;
/* We may need to subtract addition offset off of first */
/* string fragment (we optimistically take one off in*/
/* ParserSupport.literal_concat). Check token length*/
/* and subtract as neeeded.*/
if ((((Node)yyVals[-1+yyTop]) instanceof DStrNode) && extraLength > 0) {
Node strNode = ((DStrNode)((Node)yyVals[-1+yyTop])).get(0);
assert strNode != null;
strNode.getPosition().adjustStartOffset(-extraLength);
}
}
break;
case 376:
// line 1390 "DefaultRubyParser.y"
{
ISourcePosition position = support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop]));
if (((Node)yyVals[-1+yyTop]) == null) {
yyVal = new XStrNode(position, null);
} else if (((Node)yyVals[-1+yyTop]) instanceof StrNode) {
yyVal = new XStrNode(position, (ByteList) ((StrNode)yyVals[-1+yyTop]).getValue().clone());
} else if (((Node)yyVals[-1+yyTop]) instanceof DStrNode) {
yyVal = new DXStrNode(position, ((DStrNode)yyVals[-1+yyTop]));
((Node)yyVal).setPosition(position);
} else {
yyVal = new DXStrNode(position).add(((Node)yyVals[-1+yyTop]));
}
}
break;
case 377:
// line 1407 "DefaultRubyParser.y"
{
int options = ((RegexpNode)yyVals[0+yyTop]).getOptions();
Node node = ((Node)yyVals[-1+yyTop]);
if (node == null) {
yyVal = new RegexpNode(getPosition(((Token)yyVals[-2+yyTop])), ByteList.create(""), options & ~ReOptions.RE_OPTION_ONCE);
} else if (node instanceof StrNode) {
yyVal = new RegexpNode(((Node)yyVals[-1+yyTop]).getPosition(), (ByteList) ((StrNode) node).getValue().clone(), options & ~ReOptions.RE_OPTION_ONCE);
} else if (node instanceof DStrNode) {
yyVal = new DRegexpNode(getPosition(((Token)yyVals[-2+yyTop])), (DStrNode) node, options, (options & ReOptions.RE_OPTION_ONCE) != 0);
} else {
yyVal = new DRegexpNode(getPosition(((Token)yyVals[-2+yyTop])), options, (options & ReOptions.RE_OPTION_ONCE) != 0).add(node);
}
}
break;
case 378:
// line 1423 "DefaultRubyParser.y"
{
yyVal = new ZArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 379:
// line 1426 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-1+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 380:
// line 1432 "DefaultRubyParser.y"
{
yyVal = new ArrayNode(getPosition(null));
}
break;
case 381:
// line 1435 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop]) instanceof EvStrNode ? new DStrNode(getPosition(((ListNode)yyVals[-2+yyTop]))).add(((Node)yyVals[-1+yyTop])) : ((Node)yyVals[-1+yyTop]));
}
break;
case 383:
// line 1440 "DefaultRubyParser.y"
{
yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 384:
// line 1445 "DefaultRubyParser.y"
{
yyVal = new ZArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 385:
// line 1448 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-1+yyTop]);
((ISourcePositionHolder)yyVal).setPosition(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
}
break;
case 386:
// line 1454 "DefaultRubyParser.y"
{
yyVal = new ArrayNode(getPosition(null));
}
break;
case 387:
// line 1457 "DefaultRubyParser.y"
{
yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop]));
}
break;
case 388:
// line 1462 "DefaultRubyParser.y"
{
yyVal = new StrNode(((Token)yyVals[0+yyTop]).getPosition(), ByteList.create(""));
}
break;
case 389:
// line 1465 "DefaultRubyParser.y"
{
yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 390:
// line 1469 "DefaultRubyParser.y"
{
yyVal = null;
}
break;
case 391:
// line 1472 "DefaultRubyParser.y"
{
yyVal = support.literal_concat(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
}
break;
case 392:
// line 1477 "DefaultRubyParser.y"
{
yyVal = ((Node)yyVals[0+yyTop]);
}
break;
case 393:
// line 1480 "DefaultRubyParser.y"
{
yyVal = lexer.getStrTerm();
lexer.setStrTerm(null);
lexer.setState(LexState.EXPR_BEG);
}
break;
case 394:
// line 1484 "DefaultRubyParser.y"
{
lexer.setStrTerm(((StrTerm)yyVals[-1+yyTop]));
yyVal = new EvStrNode(support.union(((Token)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
}
break;
case 395:
// line 1488 "DefaultRubyParser.y"
{
yyVal = lexer.getStrTerm();
lexer.setStrTerm(null);
lexer.setState(LexState.EXPR_BEG);
}
break;
case 396:
// line 1492 "DefaultRubyParser.y"
{
lexer.setStrTerm(((StrTerm)yyVals[-2+yyTop]));
yyVal = support.newEvStrNode(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-1+yyTop]));
}
break;
case 397:
// line 1498 "DefaultRubyParser.y"
{
yyVal = new GlobalVarNode(((Token)yyVals[0+yyTop]).getPosition(), (String) ((Token)yyVals[0+yyTop]).getValue());
}
break;
case 398:
// line 1501 "DefaultRubyParser.y"
{