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

Side by Side Diff: runtime/vm/parser.cc

Issue 19763007: Use library prefixes in scope of the mixin class when compiling a functions of (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/mixin_prefix_lib.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 qual_ident->ident = CurrentLiteral(); 2791 qual_ident->ident = CurrentLiteral();
2792 qual_ident->lib_prefix = NULL; 2792 qual_ident->lib_prefix = NULL;
2793 ConsumeToken(); 2793 ConsumeToken();
2794 if (CurrentToken() == Token::kPERIOD) { 2794 if (CurrentToken() == Token::kPERIOD) {
2795 // An identifier cannot be resolved in a local scope when top level parsing. 2795 // An identifier cannot be resolved in a local scope when top level parsing.
2796 if (is_top_level_ || 2796 if (is_top_level_ ||
2797 !ResolveIdentInLocalScope(qual_ident->ident_pos, 2797 !ResolveIdentInLocalScope(qual_ident->ident_pos,
2798 *(qual_ident->ident), 2798 *(qual_ident->ident),
2799 NULL)) { 2799 NULL)) {
2800 LibraryPrefix& lib_prefix = LibraryPrefix::ZoneHandle(); 2800 LibraryPrefix& lib_prefix = LibraryPrefix::ZoneHandle();
2801 lib_prefix = current_class().LookupLibraryPrefix(*(qual_ident->ident)); 2801 if (current_class().mixin() == Type::null()) {
Ivan Posva 2013/07/19 19:00:25 Please add a TODO to figure out why we are not usi
2802 lib_prefix = current_class().LookupLibraryPrefix(*(qual_ident->ident));
2803 } else {
2804 Class& cls = Class::Handle(parsed_function()->function().origin());
2805 lib_prefix = cls.LookupLibraryPrefix(*(qual_ident->ident));
2806 }
2802 if (!lib_prefix.IsNull()) { 2807 if (!lib_prefix.IsNull()) {
2803 // We have a library prefix qualified identifier, unless the prefix is 2808 // We have a library prefix qualified identifier, unless the prefix is
2804 // shadowed by a type parameter in scope. 2809 // shadowed by a type parameter in scope.
2805 if (current_class().IsNull() || 2810 if (current_class().IsNull() ||
2806 (current_class().LookupTypeParameter(*(qual_ident->ident)) == 2811 (current_class().LookupTypeParameter(*(qual_ident->ident)) ==
2807 TypeParameter::null())) { 2812 TypeParameter::null())) {
2808 ConsumeToken(); // Consume the kPERIOD token. 2813 ConsumeToken(); // Consume the kPERIOD token.
2809 qual_ident->lib_prefix = &lib_prefix; 2814 qual_ident->lib_prefix = &lib_prefix;
2810 qual_ident->ident_pos = TokenPos(); 2815 qual_ident->ident_pos = TokenPos();
2811 qual_ident->ident = 2816 qual_ident->ident =
(...skipping 7390 matching lines...) Expand 10 before | Expand all | Expand 10 after
10202 void Parser::SkipQualIdent() { 10207 void Parser::SkipQualIdent() {
10203 ASSERT(IsIdentifier()); 10208 ASSERT(IsIdentifier());
10204 ConsumeToken(); 10209 ConsumeToken();
10205 if (CurrentToken() == Token::kPERIOD) { 10210 if (CurrentToken() == Token::kPERIOD) {
10206 ConsumeToken(); // Consume the kPERIOD token. 10211 ConsumeToken(); // Consume the kPERIOD token.
10207 ExpectIdentifier("identifier expected after '.'"); 10212 ExpectIdentifier("identifier expected after '.'");
10208 } 10213 }
10209 } 10214 }
10210 10215
10211 } // namespace dart 10216 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/mixin_prefix_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698