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

Unified Diff: runtime/vm/parser.cc

Issue 2073223002: Improve error message for illegal part of declarations (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | 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 5f95f352541511b4efafc4fe523882e4e72b7547..e682207680984eeae35eb3ab5de4868482ba30e3 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -6062,6 +6062,9 @@ void Parser::ParseLibraryImportExport(const Object& tl_owner,
void Parser::ParseLibraryPart() {
const TokenPosition source_pos = TokenPos();
ConsumeToken(); // Consume "part".
+ if (IsSymbol(Symbols::Of())) {
+ ReportError("part of declarations are not allowed in script files");
+ }
CheckToken(Token::kSTRING, "url expected");
AstNode* url_literal = ParseStringLiteral(false);
ASSERT(url_literal->IsLiteralNode());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698