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

Unified Diff: runtime/vm/parser.cc

Issue 23437007: Remember metadata positions for mixin and function typedefs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase 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 | « runtime/vm/parser.h ('k') | 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 82c9349e76c5666fa0b01052a289bfa2192c0003..ada22fcae807a832db43eb7a741d75fedcc2355e 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -3824,7 +3824,8 @@ void Parser::CheckConstructors(ClassDesc* class_desc) {
}
-void Parser::ParseMixinTypedef(const GrowableObjectArray& pending_classes) {
+void Parser::ParseMixinTypedef(const GrowableObjectArray& pending_classes,
+ intptr_t metadata_pos) {
TRACE_PARSER("ParseMixinTypedef");
const intptr_t classname_pos = TokenPos();
String& class_name = *ExpectUserDefinedTypeIdentifier("class name expected");
@@ -3877,6 +3878,9 @@ void Parser::ParseMixinTypedef(const GrowableObjectArray& pending_classes) {
}
ExpectSemicolon();
pending_classes.Add(mixin_application, Heap::kOld);
+ if (metadata_pos >= 0) {
+ library_.AddClassMetadata(mixin_application, metadata_pos);
+ }
}
@@ -3920,12 +3924,13 @@ bool Parser::IsMixinTypedef() {
}
-void Parser::ParseTypedef(const GrowableObjectArray& pending_classes) {
+void Parser::ParseTypedef(const GrowableObjectArray& pending_classes,
+ intptr_t metadata_pos) {
TRACE_PARSER("ParseTypedef");
ExpectToken(Token::kTYPEDEF);
if (IsMixinTypedef()) {
- ParseMixinTypedef(pending_classes);
+ ParseMixinTypedef(pending_classes, metadata_pos);
return;
}
@@ -4032,6 +4037,9 @@ void Parser::ParseTypedef(const GrowableObjectArray& pending_classes) {
ASSERT(!function_type_alias.IsCanonicalSignatureClass());
ASSERT(!function_type_alias.is_finalized());
pending_classes.Add(function_type_alias, Heap::kOld);
+ if (metadata_pos >= 0) {
+ library_.AddClassMetadata(function_type_alias, metadata_pos);
+ }
}
@@ -4886,7 +4894,7 @@ void Parser::ParseTopLevel() {
} else if ((CurrentToken() == Token::kTYPEDEF) &&
(LookaheadToken(1) != Token::kLPAREN)) {
set_current_class(toplevel_class);
- ParseTypedef(pending_classes);
+ ParseTypedef(pending_classes, metadata_pos);
} else if ((CurrentToken() == Token::kABSTRACT) &&
(LookaheadToken(1) == Token::kCLASS)) {
ParseClassDeclaration(pending_classes, metadata_pos);
« no previous file with comments | « runtime/vm/parser.h ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698