From 105de6f15d2ff84d16616098e43ed76ba93d1ef5 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 4 Apr 2012 08:24:12 +0200 Subject: [PATCH] Bug 370637: Visiting while statements. --- .../dom/parser/cpp/CPPASTWhileStatement.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java index 96fb06b9267..2ad28acedcb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTWhileStatement.java @@ -118,17 +118,16 @@ public class CPPASTWhileStatement extends ASTNode default: break; } } - if (condition != null && !condition.accept(action)) return false; - if (condition2 != null && !condition2.accept(action)) return false; - if (body != null && !body.accept(action)) return false; + if (condition != null && !condition.accept(action)) + return false; + if (condition2 != null && !condition2.accept(action)) + return false; + if (body != null && !body.accept(action)) + return false; - if (action.shouldVisitExpressions) { - switch (action.leave(this)) { - case ASTVisitor.PROCESS_ABORT: return false; - case ASTVisitor.PROCESS_SKIP: return true; - default: break; - } - } + if (action.shouldVisitStatements && action.leave(this) == ASTVisitor.PROCESS_ABORT) + return false; + return true; }