private lombok.ast.Block toBlock(Statement[] statements) { lombok.ast.Block block = new lombok.ast.Block(); fillList(statements, block.rawContents(), FlagKey.AS_STATEMENT); return block; }
private lombok.ast.Block toBlock(Statement[] statements) { lombok.ast.Block block = new lombok.ast.Block(); fillList(statements, block.rawContents(), FlagKey.AS_STATEMENT); return block; }
private lombok.ast.Block toBlock(Statement[] statements) { lombok.ast.Block block = new lombok.ast.Block(); fillList(statements, block.rawContents(), FlagKey.AS_STATEMENT); return block; }
public Node createBlock(List<Node> statements) { Block block = new Block(); if (statements != null) for (Node s : statements) { if (s != null) block.rawContents().addToEnd(s); } return posify(block); }
public Node createBlock(List<Node> statements) { Block block = new Block(); if (statements != null) for (Node s : statements) { if (s != null) block.rawContents().addToEnd(s); } return posify(block); }
public Node createBlock(List<Node> statements) { Block block = new Block(); if (statements != null) for (Node s : statements) { if (s != null) block.rawContents().addToEnd(s); } return posify(block); }
@Override public void visitBlock(JCBlock node) { Node n; Block b = new Block(); fillList(node.stats, b.rawContents()); setPos(node, b); if (hasFlag(FlagKey.BLOCKS_ARE_INITIALIZERS)) { if ((node.flags & Flags.STATIC) != 0) { n = setPos(node, new StaticInitializer().astBody(b)); } else { // For some strange reason, solitary ; in a type body are represented not as JCSkips, but as JCBlocks with no endpos. Don't ask me why! if (b.rawContents().isEmpty() && node.endpos == -1) { n = setPos(node, new EmptyDeclaration()); } else { n = setPos(node, new InstanceInitializer().astBody(b)); } } } else { n = b; } set(node, n); }
@Override public void visitBlock(JCBlock node) { Node n; Block b = new Block(); fillList(node.stats, b.rawContents()); setPos(node, b); if (hasFlag(FlagKey.BLOCKS_ARE_INITIALIZERS)) { if ((node.flags & Flags.STATIC) != 0) { n = setPos(node, new StaticInitializer().astBody(b)); } else { // For some strange reason, solitary ; in a type body are represented not as JCSkips, but as JCBlocks with no endpos. Don't ask me why! if (b.rawContents().isEmpty() && node.endpos == -1) { n = setPos(node, new EmptyDeclaration()); } else { n = setPos(node, new InstanceInitializer().astBody(b)); } } } else { n = b; } set(node, n); }
@Override public void visitBlock(JCBlock node) { Node n; Block b = new Block(); fillList(node.stats, b.rawContents()); setPos(node, b); if (hasFlag(FlagKey.BLOCKS_ARE_INITIALIZERS)) { if ((node.flags & Flags.STATIC) != 0) { n = setPos(node, new StaticInitializer().astBody(b)); } else { // For some strange reason, solitary ; in a type body are represented not as JCSkips, but as JCBlocks with no endpos. Don't ask me why! if (b.rawContents().isEmpty() && node.endpos == -1) { n = setPos(node, new EmptyDeclaration()); } else { n = setPos(node, new InstanceInitializer().astBody(b)); } } } else { n = b; } set(node, n); }
@Override public void visitSwitch(JCSwitch node) { Switch s = new Switch(); JCExpression cond = node.getExpression(); setConversionPositionInfo(s, "()", getPosition(cond)); s.rawCondition(toTree(removeParens(cond))); Block b = new Block(); s.astBody(b); for (JCCase c : node.getCases()) { JCExpression rawExpr = c.getExpression(); if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default())); else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr)))); fillList(c.getStatements(), b.rawContents()); } set(node, s); }
@Override public void visitSwitch(JCSwitch node) { Switch s = new Switch(); JCExpression cond = node.getExpression(); setConversionPositionInfo(s, "()", getPosition(cond)); s.rawCondition(toTree(removeParens(cond))); Block b = new Block(); s.astBody(b); for (JCCase c : node.getCases()) { JCExpression rawExpr = c.getExpression(); if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default())); else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr)))); fillList(c.getStatements(), b.rawContents()); } set(node, s); }
@Override public void visitSwitch(JCSwitch node) { Switch s = new Switch(); JCExpression cond = node.getExpression(); setConversionPositionInfo(s, "()", getPosition(cond)); s.rawCondition(toTree(removeParens(cond))); Block b = new Block(); s.astBody(b); for (JCCase c : node.getCases()) { JCExpression rawExpr = c.getExpression(); if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default())); else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr)))); fillList(c.getStatements(), b.rawContents()); } set(node, s); }
Block tmp = new Block(); fillList(initializers, tmp.rawContents(), FlagKey.VARDEF_IS_DEFINITION); Node varDecl = tmp.rawContents().first();
Block tmp = new Block(); fillList(initializers, tmp.rawContents(), FlagKey.VARDEF_IS_DEFINITION); Node varDecl = tmp.rawContents().first();
Block tmp = new Block(); fillList(initializers, tmp.rawContents(), FlagKey.VARDEF_IS_DEFINITION); Node varDecl = tmp.rawContents().first();