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

Unified Diff: runtime/vm/parser.cc

Issue 1201523002: Library prefix is a primary expression in the newest spec (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/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
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 387bb6033014c950f0121eba5fe6521c72bb89f5..a8fc76ad3a71ae0f5dbf94083c425e14cffb157e 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -969,8 +969,8 @@ RawArray* Parser::EvaluateMetadata() {
ExpectIdentifier("identifier expected");
}
// Reject expressions with deferred library prefix eagerly.
- Object& obj = Object::Handle(Z,
- library_.LookupLocalObject(*CurrentLiteral()));
+ Object& obj =
+ Object::Handle(Z, library_.LookupLocalObject(*CurrentLiteral()));
if (!obj.IsNull() && obj.IsLibraryPrefix()) {
if (LibraryPrefix::Cast(obj).is_deferred_load()) {
ReportError("Metadata must be compile-time constant");
@@ -11777,8 +11777,13 @@ AstNode* Parser::ResolveIdentInCurrentLibraryScope(intptr_t ident_pos,
} else {
return new(Z) PrimaryNode(ident_pos, Function::ZoneHandle(Z, func.raw()));
}
+ } else if (obj.IsLibraryPrefix()) {
+ const LibraryPrefix& prefix = LibraryPrefix::Cast(obj);
+ ReportError(ident_pos,
+ "illegal use of library prefix '%s'",
+ String::Handle(prefix.name()).ToCString());
} else {
- ASSERT(obj.IsNull() || obj.IsLibraryPrefix());
+ ASSERT(obj.IsNull());
}
// Lexically unresolved primary identifiers are referenced by their name.
return new(Z) PrimaryNode(ident_pos, ident);
« 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