diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java index 6181e6fc2d9..defef44196a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java @@ -920,20 +920,22 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser { if (mode == ParserMode.QUICK_PARSE || mode == ParserMode.STRUCTURAL_PARSE || !isActiveCode()) { skipOverCompoundStatement(true); } else if (mode == ParserMode.COMPLETION_PARSE || mode == ParserMode.SELECTION_PARSE) { - if (scanner.isOnTopContext()) + if (scanner.isOnTopContext()) { compoundStatement(); - else + } else { skipOverCompoundStatement(true); - } else if (mode == ParserMode.COMPLETE_PARSE) + } + } else if (mode == ParserMode.COMPLETE_PARSE) { compoundStatement = compoundStatement(); + } int lastOffset = consume(IToken.tRPAREN).getEndOffset(); - IGNUASTCompoundStatementExpression resultExpression = nodeFactory.newGNUCompoundStatementExpression(compoundStatement); + IGNUASTCompoundStatementExpression resultExpression = + nodeFactory.newGNUCompoundStatementExpression(compoundStatement); ((ASTNode) resultExpression).setOffsetAndLength(startingOffset, lastOffset - startingOffset); return resultExpression; } - /** * Models a cast expression followed by an operator. Can be linked into a chain. * This is done right to left, such that a tree of variants can be built. @@ -946,7 +948,8 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser { IASTInitializerClause fExpression; final CastAmbiguityMarker fAmbiguityMarker; - public BinaryOperator(BinaryOperator nextOp, IASTInitializerClause expression, int operatorToken, int leftPrecedence, int rightPrecedence) { + public BinaryOperator(BinaryOperator nextOp, IASTInitializerClause expression, int operatorToken, + int leftPrecedence, int rightPrecedence) { fNext= nextOp; fOperatorToken= operatorToken; fLeftPrecedence= leftPrecedence; @@ -1014,7 +1017,8 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser { negative= operator.fNext.fExpression; operator.fNext= operator.fNext.fNext; } - IASTConditionalExpression conditionalEx = nodeFactory.newConditionalExpession(left, (IASTExpression) right, (IASTExpression) negative); + IASTConditionalExpression conditionalEx = + nodeFactory.newConditionalExpession(left, (IASTExpression) right, (IASTExpression) negative); setRange(conditionalEx, left); if (negative != null) { adjustLength(conditionalEx, negative); diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/gnu/GNUBuildASTParserAction.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/gnu/GNUBuildASTParserAction.java index 215cba3f846..0cd0e50db14 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/gnu/GNUBuildASTParserAction.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/gnu/GNUBuildASTParserAction.java @@ -12,8 +12,6 @@ package org.eclipse.cdt.core.dom.lrparser.action.gnu; import java.util.List; -import lpg.lpgjavaruntime.IToken; - import org.eclipse.cdt.core.dom.ast.IASTASMDeclaration; import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement; import org.eclipse.cdt.core.dom.ast.IASTName; @@ -25,6 +23,8 @@ import org.eclipse.cdt.core.dom.lrparser.action.ScopedStack; import org.eclipse.cdt.core.dom.lrparser.action.TokenMap; import org.eclipse.cdt.internal.core.dom.lrparser.gcc.GCCParsersym; +import lpg.lpgjavaruntime.IToken; + public class GNUBuildASTParserAction extends AbstractParserAction { private final INodeFactory nodeFactory; @@ -84,7 +84,6 @@ public class GNUBuildASTParserAction extends AbstractParserAction { astStack.push(asm); } - /** * primary_expression * ::= '(' compound_statement ')'