private <N extends lombok.ast.Node> N setPosition(ASTNode node, N lombokNode) { lombokNode.setPosition(toPosition(node.sourceStart, node.sourceEnd)); return lombokNode; }
private <N extends lombok.ast.Node> N setPosition(ASTNode node, N lombokNode) { lombokNode.setPosition(toPosition(node.sourceStart, node.sourceEnd)); return lombokNode; }
@Override public boolean visitNode(Node node) { node.setPosition(new Position(location, location, responsible)); return false; }
@Override public boolean visitNode(Node node) { node.setPosition(new Position(location, location, responsible)); return false; }
/** * Sets the position of {@code node} to {@code position}, and then does the same for all of {@code node}'s children, recursively. */ public static Node setAllPositions(Node node, Position position) { node.setPosition(position); for (Node child : node.getChildren()) setAllPositions(child, position); return node; }
/** * Sets the position of {@code node} to {@code position}, and then does the same for all of {@code node}'s children, recursively. */ public static Node setAllPositions(Node node, Position position) { node.setPosition(position); for (Node child : node.getChildren()) setAllPositions(child, position); return node; }
/** * Sets the position of {@code node} to {@code position}, and then does the same for all of {@code node}'s children, recursively. */ public static Node setAllPositions(Node node, Position position) { node.setPosition(position); for (Node child : node.getChildren()) setAllPositions(child, position); return node; }
<T extends Node> T posify(T node) { int start = startPos(); int end = Math.max(start, currentPos()); node.setPosition(new Position(start, end)); return node; }
<T extends Node> T posify(T node) { int start = startPos(); int end = Math.max(start, currentPos()); node.setPosition(new Position(start, end)); return node; }
private <N extends Node> N setPos(JCTree node, N astNode) { if (astNode != null && node != null) { int start = node.pos; Integer end_ = endPosTable.get(node); if (node instanceof JCUnary) end_ = node.getEndPosition(endPosTable); int end = end_ == null ? node.getEndPosition(endPosTable) : end_; if (start != com.sun.tools.javac.util.Position.NOPOS && end != com.sun.tools.javac.util.Position.NOPOS) { astNode.setPosition(new Position(start, end)); } } return astNode; }
<T extends Node> T posify(T node) { int start = startPos(); int end = Math.max(start, currentPos()); node.setPosition(new Position(start, end)); return node; }
private <N extends Node> N setPos(JCTree node, N astNode) { if (astNode != null && node != null) { int start = node.pos; Integer end_ = endPosTable.get(node); if (node instanceof JCUnary) end_ = node.getEndPosition(endPosTable); int end = end_ == null ? node.getEndPosition(endPosTable) : end_; if (start != com.sun.tools.javac.util.Position.NOPOS && end != com.sun.tools.javac.util.Position.NOPOS) { astNode.setPosition(new Position(start, end)); } } return astNode; }
private <N extends Node> N setPos(JCTree node, N astNode) { if (astNode != null && node != null) { int start = node.pos; Integer end_ = endPosTable.get(node); if (node instanceof JCUnary) end_ = node.getEndPosition(endPosTable); int end = end_ == null ? node.getEndPosition(endPosTable) : end_; if (start != com.sun.tools.javac.util.Position.NOPOS && end != com.sun.tools.javac.util.Position.NOPOS) { astNode.setPosition(new Position(start, end)); } } return astNode; }
void positionSpan(Node target, org.parboiled.Node<Node> start, org.parboiled.Node<Node> end) { if (target == null || start == null || end == null) return; target.setPosition(new Position(start.getStartIndex(), end.getEndIndex())); } }
void positionSpan(Node target, org.parboiled.Node<Node> start, org.parboiled.Node<Node> end) { if (target == null || start == null || end == null) return; target.setPosition(new Position(start.getStartIndex(), end.getEndIndex())); } }
void positionSpan(Node target, org.parboiled.Node<Node> start, org.parboiled.Node<Node> end) { if (target == null || start == null || end == null) return; target.setPosition(new Position(start.getStartIndex(), end.getEndIndex())); } }
@Override public void endVisit(Node node) { node.setPosition(new Position(node.getPosition().getStart(), location, responsible)); }
public Node createAnnotationDeclaration(Node modifiers, Node name, List<Node> members, org.parboiled.Node<Node> typeOpen, org.parboiled.Node<Node> typeClose) { Node typeBody = createNormalTypeBody(members); if (typeOpen != null && typeClose != null) { typeBody.setPosition(new Position(typeOpen.getStartIndex(), typeClose.getEndIndex())); } AnnotationDeclaration decl = new AnnotationDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(typeBody); if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos())); return posify(decl); }
public Node createAnnotationDeclaration(Node modifiers, Node name, List<Node> members, org.parboiled.Node<Node> typeOpen, org.parboiled.Node<Node> typeClose) { Node typeBody = createNormalTypeBody(members); if (typeOpen != null && typeClose != null) { typeBody.setPosition(new Position(typeOpen.getStartIndex(), typeClose.getEndIndex())); } AnnotationDeclaration decl = new AnnotationDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(typeBody); if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos())); return posify(decl); }
public Node createAnnotationDeclaration(Node modifiers, Node name, List<Node> members, org.parboiled.Node<Node> typeOpen, org.parboiled.Node<Node> typeClose) { Node typeBody = createNormalTypeBody(members); if (typeOpen != null && typeClose != null) { typeBody.setPosition(new Position(typeOpen.getStartIndex(), typeClose.getEndIndex())); } AnnotationDeclaration decl = new AnnotationDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(typeBody); if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos())); return posify(decl); }