| 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 e6991477d572364f50998da1e078e47c0856ef91..54860e913a473bee8488f77682ae607aa5c9e6e1 100644
|
| --- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| +++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| @@ -332,6 +332,13 @@ public class DartParser extends CompletionHooksParserBase {
|
| } else if (peekPseudoKeyword(0, INTERFACE_KEYWORD) && peek(1).equals(Token.IDENTIFIER)) {
|
| consume(Token.IDENTIFIER);
|
| isParsingInterface = true;
|
| + // TODO(scheglov) remove after http://code.google.com/p/dart/issues/detail?id=6318
|
| + if (!Elements.isCoreLibrarySource(source)
|
| + && !Elements.isLibrarySource(source, "/isolate/isolate.dart")
|
| + && !Elements.isLibrarySource(source, "crypto/crypto.dart")
|
| + && !Elements.isDart2JsLibrarySource(source)) {
|
| + reportError(position(), ParserErrorCode.DEPRECATED_INTERFACE);
|
| + }
|
| node = done(parseClass());
|
| } else if (peekPseudoKeyword(0, TYPEDEF_KEYWORD)
|
| && (peek(1).equals(Token.IDENTIFIER) || peek(1).equals(Token.VOID) || peek(1).equals(Token.AS))) {
|
| @@ -1258,14 +1265,16 @@ public class DartParser extends CompletionHooksParserBase {
|
| }
|
| }
|
| if (optionalPseudoKeyword(ABSTRACT_KEYWORD)) {
|
| - if (isParsingInterface) {
|
| - reportError(position(), ParserErrorCode.ABSTRACT_MEMBER_IN_INTERFACE);
|
| - }
|
| - if (modifiers.isStatic()) {
|
| - reportError(position(), ParserErrorCode.STATIC_MEMBERS_CANNOT_BE_ABSTRACT);
|
| - }
|
| - if (modifiers.isExternal()) {
|
| - reportError(position(), ParserErrorCode.EXTERNAL_ABSTRACT);
|
| + // TODO(scheglov) remove after http://code.google.com/p/dart/issues/detail?id=6322
|
| + // TODO(scheglov) remove after http://code.google.com/p/dart/issues/detail?id=6323
|
| + if (!Elements.isCoreLibrarySource(source)
|
| + && !Elements.isLibrarySource(source, "html/dartium/html_dartium.dart")
|
| + && !Elements.isLibrarySource(source, "/math/math.dart")
|
| + && !Elements.isLibrarySource(source, "/io/io_runtime.dart")
|
| + && !Elements.isLibrarySource(source, "/crypto/crypto.dart")
|
| + && !Elements.isLibrarySource(source, "/utf/utf.dart")
|
| + && !Elements.isDart2JsLibrarySource(source)) {
|
| + reportError(position(), ParserErrorCode.DEPRECATED_ABSTRACT_METHOD);
|
| }
|
| modifiers = modifiers.makeAbstract();
|
| }
|
| @@ -1276,17 +1285,11 @@ public class DartParser extends CompletionHooksParserBase {
|
| if (modifiers.isStatic()) {
|
| reportError(position(), ParserErrorCode.FACTORY_CANNOT_BE_STATIC);
|
| }
|
| - if (modifiers.isAbstract()) {
|
| - reportError(position(), ParserErrorCode.FACTORY_CANNOT_BE_ABSTRACT);
|
| - }
|
|
|
| modifiers = modifiers.makeFactory();
|
| }
|
|
|
| if (match(Token.VAR) || match(Token.FINAL)) {
|
| - if (modifiers.isAbstract()) {
|
| - reportError(position(), ParserErrorCode.DISALLOWED_ABSTRACT_KEYWORD);
|
| - }
|
| if (modifiers.isFactory()) {
|
| reportError(position(), ParserErrorCode.DISALLOWED_FACTORY_KEYWORD);
|
| }
|
| @@ -1595,9 +1598,6 @@ public class DartParser extends CompletionHooksParserBase {
|
| DartExpression name = new DartIdentifier("");
|
|
|
| if (modifiers.isFactory()) {
|
| - if (modifiers.isAbstract()) {
|
| - reportError(position(), ParserErrorCode.FACTORY_CANNOT_BE_ABSTRACT);
|
| - }
|
| if (modifiers.isStatic()) {
|
| reportError(position(), ParserErrorCode.FACTORY_CANNOT_BE_STATIC);
|
| }
|
| @@ -1808,9 +1808,6 @@ public class DartParser extends CompletionHooksParserBase {
|
| if (isParsingInterface) {
|
| reportError(method.getName(), ParserErrorCode.INTERFACE_METHOD_WITH_BODY);
|
| }
|
| - if (method.getModifiers().isAbstract()) {
|
| - reportError(method.getName(), ParserErrorCode.ABSTRACT_METHOD_WITH_BODY);
|
| - }
|
| }
|
| // If getter or setter, generate DartFieldDefinition instead.
|
| if (method.getModifiers().isGetter() || method.getModifiers().isSetter()) {
|
|
|