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

Unified Diff: runtime/vm/parser.cc

Issue 14791005: BREAKING CHANGE: enforce part of directive (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/object_test.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 22269)
+++ runtime/vm/parser.cc (working copy)
@@ -4439,28 +4439,23 @@
void Parser::ParsePartHeader() {
- intptr_t metadata_pos = TokenPos();
SkipMetadata();
- // TODO(hausner): Once support for old #source directive is removed
- // from the compiler, add an error message here if we don't find
- // a 'part of' directive.
- if (CurrentToken() == Token::kPART) {
+ if (CurrentToken() != Token::kPART) {
+ ErrorMsg("'part of' expected");
+ }
+ ConsumeToken();
+ if (!IsLiteral("of")) {
+ ErrorMsg("'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();
- if (!IsLiteral("of")) {
- ErrorMsg("'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");
- }
- ExpectSemicolon();
- } else {
- SetPosition(metadata_pos);
+ ExpectIdentifier("malformed library name");
}
+ ExpectSemicolon();
}
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698