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

Unified Diff: runtime/vm/parser.cc

Issue 8804019: Support qualified factory names (fix issue 514). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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/language.status » ('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 2084)
+++ runtime/vm/parser.cc (working copy)
@@ -2326,9 +2326,20 @@
// finalization, so that the list of type parameters in the factory
// signature can be checked at the same time.
if (member.has_factory) {
+ String& qualifier = String::Handle();
+ if (CurrentToken() == Token::kPERIOD) {
+ LibraryPrefix& lib_prefix = LibraryPrefix::ZoneHandle();
+ lib_prefix = current_class().LookupLibraryPrefix(*member.name);
+ if (!lib_prefix.IsNull()) {
+ // We have a library prefix qualified identifier.
+ ConsumeToken(); // Consume the kPERIOD token.
+ qualifier ^= member.name->raw();
+ member.name = ExpectIdentifier("identifier expected");
+ }
+ }
const UnresolvedClass& unresolved_factory_class =
UnresolvedClass::Handle(UnresolvedClass::New(member.name_pos,
- String::Handle(),
+ qualifier,
*(member.name)));
const Class& signature_class = Class::Handle(
Class::New(String::Handle(String::NewSymbol(":factory_signature")),
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698