Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-05-19 13:17:44 +0000
committerStephan Herrmann2010-05-19 13:17:44 +0000
commit885406de42e525056001cba60b53902425fcbfee (patch)
tree92ca1dbcbe31df29035f2bf5b6db4e85287043a2
parentfc674c24520b1115e8ec0df23b40690fe5a83e28 (diff)
downloadorg.eclipse.objectteams-885406de42e525056001cba60b53902425fcbfee.tar.gz
org.eclipse.objectteams-885406de42e525056001cba60b53902425fcbfee.tar.xz
org.eclipse.objectteams-885406de42e525056001cba60b53902425fcbfee.zip
two fups of r342
- apply changes to PublicScanner, too - fix position handling of "precedence after" improve lookahead for mappings with parameter mappings This fixes are needed to compile the order system example.
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java13
2 files changed, 13 insertions, 4 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index 3eb539e26..2ea92b861 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -2420,6 +2420,7 @@ private int lookaheadAfterCallinHeader(int speclength, CallinMappingDeclaration
switch (this.currentToken) {
case TokenNameSEMICOLON:
case TokenNameCOMMA:
+ case TokenNamewith:
// syntax is OK, proceed as normal.
break;
default:
@@ -6331,6 +6332,9 @@ private void consumePrecedenceDeclaration(boolean isAfter) {
length);
this.listLength = 0; // reset
+ if (isAfter)
+ this.intPtr -= 2; // discard start/end positions of "after"
+
pushOnAstStack(new PrecedenceDeclaration(
this.intStack[this.intPtr--],
flushCommentsDefinedPriorTo(this.endStatementPosition),
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
index 885a17a3c..7b32fb65d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
@@ -82,9 +82,11 @@ public class PublicScanner implements IScanner, ITerminalSymbols {
return (this._isOTSource || atStartOfImport) && !this._forceBaseIsIdentifier;
}
- // remember if the previous token was a callin/callout symbol
+ // remember if the previous token was a callin/callout symbol ...
protected boolean _calloutSeen = false;
protected boolean _callinSeen = false;
+ // ... or the "precedence" keyword
+ protected boolean _precedenceSeen = false;
// after a '.' even 'team' can be an identifier:
private int _dotSeen = 0; // 0: no, 1: previos, 2: this token
@@ -3012,11 +3014,13 @@ public int scanIdentifierOrKeyword() {
}
private int internalScanIdentifierOrKeyword(int index, int length, char[] data) {
-//{ObjectTeams: callin/calloutSeen/atStartOfImport has effect only once:
+//{ObjectTeams: callin/calloutSeen/atStartOfImport/precedenceSeen has effect only once:
boolean calloutSeen = this._calloutSeen;
this._calloutSeen = false;
boolean callinSeen = this._callinSeen;
this._callinSeen = false;
+ boolean precedenceSeen = this._precedenceSeen;
+ this._precedenceSeen = false;
boolean atStartOfImport = this._atStartOfImport;
this._atStartOfImport = false;
// SH}
@@ -3044,9 +3048,9 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
} else {
return TokenNameIdentifier;
}
-//{ObjectTeams: 'after' (only if after "<-"):
+//{ObjectTeams: 'after' (only if after "<-" or "precedence"):
case 5:
- if (callinSeen) {
+ if (callinSeen || precedenceSeen) {
if ( (data[++index] == 'f')
&& (data[++index] == 't')
&& (data[++index] == 'e')
@@ -3491,6 +3495,7 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
&& (data[++index] == 'n')
&& (data[++index] == 'c')
&& (data[++index] == 'e')) {
+ this._precedenceSeen = true;
return TokenNameprecedence;
} else
return TokenNameIdentifier;

Back to the top