| Index: runtime/vm/parser.cc
|
| diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
|
| index 3dc119a778d705830b1b8e7dc15161bc0b160140..1e6951835859a583eca9cd0c5d0f551f4bbb630f 100644
|
| --- a/runtime/vm/parser.cc
|
| +++ b/runtime/vm/parser.cc
|
| @@ -4567,14 +4567,6 @@ void Parser::ParseClassDeclaration(const GrowableObjectArray& pending_classes,
|
| is_patch = true;
|
| metadata_pos = TokenPosition::kNoSource;
|
| declaration_pos = TokenPos();
|
| - } else if (is_patch_source() &&
|
| - (CurrentToken() == Token::kIDENT) &&
|
| - CurrentLiteral()->Equals("patch")) {
|
| - if (FLAG_warn_patch) {
|
| - ReportWarning("deprecated use of patch 'keyword'");
|
| - }
|
| - ConsumeToken();
|
| - is_patch = true;
|
| } else if (CurrentToken() == Token::kABSTRACT) {
|
| is_abstract = true;
|
| ConsumeToken();
|
| @@ -4759,11 +4751,7 @@ void Parser::ParseClassDefinition(const Class& cls) {
|
| is_top_level_ = true;
|
| String& class_name = String::Handle(Z, cls.Name());
|
| SkipMetadata();
|
| - if (is_patch_source() &&
|
| - (CurrentToken() == Token::kIDENT) &&
|
| - CurrentLiteral()->Equals("patch")) {
|
| - ConsumeToken();
|
| - } else if (CurrentToken() == Token::kABSTRACT) {
|
| + if (CurrentToken() == Token::kABSTRACT) {
|
| ConsumeToken();
|
| }
|
| ExpectToken(Token::kCLASS);
|
| @@ -5646,15 +5634,6 @@ void Parser::ParseTopLevelFunction(TopLevel* top_level,
|
| if (is_patch_source() && IsPatchAnnotation(metadata_pos)) {
|
| is_patch = true;
|
| metadata_pos = TokenPosition::kNoSource;
|
| - } else if (is_patch_source() &&
|
| - (CurrentToken() == Token::kIDENT) &&
|
| - CurrentLiteral()->Equals("patch") &&
|
| - (LookaheadToken(1) != Token::kLPAREN)) {
|
| - if (FLAG_warn_patch) {
|
| - ReportWarning("deprecated use of patch 'keyword'");
|
| - }
|
| - ConsumeToken();
|
| - is_patch = true;
|
| } else if (CurrentToken() == Token::kEXTERNAL) {
|
| ConsumeToken();
|
| is_external = true;
|
| @@ -5775,14 +5754,6 @@ void Parser::ParseTopLevelAccessor(TopLevel* top_level,
|
| if (is_patch_source() && IsPatchAnnotation(metadata_pos)) {
|
| is_patch = true;
|
| metadata_pos = TokenPosition::kNoSource;
|
| - } else if (is_patch_source() &&
|
| - (CurrentToken() == Token::kIDENT) &&
|
| - CurrentLiteral()->Equals("patch")) {
|
| - if (FLAG_warn_patch) {
|
| - ReportWarning("deprecated use of patch 'keyword'");
|
| - }
|
| - ConsumeToken();
|
| - is_patch = true;
|
| } else if (CurrentToken() == Token::kEXTERNAL) {
|
| ConsumeToken();
|
| is_external = true;
|
| @@ -6326,9 +6297,6 @@ void Parser::ParseTopLevel() {
|
| } else if ((CurrentToken() == Token::kABSTRACT) &&
|
| (LookaheadToken(1) == Token::kCLASS)) {
|
| ParseClassDeclaration(pending_classes, tl_owner, metadata_pos);
|
| - } else if (is_patch_source() && IsSymbol(Symbols::Patch()) &&
|
| - (LookaheadToken(1) == Token::kCLASS)) {
|
| - ParseClassDeclaration(pending_classes, tl_owner, metadata_pos);
|
| } else {
|
| set_current_class(toplevel_class);
|
| if (IsVariableDeclaration()) {
|
| @@ -8193,18 +8161,10 @@ bool Parser::IsFunctionDeclaration() {
|
| const TokenPosition saved_pos = TokenPos();
|
| bool is_external = false;
|
| SkipMetadata();
|
| - if (is_top_level_) {
|
| - if (is_patch_source() &&
|
| - (CurrentToken() == Token::kIDENT) &&
|
| - CurrentLiteral()->Equals("patch") &&
|
| - (LookaheadToken(1) != Token::kLPAREN)) {
|
| - // Skip over 'patch' for top-level function declarations in patch sources.
|
| - ConsumeToken();
|
| - } else if (CurrentToken() == Token::kEXTERNAL) {
|
| - // Skip over 'external' for top-level function declarations.
|
| - is_external = true;
|
| - ConsumeToken();
|
| - }
|
| + if (is_top_level_ && (CurrentToken() == Token::kEXTERNAL)) {
|
| + // Skip over 'external' for top-level function declarations.
|
| + is_external = true;
|
| + ConsumeToken();
|
| }
|
| if (IsIdentifier() && (LookaheadToken(1) == Token::kLPAREN)) {
|
| // Possibly a function without explicit return type.
|
| @@ -8239,9 +8199,7 @@ bool Parser::IsFunctionDeclaration() {
|
|
|
| bool Parser::IsTopLevelAccessor() {
|
| const TokenPosition saved_pos = TokenPos();
|
| - if (is_patch_source() && IsSymbol(Symbols::Patch())) {
|
| - ConsumeToken();
|
| - } else if (CurrentToken() == Token::kEXTERNAL) {
|
| + if (CurrentToken() == Token::kEXTERNAL) {
|
| ConsumeToken();
|
| }
|
| if ((CurrentToken() == Token::kGET) || (CurrentToken() == Token::kSET)) {
|
|
|