Chromium Code Reviews| 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(); |