private List<MixinBlockNode> getInjectionPoints(Node block) { List<MixinBlockNode> result = new ArrayList<MixinBlockNode>(); for (Node node : block.getNodes()) { if (node instanceof MixinBlockNode && !node.hasNodes()) { result.add((MixinBlockNode) node); } else if(node instanceof ConditionalNode){ for (IfConditionNode condition : ((ConditionalNode) node).getConditions()) { result.addAll(getInjectionPoints(condition.getBlock())); } // } else if(node instanceof CaseNode.When){ // for (CaseConditionNode condition : ((CaseNode) node).getCaseConditionNodes()) { // result.addAll(getInjectionPoints(condition.getBlock())); // } } else if (node.hasBlock()) { result.addAll(getInjectionPoints(node.getBlock())); } } return result; }
public BlockNode getIncludeBlock() { BlockNode ret = this; for (Node node : getNodes()) { if (node instanceof BlockNode && ((BlockNode) node).isYield()) { return (BlockNode) node; } else if (node instanceof TagNode && ((TagNode) node).isTextOnly()) { continue; } else if (node instanceof BlockNode && ((BlockNode) node).getIncludeBlock() != null) { ret = ((BlockNode) node).getIncludeBlock(); } else if (node.hasBlock()) { ret = ((BlockNode) node.getBlock()).getIncludeBlock(); } if(ret instanceof BlockNode && ((BlockNode) ret).isYield()){ return ret; } } return ret; }
private List<MixinBlockNode> getInjectionPoints(Node block) { List<MixinBlockNode> result = new ArrayList<MixinBlockNode>(); for (Node node : block.getNodes()) { if (node instanceof MixinBlockNode && !node.hasNodes()) { result.add((MixinBlockNode) node); } else if(node instanceof ConditionalNode){ for (IfConditionNode condition : ((ConditionalNode) node).getConditions()) { result.addAll(getInjectionPoints(condition.getBlock())); } // } else if(node instanceof CaseNode.When){ // for (CaseConditionNode condition : ((CaseNode) node).getCaseConditionNodes()) { // result.addAll(getInjectionPoints(condition.getBlock())); // } } else if (node.hasBlock()) { result.addAll(getInjectionPoints(node.getBlock())); } } return result; }
public BlockNode getIncludeBlock() { BlockNode ret = this; for (Node node : getNodes()) { if (node instanceof BlockNode && ((BlockNode) node).isYield()) { return (BlockNode) node; } else if (node instanceof TagNode && ((TagNode) node).isTextOnly()) { continue; } else if (node instanceof BlockNode && ((BlockNode) node).getIncludeBlock() != null) { ret = ((BlockNode) node).getIncludeBlock(); } else if (node.hasBlock()) { ret = ((BlockNode) node.getBlock()).getIncludeBlock(); } if(ret instanceof BlockNode && ((BlockNode) ret).isYield()){ return ret; } } return ret; }