Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/DartCodeScanner.java

Issue 10536031: Fix for issue 3401: Implement casts in Analyzer (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/DartCodeScanner.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/DartCodeScanner.java (revision 8336)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/DartCodeScanner.java (working copy)
@@ -25,6 +25,7 @@
import com.google.dart.tools.ui.text.IColorManager;
import com.google.dart.tools.ui.text.IDartColorConstants;
+import static com.google.dart.compiler.parser.Token.AS;
import static com.google.dart.compiler.parser.Token.BREAK;
import static com.google.dart.compiler.parser.Token.ELLIPSIS;
import static com.google.dart.compiler.parser.Token.IS;
@@ -193,8 +194,8 @@
}
@SuppressWarnings("unused")
- private static class VersionedWordMatcher extends CombinedWordRule.WordMatcher implements
- ISourceVersionDependent {
+ private static class VersionedWordMatcher extends CombinedWordRule.WordMatcher
+ implements ISourceVersionDependent {
private final IToken fDefaultToken;
private final String fVersion;
@@ -235,15 +236,16 @@
com.google.dart.compiler.parser.Token[] tokens = com.google.dart.compiler.parser.Token.values();
for (int i = 0; i < tokens.length; i++) {
com.google.dart.compiler.parser.Token token = tokens[i];
- if ((BREAK.ordinal() <= token.ordinal() && token.ordinal() <= WHILE.ordinal())
- || (token.ordinal() == IS.ordinal())) {
+ if ((BREAK.ordinal() <= token.ordinal() && token.ordinal() <= WHILE.ordinal()) ||
+ token.ordinal() == AS.ordinal() || token.ordinal() == IS.ordinal()) {
keywords.add(token.getSyntax());
} else if ((LIBRARY.ordinal() <= token.ordinal()) && (token.ordinal() <= NATIVE.ordinal())) {
String name = token.getSyntax();
directives.add(name.substring(1));
}
- if (token.isBinaryOperator() || token.isUnaryOperator()
- || (token.ordinal() == ELLIPSIS.ordinal()) && (token.ordinal() != IS.ordinal())) {
+ if (token.isBinaryOperator() || token.isUnaryOperator() || token.ordinal()
+ == ELLIPSIS.ordinal() && token.ordinal() != AS.ordinal() && token.ordinal()
+ != IS.ordinal()) {
operators.add(token.getSyntax());
}
}
@@ -259,8 +261,8 @@
private static String[] fgConstants = {"false", "null", "true"}; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- private static final String ANNOTATION_BASE_KEY = PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX
- + SemanticHighlightings.ANNOTATION;
+ private static final String ANNOTATION_BASE_KEY =
+ PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + SemanticHighlightings.ANNOTATION;
private static final String ANNOTATION_COLOR_KEY = ANNOTATION_BASE_KEY
+ PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_COLOR_SUFFIX;
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698