boolean inArrayAssignment = false;
boolean inThrowsClause = false;
boolean inClassOrInterfaceHeader = false;
+ int dollarBraceCount = 0;
// openBracketCount is used to count the number of open brackets not closed yet.
int openBracketCount = 0;
// exit the loop.
try {
token = scanner.getNextToken();
+ if (Scanner.DEBUG) {
+ int currentEndPosition = scanner.getCurrentTokenEndPosition();
+ int currentStartPosition = scanner.getCurrentTokenStartPosition();
+
+ System.out.print(currentStartPosition + "," + currentEndPosition + ": ");
+ System.out.println(scanner.toStringAction(token));
+ }
// Patch for line comment
// See PR http://dev.eclipse.org/bugs/show_bug.cgi?id=23096
}
}
switch (token) {
+ case TokenNameDOLLAR_LBRACE :
+ dollarBraceCount++;
+ break;
case TokenNameelse :
// case TokenNamefinally :
expectingOpenBrace = true;
}
break;
case TokenNameRBRACE :
+ if (dollarBraceCount > 0) {
+ dollarBraceCount--;
+ break;
+ }
if (previousCompilableToken == TokenNameRPAREN) {
pendingSpace = false;
}
}
increaseLineDelta(scanner.startPosition - scanner.currentPosition);
break;
-// case TokenNameHTML :
-// // Add the next token to the formatted source string.
-// // outputCurrentToken(token);
-// int startPosition = scanner.startPosition;
-// flushBuffer();
-// for (int i = startPosition, max = scanner.currentPosition; i < max; i++) {
-// char currentCharacter = scanner.source[i];
-// updateMappedPositions(i);
-// currentLineBuffer.append(currentCharacter);
-// }
-// break;
+ // case TokenNameHTML :
+ // // Add the next token to the formatted source string.
+ // // outputCurrentToken(token);
+ // int startPosition = scanner.startPosition;
+ // flushBuffer();
+ // for (int i = startPosition, max = scanner.currentPosition; i < max; i++) {
+ // char currentCharacter = scanner.source[i];
+ // updateMappedPositions(i);
+ // currentLineBuffer.append(currentCharacter);
+ // }
+ // break;
default :
if ((token == TokenNameIdentifier) || isLiteralToken(token)) {
// || token == TokenNamesuper
if (currentToken != Scanner.TokenNameWHITESPACE)
previousToken = currentToken;
currentToken = splitScanner.getNextToken();
+ if (Scanner.DEBUG) {
+ int currentEndPosition = splitScanner.getCurrentTokenEndPosition();
+ int currentStartPosition = splitScanner.getCurrentTokenStartPosition();
+
+ System.out.print(currentStartPosition + "," + currentEndPosition + ": ");
+ System.out.println(scanner.toStringAction(currentToken));
+ }
} catch (InvalidInputException e) {
if (!handleInvalidToken(e))
throw e;