From 40969959b881107073042cee3f952ef9d0cb24be Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 15 Apr 2005 20:31:49 +0000 Subject: [PATCH] Fixed content assist in if conditional to take into account the if loop. --- .../dom/parser/AbstractGNUSourceCodeParser.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 96f7506744c..35dce5cb2a9 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 @@ -1871,11 +1871,17 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser { condition = condition(); if (LT(1) == IToken.tEOC) { // Completing in the condition - result = createIfStatement(); - result.setCondition(condition); - condition.setParent(result); + IASTIfStatement new_if = createIfStatement(); + new_if.setCondition(condition); + condition.setParent(new_if); condition.setPropertyInParent(IASTIfStatement.CONDITION); - return result; + + if (if_statement != null) { + if_statement.setElseClause(new_if); + new_if.setParent(if_statement); + new_if.setPropertyInParent(IASTIfStatement.ELSE); + } + return result != null ? result : new_if; } consume(IToken.tRPAREN); } catch (BacktrackException b) {