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

Unified Diff: runtime/vm/parser.cc

Issue 22460008: Fix attempt to find metadata of a library with no metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | tests/lib/lib.status » ('j') | 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 0e38fdae88fab86ffc3a8738006b367bc90e3f49..3041bbaba7ac6864b6ff17491c2592f05d93e093 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4743,8 +4743,8 @@ void Parser::ParseLibraryDefinition() {
// declaration that follows the library definitions. Therefore, we
// need to remember the position of the last token that was
// successfully consumed.
- intptr_t metadata_pos = TokenPos();
- SkipMetadata();
+ intptr_t pre_metadata_pos = TokenPos();
rmacnak 2013/08/07 23:30:37 Questionable name
hausner 2013/08/08 07:55:17 How about naming it rewind_pos or fallback_pos? O
rmacnak 2013/08/08 16:49:28 Much better.
+ intptr_t metadata_pos = SkipMetadata();
if (CurrentToken() == Token::kLIBRARY) {
if (is_patch_source()) {
ErrorMsg("patch cannot override library name");
@@ -4753,13 +4753,13 @@ void Parser::ParseLibraryDefinition() {
if (metadata_pos >= 0) {
library_.AddLibraryMetadata(current_class(), metadata_pos);
}
- metadata_pos = TokenPos();
+ pre_metadata_pos = TokenPos();
SkipMetadata();
hausner 2013/08/08 07:55:17 Even though we are not using the metadata for impo
rmacnak 2013/08/08 16:49:28 Got 'em.
}
while ((CurrentToken() == Token::kIMPORT) ||
(CurrentToken() == Token::kEXPORT)) {
ParseLibraryImportExport();
- metadata_pos = TokenPos();
+ pre_metadata_pos = TokenPos();
SkipMetadata();
hausner 2013/08/08 07:55:17 ditto
}
// Core lib has not been explicitly imported, so we implicitly
@@ -4773,10 +4773,10 @@ void Parser::ParseLibraryDefinition() {
}
while (CurrentToken() == Token::kPART) {
ParseLibraryPart();
- metadata_pos = TokenPos();
+ pre_metadata_pos = TokenPos();
SkipMetadata();
hausner 2013/08/08 07:55:17 ditto
}
- SetPosition(metadata_pos);
+ SetPosition(pre_metadata_pos);
}
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698