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

Unified Diff: runtime/vm/parser.cc

Issue 2640853005: Make Analyzer, VM and dart2js accept URI strings as part-of library identifier. (Closed)
Patch Set: Add tests, enable flag by default in analyzer. Created 3 years, 11 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
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 923526885ecea9685b32b527aa03bcd12b6b9592..2bde07453445bf8c21364fccde3fb073bfc70302 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -6194,12 +6194,16 @@ void Parser::ParsePartHeader() {
ReportError("'part of' expected");
}
ConsumeToken();
- // The VM is not required to check that the library name matches the
- // name of the current library, so we ignore it.
- ExpectIdentifier("library name expected");
- while (CurrentToken() == Token::kPERIOD) {
- ConsumeToken();
- ExpectIdentifier("malformed library name");
+ // The VM is not required to check that the library name or URI matches the
+ // name or URI of the current library, so we ignore them.
+ if (CurrentToken() == Token::kSTRING) {
+ ParseStringLiteral(false);
+ } else {
+ ExpectIdentifier("library name expected");
+ while (CurrentToken() == Token::kPERIOD) {
+ ConsumeToken();
+ ExpectIdentifier("malformed library name");
+ }
}
ExpectSemicolon();
}

Powered by Google App Engine
This is Rietveld 408576698