Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDoug Schaefer2005-06-21 20:34:49 +0000
committerDoug Schaefer2005-06-21 20:34:49 +0000
commita90cfa1442c5aa2c6002c1d4254ec838f0ee8b8b (patch)
tree7018719a2d1cd0f8dc64d610b8b2d81062e2ff11 /core
parent2ecabcefbe312ca4921555ab4ce81af41dc68fd8 (diff)
downloadorg.eclipse.cdt-a90cfa1442c5aa2c6002c1d4254ec838f0ee8b8b.tar.gz
org.eclipse.cdt-a90cfa1442c5aa2c6002c1d4254ec838f0ee8b8b.tar.xz
org.eclipse.cdt-a90cfa1442c5aa2c6002c1d4254ec838f0ee8b8b.zip
[98346] Added handling of EOC to enumSpecifier.
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java24
1 files changed, 18 insertions, 6 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 cb4fd781133..49cbc00d1c4 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
@@ -1243,7 +1243,14 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
name.setPropertyInParent(IASTEnumerationSpecifier.ENUMERATION_NAME);
consume(IToken.tLBRACE);
- while (LT(1) != IToken.tRBRACE) {
+ enumLoop: while (true) {
+
+ switch (LT(1)) {
+ case IToken.tRBRACE:
+ case IToken.tEOC:
+ break enumLoop;
+ }
+
IASTName enumeratorName = null;
int lastOffset = 0;
@@ -1283,10 +1290,16 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
break;
}
- if (LT(1) != IToken.tCOMMA) {
+
+ switch (LT(1)) {
+ case IToken.tCOMMA:
+ case IToken.tEOC:
+ consume();
+ break;
+ default:
throwBacktrack(mark.getOffset(), mark.getLength());
}
-
+
enumerator = createEnumerator();
enumerator.setName(enumeratorName);
((ASTNode) enumerator).setOffsetAndLength(
@@ -1305,10 +1318,9 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
enumerator.setParent(result);
enumerator
.setPropertyInParent(IASTEnumerationSpecifier.ENUMERATOR);
-
- consume(IToken.tCOMMA);
}
- int lastOffset = consume(IToken.tRBRACE).getEndOffset();
+
+ int lastOffset = consume().getEndOffset();
((ASTNode) result).setLength(lastOffset - startOffset);
return result;
}

Back to the top