public Node createCaseStatement(Node condition) { return posify(new Case().rawCondition(condition)); }
public Node createCaseStatement(Node condition) { return posify(new Case().rawCondition(condition)); }
public Node createCaseStatement(Node condition) { return posify(new Case().rawCondition(condition)); }
@Override public boolean visitCase(lombok.ast.Case node) { // end and start args are switched around on CaseStatement, presumably because the API designer was drunk at the time. return set(node, new CaseStatement(toExpression(node.astCondition()), end(node.rawCondition()), start(node))); }
@Override public boolean visitCase(lombok.ast.Case node) { // end and start args are switched around on CaseStatement, presumably because the API designer was drunk at the time. return set(node, new CaseStatement(toExpression(node.astCondition()), end(node.rawCondition()), start(node))); }
@Override public boolean visitCase(lombok.ast.Case node) { // end and start args are switched around on CaseStatement, presumably because the API designer was drunk at the time. return set(node, new CaseStatement(toExpression(node.astCondition()), end(node.rawCondition()), start(node))); }
@Override public boolean visitCase(Case node) { formatter.buildBlock(node); formatter.keyword("case"); formatter.space(); formatter.nameNextElement("condition"); visit(node.rawCondition()); formatter.append(":"); formatter.closeBlock(); return true; }
@Override public boolean visitCase(Case node) { formatter.buildBlock(node); formatter.keyword("case"); formatter.space(); formatter.nameNextElement("condition"); visit(node.rawCondition()); formatter.append(":"); formatter.closeBlock(); return true; }
@Override public boolean visitCase(Case node) { formatter.buildBlock(node); formatter.keyword("case"); formatter.space(); formatter.nameNextElement("condition"); visit(node.rawCondition()); formatter.append(":"); formatter.closeBlock(); return true; }
@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); }