gpt4 book ai didi

org.jruby.ast.YieldNode.getArgsNode()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 02:07:31 24 4
gpt4 key购买 nike

本文整理了Java中org.jruby.ast.YieldNode.getArgsNode()方法的一些代码示例,展示了YieldNode.getArgsNode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YieldNode.getArgsNode()方法的具体详情如下:
包路径:org.jruby.ast.YieldNode
类名称:YieldNode
方法名:getArgsNode

YieldNode.getArgsNode介绍

[英]Gets the argsNode.
[中]获取argsNode。

代码示例

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public void call(BodyCompiler context) {
    compile(yieldNode.getArgsNode(), context,true);
  }
};

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public void call(BodyCompiler context) {
    compile(yieldNode.getArgsNode(), context,true);
  }
};

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public Operand buildYield(YieldNode node, IRScope s) {
  Variable ret = s.getNewTemporaryVariable();
  s.addInstr(new YieldInstr(ret, s.getImplicitBlockArg(), build(node.getArgsNode(), s), node.getExpandArguments()));
  return ret;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public Operand buildYield(YieldNode node, IRScope s) {
  Variable ret = s.getNewTemporaryVariable();
  s.addInstr(new YieldInstr(ret, s.getImplicitBlockArg(), build(node.getArgsNode(), s), node.getExpandArguments()));
  return ret;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
public Operand buildYield(YieldNode node, IRScope s) {
  boolean unwrap = true;
  Node argNode = node.getArgsNode();
  // Get rid of one level of array wrapping
  if (argNode != null && (argNode instanceof ArrayNode) && ((ArrayNode)argNode).size() == 1) {
    argNode = ((ArrayNode)argNode).getLast();
    unwrap = false;
  }
  Variable ret = s.getNewTemporaryVariable();
  s.addInstr(new YieldInstr(ret, s.getImplicitBlockArg(), build(argNode, s), unwrap));
  return ret;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
public Operand buildYield(YieldNode node, IRScope s) {
  boolean unwrap = true;
  Node argNode = node.getArgsNode();
  // Get rid of one level of array wrapping
  if (argNode != null && (argNode instanceof ArrayNode) && ((ArrayNode)argNode).size() == 1) {
    argNode = ((ArrayNode)argNode).getLast();
    unwrap = false;
  }
  Variable ret = s.getNewTemporaryVariable();
  s.addInstr(new YieldInstr(ret, s.getImplicitBlockArg(), build(argNode, s), unwrap));
  return ret;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

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();
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

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();
}

代码示例来源:origin: org.jruby/jruby-core

public Operand buildYield(YieldNode node, Variable result) {
  if (scope instanceof IRScriptBody) throwSyntaxError(node, "Invalid yield");
  boolean unwrap = true;
  Node argNode = node.getArgsNode();
  // Get rid of one level of array wrapping
  if (argNode != null && (argNode instanceof ArrayNode) && ((ArrayNode)argNode).size() == 1) {
    argNode = ((ArrayNode)argNode).getLast();
    unwrap = false;
  }
  Variable ret = result == null ? createTemporaryVariable() : result;
  if (argNode instanceof ArrayNode && unwrap) {
    addInstr(new YieldInstr(ret, scope.getYieldClosureVariable(), buildArray((ArrayNode)argNode, true), unwrap));
  } else {
    addInstr(new YieldInstr(ret, scope.getYieldClosureVariable(), build(argNode), unwrap));
  }
  return ret;
}

代码示例来源:origin: org.jruby/jruby-complete

public Operand buildYield(YieldNode node, Variable result) {
  if (scope instanceof IRScriptBody) throwSyntaxError(node, "Invalid yield");
  boolean unwrap = true;
  Node argNode = node.getArgsNode();
  // Get rid of one level of array wrapping
  if (argNode != null && (argNode instanceof ArrayNode) && ((ArrayNode)argNode).size() == 1) {
    argNode = ((ArrayNode)argNode).getLast();
    unwrap = false;
  }
  Variable ret = result == null ? createTemporaryVariable() : result;
  if (argNode instanceof ArrayNode && unwrap) {
    addInstr(new YieldInstr(ret, scope.getYieldClosureVariable(), buildArray((ArrayNode)argNode, true), unwrap));
  } else {
    addInstr(new YieldInstr(ret, scope.getYieldClosureVariable(), build(argNode), unwrap));
  }
  return ret;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

break;
case YIELDNODE:
  inspect(((YieldNode)node).getArgsNode());
  break;
case ZARRAYNODE:

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

break;
case YIELDNODE:
  inspect(((YieldNode)node).getArgsNode());
  break;
case ZARRAYNODE:

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com