@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) { lexer.getConditionState().begin(); return yyVal; } };
@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) { lexer.getConditionState().end(); return yyVal; } };
private int doKeyword(LexState state) { commandStart = true; if (!isOneEight && leftParenBegin > 0 && leftParenBegin == parenNest) { leftParenBegin = 0; parenNest--; return Tokens.kDO_LAMBDA; } if (conditionState.isInState()) return Tokens.kDO_COND; if (state != LexState.EXPR_CMDARG && cmdArgumentState.isInState()) { return Tokens.kDO_BLOCK; } if (state == LexState.EXPR_ENDARG || (!isOneEight && state == LexState.EXPR_BEG)) { return Tokens.kDO_BLOCK; } return Tokens.kDO; }
@Override public Object execute(RipperParser p, Object yyVal, Object[] yyVals, int yyTop) { p.getCmdArgumentState().reset(((Long)yyVals[-1+yyTop]).longValue()); p.getCmdArgumentState().restart(); yyVal = p.dispatch("on_lambda", ((IRubyObject)yyVals[-2+yyTop]), ((IRubyObject)yyVals[0+yyTop])); p.setLeftParenBegin(((Integer)yyVals[-3+yyTop])); p.popCurrentScope(); return yyVal; } };
private int leftParen(boolean spaceSeen) throws IOException { int result; if (isBEG()) { result = RipperParser.tLPAREN; } else if (isSpaceArg('(', spaceSeen)) { result = RipperParser.tLPAREN_ARG; } else { result = RipperParser.tLPAREN2; } parenNest++; conditionState.stop(); cmdArgumentState.stop(); setState(EXPR_BEG|EXPR_LABEL); return result; }
@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) { lexer.getCmdArgumentState().reset(((Long)yyVals[-1+yyTop]).longValue()); yyVal = ((Node)yyVals[0+yyTop]); return yyVal; } };
protected StackState conditionState = new StackState(); protected StackState cmdArgumentState = new StackState(); private ByteList current_arg; private Encoding current_enc;
@Override public Object execute(RipperParser p, Object yyVal, Object[] yyVals, int yyTop) { p.getCmdArgumentState().reset(((Long)yyVals[-1+yyTop]).longValue()); p.getCmdArgumentState().restart(); yyVal = p.dispatch("on_lambda", ((IRubyObject)yyVals[-2+yyTop]), ((IRubyObject)yyVals[0+yyTop])); p.setLeftParenBegin(((Integer)yyVals[-3+yyTop])); p.popCurrentScope(); return yyVal; } };
private int leftParen(boolean spaceSeen) throws IOException { int result; if (isBEG()) { result = RipperParser.tLPAREN; } else if (isSpaceArg('(', spaceSeen)) { result = RipperParser.tLPAREN_ARG; } else { result = RipperParser.tLPAREN2; } parenNest++; conditionState.stop(); cmdArgumentState.stop(); setState(EXPR_BEG|EXPR_LABEL); return result; }
@Override public Object execute(RipperParser p, Object yyVal, Object[] yyVals, int yyTop) { p.getCmdArgumentState().reset(((Long)yyVals[-2+yyTop]).longValue()); yyVal = p.dispatch("on_begin", ((IRubyObject)yyVals[-1+yyTop])); return yyVal; } };
protected StackState conditionState = new StackState(); protected StackState cmdArgumentState = new StackState(); private ByteList current_arg; private Encoding current_enc;
@Override public Object execute(RipperParser p, Object yyVal, Object[] yyVals, int yyTop) { p.getConditionState().restart(); p.setStrTerm(((StrTerm)yyVals[-6+yyTop])); p.getCmdArgumentState().reset(((Long)yyVals[-5+yyTop]).longValue()); p.setState(((Integer)yyVals[-4+yyTop])); p.setBraceNest(((Integer)yyVals[-3+yyTop])); p.setHeredocIndent(((Integer)yyVals[-2+yyTop])); yyVal = p.dispatch("on_string_embexpr", ((IRubyObject)yyVals[-1+yyTop])); return yyVal; } };
@Override public Object execute(RipperParser p, Object yyVal, Object[] yyVals, int yyTop) { p.getConditionState().end(); return yyVal; } };