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

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

Issue 10915071: Fix for issue 4835 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « no previous file | compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.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
===================================================================
--- compiler/java/com/google/dart/compiler/parser/DartParser.java (revision 11842)
+++ compiler/java/com/google/dart/compiler/parser/DartParser.java (working copy)
@@ -137,6 +137,7 @@
// Pseudo-keywords that should also be valid identifiers.
private static final String ABSTRACT_KEYWORD = "abstract";
+ private static final String AS_KEYWORD = "as";
private static final String ASSERT_KEYWORD = "assert";
private static final String CALL_KEYWORD = "call";
private static final String DYNAMIC_KEYWORD = "Dynamic";
@@ -165,6 +166,7 @@
public static final String[] PSEUDO_KEYWORDS = {
ABSTRACT_KEYWORD,
+ AS_KEYWORD,
ASSERT_KEYWORD,
DYNAMIC_KEYWORD,
EQUALS_KEYWORD,
@@ -2770,6 +2772,9 @@
*/
private DartExpression parseLiteral() {
beginLiteral();
+ if (PSEUDO_KEYWORDS_SET.contains(peek(0).getSyntax())) {
+ return done(parseIdentifier());
+ }
switch (peek(0)) {
case NULL_LITERAL: {
consume(Token.NULL_LITERAL);
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698