@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))); }
public Node createCaseStatement(Node condition) { return posify(new Case().rawCondition(condition)); }
@Override public void visitCaseStatement(CaseStatement node) { if (node.constantExpression == null) { lombok.ast.Default defaultStat = new lombok.ast.Default(); //TODO still have fix drunken positioning. set(node, setPosition(node, defaultStat)); return; } lombok.ast.Case caseStat = new lombok.ast.Case(); caseStat.astCondition((lombok.ast.Expression) toTree(node.constantExpression)); set(node, setPosition(node, caseStat)); }
if (nodeType == Case.class) { Case caseStatement = (Case) curr; Expression condition = caseStatement.astCondition(); return condition != null && isAncestor(condition, node); } else if (nodeType == If.class) {
@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 visitCaseStatement(CaseStatement node) { if (node.constantExpression == null) { lombok.ast.Default defaultStat = new lombok.ast.Default(); //TODO still have fix drunken positioning. set(node, setPosition(node, defaultStat)); return; } lombok.ast.Case caseStat = new lombok.ast.Case(); caseStat.astCondition((lombok.ast.Expression) toTree(node.constantExpression)); set(node, setPosition(node, caseStat)); }
JCExpression newPat = (s instanceof Default) ? null : toExpression(((Case)s).astCondition()); if (preamble) { preamble = false;
@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; }
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 void visitCaseStatement(CaseStatement node) { if (node.constantExpression == null) { lombok.ast.Default defaultStat = new lombok.ast.Default(); //TODO still have fix drunken positioning. set(node, setPosition(node, defaultStat)); return; } lombok.ast.Case caseStat = new lombok.ast.Case(); caseStat.astCondition((lombok.ast.Expression) toTree(node.constantExpression)); set(node, setPosition(node, caseStat)); }
JCExpression newPat = (s instanceof Default) ? null : toExpression(((Case)s).astCondition()); if (preamble) { preamble = false;
@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; }
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))); }
JCExpression newPat = (s instanceof Default) ? null : toExpression(((Case)s).astCondition()); if (preamble) { preamble = false;
@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); }
returnValueIgnored = ((DoWhile) parent).astCondition() != node; } else if (parent instanceof Case) { returnValueIgnored = ((Case) parent).astCondition() != node; } else if (parent instanceof Assert) { returnValueIgnored = ((Assert) parent).astAssertion() != node;
@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); }