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 4698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4709 } | 4709 } |
4710 | 4710 |
4711 | 4711 |
4712 void Parser::ParseEnumDefinition(const Class& cls) { | 4712 void Parser::ParseEnumDefinition(const Class& cls) { |
4713 TRACE_PARSER("ParseEnumDefinition"); | 4713 TRACE_PARSER("ParseEnumDefinition"); |
4714 INC_STAT(thread(), num_classes_parsed, 1); | 4714 INC_STAT(thread(), num_classes_parsed, 1); |
4715 | 4715 |
4716 SkipMetadata(); | 4716 SkipMetadata(); |
4717 ExpectToken(Token::kENUM); | 4717 ExpectToken(Token::kENUM); |
4718 | 4718 |
4719 const String& enum_name = String::Handle(Z, cls.Name()); | 4719 const String& enum_name = String::Handle(Z, cls.PrettyName()); |
4720 ClassDesc enum_members(Z, cls, enum_name, false, cls.token_pos()); | 4720 ClassDesc enum_members(Z, cls, enum_name, false, cls.token_pos()); |
4721 | 4721 |
4722 // Add instance field 'final int index'. | 4722 // Add instance field 'final int index'. |
4723 Field& index_field = Field::ZoneHandle(Z); | 4723 Field& index_field = Field::ZoneHandle(Z); |
4724 const Type& int_type = Type::Handle(Z, Type::IntType()); | 4724 const Type& int_type = Type::Handle(Z, Type::IntType()); |
4725 const Type& dynamic_type = Type::Handle(Type::DynamicType()); | 4725 const Type& dynamic_type = Type::Handle(Type::DynamicType()); |
4726 index_field = Field::New(Symbols::Index(), | 4726 index_field = Field::New(Symbols::Index(), |
4727 false, // Not static. | 4727 false, // Not static. |
4728 true, // Field is final. | 4728 true, // Field is final. |
4729 false, // Not const. | 4729 false, // Not const. |
(...skipping 9573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14303 void Parser::SkipQualIdent() { | 14303 void Parser::SkipQualIdent() { |
14304 ASSERT(IsIdentifier()); | 14304 ASSERT(IsIdentifier()); |
14305 ConsumeToken(); | 14305 ConsumeToken(); |
14306 if (CurrentToken() == Token::kPERIOD) { | 14306 if (CurrentToken() == Token::kPERIOD) { |
14307 ConsumeToken(); // Consume the kPERIOD token. | 14307 ConsumeToken(); // Consume the kPERIOD token. |
14308 ExpectIdentifier("identifier expected after '.'"); | 14308 ExpectIdentifier("identifier expected after '.'"); |
14309 } | 14309 } |
14310 } | 14310 } |
14311 | 14311 |
14312 } // namespace dart | 14312 } // namespace dart |
OLD | NEW |