Package org.jruby.ast

Examples of org.jruby.ast.YieldNode


        };
        context.getInvocationCompiler().invokeDynamic("`", null, argsCallback, CallType.FUNCTIONAL, null, false);
    }

    public void compileYield(Node node, BodyCompiler context) {
        final YieldNode yieldNode = (YieldNode) node;

        CompilerCallback argsCallback = null;
        if (yieldNode.getArgsNode() != null) {
            argsCallback = new CompilerCallback() {
                public void call(BodyCompiler context) {
                    compile(yieldNode.getArgsNode(), context);
                }
            };
        }

        context.getInvocationCompiler().yield(argsCallback, yieldNode.getCheckState());
    }
View Full Code Here


              }
  break;
case 285:
          // line 1065 "DefaultRubyParser.y"
  {
                  yyVal = new YieldNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), null, false);
              }
  break;
case 286:
          // line 1068 "DefaultRubyParser.y"
  {
                  yyVal = new YieldNode(((Token)yyVals[0+yyTop]).getPosition(), null, false);
              }
  break;
case 287:
          // line 1071 "DefaultRubyParser.y"
  {
View Full Code Here

            }
        } else {
            state = false;
        }
       
        return new YieldNode(position, node, state);
    }
View Full Code Here

        // TODO: don't require pop
        if (!expr) context.consumeCurrentValue();
    }

    public void compileYield(Node node, BodyCompiler context, boolean expr) {
        final YieldNode yieldNode = (YieldNode) node;

        ArgumentsCallback argsCallback = getArgsCallback(yieldNode.getArgsNode());

        // TODO: This filtering is kind of gross...it would be nice to get some parser help here
        if (argsCallback == null || argsCallback.getArity() == 0) {
            context.getInvocationCompiler().yieldSpecific(argsCallback);
        } else if ((argsCallback.getArity() == 1 || argsCallback.getArity() == 2 || argsCallback.getArity() == 3) && yieldNode.getExpandArguments()) {
            // send it along as arity-specific, we don't need the array
            context.getInvocationCompiler().yieldSpecific(argsCallback);
        } else {
            CompilerCallback argsCallback2 = null;
            if (yieldNode.getArgsNode() != null) {
                argsCallback2 = new CompilerCallback() {
                    public void call(BodyCompiler context) {
                        compile(yieldNode.getArgsNode(), context,true);
                    }
                };
            }

            context.getInvocationCompiler().yield(argsCallback2, yieldNode.getExpandArguments());
        }
        // TODO: don't require pop
        if (!expr) context.consumeCurrentValue();
    }
View Full Code Here

        if (node instanceof FixnumNode) {
            return new YieldOneNode(position, (FixnumNode) node);
        }

        return new YieldNode(position, node, state);
    }
View Full Code Here

TOP

Related Classes of org.jruby.ast.YieldNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.