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

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

Issue 9585003: Update native keyword checking to accommodate frog (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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/parser/NegativeParserTest.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 4968)
+++ compiler/java/com/google/dart/compiler/parser/DartParser.java (working copy)
@@ -617,7 +617,8 @@
DartStringLiteral nativeName = null;
if (optionalPseudoKeyword(NATIVE_KEYWORD)) {
if (superType != null) {
- reportError(position(), ParserErrorCode.NATIVE_MUST_NOT_EXTEND);
+ // dom_frog.dart has this situation
+ //reportError(position(), ParserErrorCode.NATIVE_MUST_NOT_EXTEND);
}
if (isParsingInterface) {
reportError(position(), ParserErrorCode.NATIVE_ONLY_CLASS);
@@ -1212,15 +1213,16 @@
if (!corelibParse) {
reportError(position(), ParserErrorCode.NATIVE_ONLY_CORE_LIB);
}
- if (optional(Token.SEMICOLON)) {
- return done(new DartNativeBlock());
- } else if (match(Token.LBRACE) || match(Token.ARROW)) {
- if (!modifiers.isStatic()) {
- reportError(position(), ParserErrorCode.EXPORTED_FUNCTIONS_MUST_BE_STATIC);
- }
+ if (match(Token.STRING)) {
+ parseString();
+ }
+ if (match(Token.LBRACE) || match(Token.ARROW)) {
+ // dom_frog.dart has non-static native methods with string and block
+ //if (!modifiers.isStatic()) {
+ // reportError(position(), ParserErrorCode.EXPORTED_FUNCTIONS_MUST_BE_STATIC);
+ //}
return done(parseFunctionStatementBody(true));
} else {
- parseString();
expect(Token.SEMICOLON);
return done(new DartNativeBlock());
}
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698