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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParser.java

Issue 11428131: More co19 triage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « no previous file | compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/parser/DartParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index 591c54ac8bf76fc3d5462b1fa0ea15e806606167..ed137259283783b510100477d4f7c9137baa55dc 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -112,6 +112,7 @@ import com.google.dart.compiler.util.apache.StringUtils;
import java.io.IOException;
import java.io.Reader;
import java.math.BigInteger;
+import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -233,6 +234,17 @@ public class DartParser extends CompletionHooksParserBase {
this.isDietParse = isDietParse;
this.prefixes = prefixes;
this.allowNativeKeyword = source != null && PackageLibraryManager.isDartUri(source.getUri());
+ // check Unicode normalization
+ {
+ int indexOfDifference = StringUtils.indexOfDifference(sourceCode,
+ Normalizer.normalize(sourceCode, Normalizer.Form.NFC));
+ if (indexOfDifference != -1) {
+ DartCompilationError error = new DartCompilationError(source, new Location(
+ indexOfDifference, indexOfDifference + 1),
+ ParserErrorCode.INVALID_UNICODE_NORMALIZATION);
+ ctx.error(error);
+ }
+ }
}
public static String read(Source source) throws IOException {
@@ -4760,6 +4772,9 @@ public class DartParser extends CompletionHooksParserBase {
if (optional(Token.VAR)) {
setup = done(new DartVariableStatement(parseInitializedVariableList(), null, modifiers));
} else {
+ if (optional(Token.CONST)) {
+ modifiers = modifiers.makeConstant();
+ }
if (optional(Token.FINAL)) {
modifiers = modifiers.makeFinal();
}
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698