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

Unified Diff: runtime/vm/parser.cc

Issue 11316283: Eliminate old style import from language tests (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/language/application_negative_test.dart » ('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 15598)
+++ runtime/vm/parser.cc (working copy)
@@ -4073,10 +4073,17 @@
void Parser::ParseLibraryName() {
ASSERT(CurrentToken() == Token::kLIBRARY);
ConsumeToken();
- // TODO(hausner): Exact syntax of library name still unclear: identifier,
- // qualified identifier or even multiple dots allowed? For now we just
- // accept simple identifiers.
- const String& lib_name = *ExpectIdentifier("library name expected");
+ String& lib_name = *ExpectIdentifier("library name expected");
+ if (CurrentToken() == Token::kPERIOD) {
+ const String& dot = String::Handle(Symbols::Dot());
+ while (CurrentToken() == Token::kPERIOD) {
+ ConsumeToken();
+ lib_name = String::Concat(lib_name, dot);
+ lib_name = String::Concat(lib_name,
+ *ExpectIdentifier("malformed library name"));
+ }
+ lib_name = Symbols::New(lib_name);
+ }
library_.SetName(lib_name);
ExpectSemicolon();
}
@@ -4114,7 +4121,7 @@
String& prefix = String::Handle();
if (is_import && IsLiteral("as")) {
ConsumeToken();
- prefix = ExpectIdentifier("prefix expected")->raw();
+ prefix = ExpectIdentifier("prefix identifier expected")->raw();
}
Array& show_names = Array::Handle();
@@ -4283,12 +4290,13 @@
ErrorMsg("'part of' expected");
}
ConsumeToken();
- // TODO(hausner): Exact syntax of library name still unclear: identifier,
- // qualified identifier or even multiple dots allowed? For now we just
- // accept simple identifiers.
// 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);
« no previous file with comments | « no previous file | tests/language/application_negative_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698