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

Unified Diff: runtime/vm/parser.cc

Issue 2292213002: Remove legacy patch class syntax in VM (Closed)
Patch Set: Created 4 years, 4 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 | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 4617d2aaecd91d8a7506608394072f23b471f87e..8d375560576c87e3180190236686368eb01b3660 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4634,14 +4634,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();
@@ -4826,11 +4818,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);
@@ -5707,15 +5695,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;
@@ -5847,14 +5826,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;
@@ -6398,9 +6369,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()) {
@@ -8366,18 +8334,10 @@ bool Parser::IsFunctionDeclaration() {
bool is_external = false;
TokenPosScope decl_pos(this);
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();
}
const TokenPosition type_or_name_pos = TokenPos();
if (TryParseReturnType()) {
@@ -8417,9 +8377,7 @@ bool Parser::IsFunctionDeclaration() {
bool Parser::IsTopLevelAccessor() {
const TokenPosScope saved_pos(this);
- 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)) {
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698