Examples of YieldNode


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

Examples of org.jruby.ast.YieldNode

              }
  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

Examples of org.jruby.ast.YieldNode

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

Examples of org.jruby.ast.YieldNode

        // 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

Examples of org.jruby.ast.YieldNode

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

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

Examples of org.jruby.truffle.nodes.yield.YieldNode

            argumentsTranslated.add(argument.accept(this));
        }

        final RubyNode[] argumentsTranslatedArray = argumentsTranslated.toArray(new RubyNode[argumentsTranslated.size()]);

        return new YieldNode(context, translate(node.getPosition()), argumentsTranslatedArray, unsplat);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.