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 "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
(...skipping 8183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8194 // imported libraries. | 8194 // imported libraries. |
8195 String& first_lib_url = String::Handle(); | 8195 String& first_lib_url = String::Handle(); |
8196 Namespace& import = Namespace::Handle(); | 8196 Namespace& import = Namespace::Handle(); |
8197 intptr_t num_imports = library_.num_imports(); | 8197 intptr_t num_imports = library_.num_imports(); |
8198 Object& imported_obj = Object::Handle(); | 8198 Object& imported_obj = Object::Handle(); |
8199 for (int i = 0; i < num_imports; i++) { | 8199 for (int i = 0; i < num_imports; i++) { |
8200 import = library_.ImportAt(i); | 8200 import = library_.ImportAt(i); |
8201 imported_obj = LookupNameInImport(import, name); | 8201 imported_obj = LookupNameInImport(import, name); |
8202 if (!imported_obj.IsNull()) { | 8202 if (!imported_obj.IsNull()) { |
8203 const Library& lib = Library::Handle(import.library()); | 8203 const Library& lib = Library::Handle(import.library()); |
8204 if (!first_lib_url.IsNull()) { | 8204 if (!first_lib_url.IsNull() |
regis
2013/02/06 19:40:48
I would add a TODO here to remove this temporary c
floitsch
2013/02/11 17:59:32
Yes. I will add a TODO(issue-number) once I have f
| |
8205 && (strcmp(name.ToCString(), "Expect") != 0) | |
8206 && (strcmp(name.ToCString(), "ExpectException") != 0)) { | |
8205 // Found duplicate definition. | 8207 // Found duplicate definition. |
8206 Error& ambiguous_ref_error = Error::Handle(); | 8208 Error& ambiguous_ref_error = Error::Handle(); |
8207 if (first_lib_url.raw() == lib.url()) { | 8209 if (first_lib_url.raw() == lib.url()) { |
8208 ambiguous_ref_error = FormatErrorMsg( | 8210 ambiguous_ref_error = FormatErrorMsg( |
8209 script_, ident_pos, "Error", | 8211 script_, ident_pos, "Error", |
8210 "ambiguous reference: " | 8212 "ambiguous reference: " |
8211 "'%s' as library '%s' is imported multiple times", | 8213 "'%s' as library '%s' is imported multiple times", |
8212 name.ToCString(), | 8214 name.ToCString(), |
8213 first_lib_url.ToCString()); | 8215 first_lib_url.ToCString()); |
8214 } else { | 8216 } else { |
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9759 void Parser::SkipQualIdent() { | 9761 void Parser::SkipQualIdent() { |
9760 ASSERT(IsIdentifier()); | 9762 ASSERT(IsIdentifier()); |
9761 ConsumeToken(); | 9763 ConsumeToken(); |
9762 if (CurrentToken() == Token::kPERIOD) { | 9764 if (CurrentToken() == Token::kPERIOD) { |
9763 ConsumeToken(); // Consume the kPERIOD token. | 9765 ConsumeToken(); // Consume the kPERIOD token. |
9764 ExpectIdentifier("identifier expected after '.'"); | 9766 ExpectIdentifier("identifier expected after '.'"); |
9765 } | 9767 } |
9766 } | 9768 } |
9767 | 9769 |
9768 } // namespace dart | 9770 } // namespace dart |
OLD | NEW |