| 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 8335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8346 String& first_lib_url = String::Handle(); | 8346 String& first_lib_url = String::Handle(); |
| 8347 Namespace& import = Namespace::Handle(); | 8347 Namespace& import = Namespace::Handle(); |
| 8348 intptr_t num_imports = library_.num_imports(); | 8348 intptr_t num_imports = library_.num_imports(); |
| 8349 Object& imported_obj = Object::Handle(); | 8349 Object& imported_obj = Object::Handle(); |
| 8350 Library& lib = Library::Handle(); | 8350 Library& lib = Library::Handle(); |
| 8351 for (int i = 0; i < num_imports; i++) { | 8351 for (int i = 0; i < num_imports; i++) { |
| 8352 import = library_.ImportAt(i); | 8352 import = library_.ImportAt(i); |
| 8353 imported_obj = LookupNameInImport(import, name); | 8353 imported_obj = LookupNameInImport(import, name); |
| 8354 if (!imported_obj.IsNull()) { | 8354 if (!imported_obj.IsNull()) { |
| 8355 lib ^= import.library(); | 8355 lib ^= import.library(); |
| 8356 // TODO(8474): Remove the "Expect" special casing. | 8356 if (!first_lib_url.IsNull()) { |
| 8357 if (!first_lib_url.IsNull() | |
| 8358 && (strcmp(name.ToCString(), "Expect") != 0) | |
| 8359 && (strcmp(name.ToCString(), "ExpectException") != 0)) { | |
| 8360 // Found duplicate definition. | 8357 // Found duplicate definition. |
| 8361 Error& ambiguous_ref_error = Error::Handle(); | 8358 Error& ambiguous_ref_error = Error::Handle(); |
| 8362 if (first_lib_url.raw() == lib.url()) { | 8359 if (first_lib_url.raw() == lib.url()) { |
| 8363 ambiguous_ref_error = FormatErrorMsg( | 8360 ambiguous_ref_error = FormatErrorMsg( |
| 8364 script_, ident_pos, "Error", | 8361 script_, ident_pos, "Error", |
| 8365 "ambiguous reference: " | 8362 "ambiguous reference: " |
| 8366 "'%s' as library '%s' is imported multiple times", | 8363 "'%s' as library '%s' is imported multiple times", |
| 8367 name.ToCString(), | 8364 name.ToCString(), |
| 8368 first_lib_url.ToCString()); | 8365 first_lib_url.ToCString()); |
| 8369 } else { | 8366 } else { |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9956 void Parser::SkipQualIdent() { | 9953 void Parser::SkipQualIdent() { |
| 9957 ASSERT(IsIdentifier()); | 9954 ASSERT(IsIdentifier()); |
| 9958 ConsumeToken(); | 9955 ConsumeToken(); |
| 9959 if (CurrentToken() == Token::kPERIOD) { | 9956 if (CurrentToken() == Token::kPERIOD) { |
| 9960 ConsumeToken(); // Consume the kPERIOD token. | 9957 ConsumeToken(); // Consume the kPERIOD token. |
| 9961 ExpectIdentifier("identifier expected after '.'"); | 9958 ExpectIdentifier("identifier expected after '.'"); |
| 9962 } | 9959 } |
| 9963 } | 9960 } |
| 9964 | 9961 |
| 9965 } // namespace dart | 9962 } // namespace dart |
| OLD | NEW |