mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +02:00
[98375] Added handling of content assist in condition expressions.
This commit is contained in:
parent
561a996910
commit
e5876952df
1 changed files with 17 additions and 9 deletions
|
@ -863,8 +863,13 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
|
||||||
if (LT(1) == IToken.tQUESTION) {
|
if (LT(1) == IToken.tQUESTION) {
|
||||||
consume(IToken.tQUESTION);
|
consume(IToken.tQUESTION);
|
||||||
IASTExpression secondExpression = expression();
|
IASTExpression secondExpression = expression();
|
||||||
|
IASTExpression thirdExpression = null;
|
||||||
|
|
||||||
|
if (LT(1) != IToken.tEOC) {
|
||||||
consume(IToken.tCOLON);
|
consume(IToken.tCOLON);
|
||||||
IASTExpression thirdExpression = assignmentExpression();
|
thirdExpression = assignmentExpression();
|
||||||
|
}
|
||||||
|
|
||||||
IASTConditionalExpression result = createConditionalExpression();
|
IASTConditionalExpression result = createConditionalExpression();
|
||||||
result.setLogicalConditionExpression(firstExpression);
|
result.setLogicalConditionExpression(firstExpression);
|
||||||
firstExpression.setParent(result);
|
firstExpression.setParent(result);
|
||||||
|
@ -874,6 +879,7 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
|
||||||
secondExpression.setParent(result);
|
secondExpression.setParent(result);
|
||||||
secondExpression
|
secondExpression
|
||||||
.setPropertyInParent(IASTConditionalExpression.POSITIVE_RESULT);
|
.setPropertyInParent(IASTConditionalExpression.POSITIVE_RESULT);
|
||||||
|
if (thirdExpression != null) {
|
||||||
result.setNegativeResultExpression(thirdExpression);
|
result.setNegativeResultExpression(thirdExpression);
|
||||||
thirdExpression.setParent(result);
|
thirdExpression.setParent(result);
|
||||||
thirdExpression
|
thirdExpression
|
||||||
|
@ -881,6 +887,8 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
|
||||||
((ASTNode) result).setOffsetAndLength(((ASTNode) firstExpression)
|
((ASTNode) result).setOffsetAndLength(((ASTNode) firstExpression)
|
||||||
.getOffset(), calculateEndOffset(thirdExpression)
|
.getOffset(), calculateEndOffset(thirdExpression)
|
||||||
- ((ASTNode) firstExpression).getOffset());
|
- ((ASTNode) firstExpression).getOffset());
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return firstExpression;
|
return firstExpression;
|
||||||
|
|
Loading…
Add table
Reference in a new issue