| 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 "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/ast_transformer.h" | 9 #include "vm/ast_transformer.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 4355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4366 } else if (enum_ident->raw() == Symbols::Index().raw()) { | 4366 } else if (enum_ident->raw() == Symbols::Index().raw()) { |
| 4367 ReportError("enum identifier conflicts with " | 4367 ReportError("enum identifier conflicts with " |
| 4368 "implicit instance field 'index'"); | 4368 "implicit instance field 'index'"); |
| 4369 } else if (enum_ident->raw() == Symbols::Values().raw()) { | 4369 } else if (enum_ident->raw() == Symbols::Values().raw()) { |
| 4370 ReportError("enum identifier conflicts with " | 4370 ReportError("enum identifier conflicts with " |
| 4371 "implicit static field 'values'"); | 4371 "implicit static field 'values'"); |
| 4372 } else if (enum_ident->raw() == Symbols::toString().raw()) { | 4372 } else if (enum_ident->raw() == Symbols::toString().raw()) { |
| 4373 ReportError("enum identifier conflicts with " | 4373 ReportError("enum identifier conflicts with " |
| 4374 "implicit instance method 'toString()'"); | 4374 "implicit instance method 'toString()'"); |
| 4375 } | 4375 } |
| 4376 for (intptr_t i = 0; i < declared_names.length(); i++) { | 4376 for (intptr_t n = 0; n < declared_names.length(); n++) { |
| 4377 if (enum_ident->Equals(*declared_names[i])) { | 4377 if (enum_ident->Equals(*declared_names[n])) { |
| 4378 ReportError("Duplicate name '%s' in enum definition '%s'", | 4378 ReportError("Duplicate name '%s' in enum definition '%s'", |
| 4379 enum_ident->ToCString(), | 4379 enum_ident->ToCString(), |
| 4380 enum_name.ToCString()); | 4380 enum_name.ToCString()); |
| 4381 } | 4381 } |
| 4382 } | 4382 } |
| 4383 declared_names.Add(enum_ident); | 4383 declared_names.Add(enum_ident); |
| 4384 | 4384 |
| 4385 // Create the static const field for the enumeration value. | 4385 // Create the static const field for the enumeration value. |
| 4386 enum_value = Field::New(*enum_ident, | 4386 enum_value = Field::New(*enum_ident, |
| 4387 /* is_static = */ true, | 4387 /* is_static = */ true, |
| (...skipping 7730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12118 void Parser::SkipQualIdent() { | 12118 void Parser::SkipQualIdent() { |
| 12119 ASSERT(IsIdentifier()); | 12119 ASSERT(IsIdentifier()); |
| 12120 ConsumeToken(); | 12120 ConsumeToken(); |
| 12121 if (CurrentToken() == Token::kPERIOD) { | 12121 if (CurrentToken() == Token::kPERIOD) { |
| 12122 ConsumeToken(); // Consume the kPERIOD token. | 12122 ConsumeToken(); // Consume the kPERIOD token. |
| 12123 ExpectIdentifier("identifier expected after '.'"); | 12123 ExpectIdentifier("identifier expected after '.'"); |
| 12124 } | 12124 } |
| 12125 } | 12125 } |
| 12126 | 12126 |
| 12127 } // namespace dart | 12127 } // namespace dart |
| OLD | NEW |