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

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

Issue 8441001: Prefix string literal must be identifier (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updates Created 9 years, 1 month 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 9b42acb205fb4d9c924235cae9499006a872964b..4b45d4a19c2ec0c8c88af86c91dcdc41b9358e6f 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -376,6 +376,11 @@ public class DartParser extends CompletionHooksParserBase {
expect(Token.COLON);
beginLiteral();
expect(Token.STRING);
+ String id = ctx.getTokenString();
+ // The specification requires the value of this string be a valid identifier
+ if(id == null || !id.matches("[_a-zA-Z]([_A-Za-z0-9]*)")) {
codefu 2011/11/02 16:04:59 Looking further at the spec and searching for just
+ reportError(position(), ParserErrorCode.EXPECTED_PREFIX_IDENTIFIER);
+ }
prefix = done(DartStringLiteral.get(ctx.getTokenString()));
}
expectCloseParen();
« 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