Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |