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 4142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4153 members->AddMember(member); | 4153 members->AddMember(member); |
4154 } | 4154 } |
4155 | 4155 |
4156 | 4156 |
4157 void Parser::ParseEnumDeclaration(const GrowableObjectArray& pending_classes, | 4157 void Parser::ParseEnumDeclaration(const GrowableObjectArray& pending_classes, |
4158 const Class& toplevel_class, | 4158 const Class& toplevel_class, |
4159 intptr_t metadata_pos) { | 4159 intptr_t metadata_pos) { |
4160 TRACE_PARSER("ParseEnumDeclaration"); | 4160 TRACE_PARSER("ParseEnumDeclaration"); |
4161 ConsumeToken(); | 4161 ConsumeToken(); |
4162 const intptr_t enum_pos = TokenPos(); | 4162 const intptr_t enum_pos = TokenPos(); |
4163 intptr_t declaration_pos = (metadata_pos > 0) ? metadata_pos : enum_pos; | |
4163 String* enum_name = | 4164 String* enum_name = |
4164 ExpectUserDefinedTypeIdentifier("enum type name expected"); | 4165 ExpectUserDefinedTypeIdentifier("enum type name expected"); |
4165 if (FLAG_trace_parser) { | 4166 if (FLAG_trace_parser) { |
4166 OS::Print("TopLevel parsing enum '%s'\n", enum_name->ToCString()); | 4167 OS::Print("TopLevel parsing enum '%s'\n", enum_name->ToCString()); |
4167 } | 4168 } |
4168 ExpectToken(Token::kLBRACE); | 4169 ExpectToken(Token::kLBRACE); |
4169 if (!IsIdentifier()) { | 4170 if (!IsIdentifier()) { |
4170 ReportError("Enumeration must have at least one name"); | 4171 ReportError("Enumeration must have at least one name"); |
4171 } | 4172 } |
4172 while (IsIdentifier()) { | 4173 while (IsIdentifier()) { |
4173 ConsumeToken(); | 4174 ConsumeToken(); |
4174 if (CurrentToken() == Token::kCOMMA) { | 4175 if (CurrentToken() == Token::kCOMMA) { |
4175 ConsumeToken(); | 4176 ConsumeToken(); |
4176 if (CurrentToken() == Token::kRBRACE) { | 4177 if (CurrentToken() == Token::kRBRACE) { |
4177 break; | 4178 break; |
4178 } | 4179 } |
4179 } else if (CurrentToken() == Token::kRBRACE) { | 4180 } else if (CurrentToken() == Token::kRBRACE) { |
4180 break; | 4181 break; |
4181 } else { | 4182 } else { |
4182 ReportError(", or } expected"); | 4183 ReportError(", or } expected"); |
4183 } | 4184 } |
4184 } | 4185 } |
4185 ExpectToken(Token::kRBRACE); | 4186 ExpectToken(Token::kRBRACE); |
4186 | 4187 |
4187 Object& obj = Object::Handle(Z, library_.LookupLocalObject(*enum_name)); | 4188 Object& obj = Object::Handle(Z, library_.LookupLocalObject(*enum_name)); |
4188 if (!obj.IsNull()) { | 4189 if (!obj.IsNull()) { |
4189 ReportError(enum_pos, "'%s' is already defined", enum_name->ToCString()); | 4190 ReportError(enum_pos, "'%s' is already defined", enum_name->ToCString()); |
4190 } | 4191 } |
4191 Class& cls = Class::Handle(Z); | 4192 Class& cls = Class::Handle(Z); |
4192 cls = Class::New(*enum_name, script_, enum_pos); | 4193 cls = Class::New(*enum_name, script_, declaration_pos); |
4193 cls.set_library(library_); | 4194 cls.set_library(library_); |
4194 library_.AddClass(cls); | 4195 library_.AddClass(cls); |
4195 cls.set_is_synthesized_class(); | 4196 cls.set_is_synthesized_class(); |
4196 cls.set_is_enum_class(); | 4197 cls.set_is_enum_class(); |
4197 if (metadata_pos >= 0) { | 4198 if (metadata_pos >= 0) { |
4198 library_.AddClassMetadata(cls, toplevel_class, metadata_pos); | 4199 library_.AddClassMetadata(cls, toplevel_class, metadata_pos); |
4199 } | 4200 } |
4200 cls.set_super_type(Type::Handle(Z, Type::ObjectType())); | 4201 cls.set_super_type(Type::Handle(Z, Type::ObjectType())); |
4201 pending_classes.Add(cls, Heap::kOld); | 4202 pending_classes.Add(cls, Heap::kOld); |
4202 } | 4203 } |
4203 | 4204 |
4204 | 4205 |
4205 void Parser::ParseClassDeclaration(const GrowableObjectArray& pending_classes, | 4206 void Parser::ParseClassDeclaration(const GrowableObjectArray& pending_classes, |
4206 const Class& toplevel_class, | 4207 const Class& toplevel_class, |
4207 intptr_t metadata_pos) { | 4208 intptr_t metadata_pos) { |
4208 TRACE_PARSER("ParseClassDeclaration"); | 4209 TRACE_PARSER("ParseClassDeclaration"); |
4209 bool is_patch = false; | 4210 bool is_patch = false; |
4210 bool is_abstract = false; | 4211 bool is_abstract = false; |
4212 intptr_t declaration_pos = (metadata_pos > 0) ? metadata_pos : TokenPos(); | |
4211 if (is_patch_source() && | 4213 if (is_patch_source() && |
4212 (CurrentToken() == Token::kIDENT) && | 4214 (CurrentToken() == Token::kIDENT) && |
4213 CurrentLiteral()->Equals("patch")) { | 4215 CurrentLiteral()->Equals("patch")) { |
4214 ConsumeToken(); | 4216 ConsumeToken(); |
4215 is_patch = true; | 4217 is_patch = true; |
4216 } else if (CurrentToken() == Token::kABSTRACT) { | 4218 } else if (CurrentToken() == Token::kABSTRACT) { |
4217 is_abstract = true; | 4219 is_abstract = true; |
4218 ConsumeToken(); | 4220 ConsumeToken(); |
4219 } | 4221 } |
4220 ExpectToken(Token::kCLASS); | 4222 ExpectToken(Token::kCLASS); |
4221 const intptr_t classname_pos = TokenPos(); | 4223 const intptr_t classname_pos = TokenPos(); |
4222 String& class_name = *ExpectUserDefinedTypeIdentifier("class name expected"); | 4224 String& class_name = *ExpectUserDefinedTypeIdentifier("class name expected"); |
4223 if (FLAG_trace_parser) { | 4225 if (FLAG_trace_parser) { |
4224 OS::Print("TopLevel parsing class '%s'\n", class_name.ToCString()); | 4226 OS::Print("TopLevel parsing class '%s'\n", class_name.ToCString()); |
4225 } | 4227 } |
4226 Class& cls = Class::Handle(Z); | 4228 Class& cls = Class::Handle(Z); |
4227 TypeArguments& orig_type_parameters = TypeArguments::Handle(Z); | 4229 TypeArguments& orig_type_parameters = TypeArguments::Handle(Z); |
4228 Object& obj = Object::Handle(Z, library_.LookupLocalObject(class_name)); | 4230 Object& obj = Object::Handle(Z, library_.LookupLocalObject(class_name)); |
4229 if (obj.IsNull()) { | 4231 if (obj.IsNull()) { |
4230 if (is_patch) { | 4232 if (is_patch) { |
4231 ReportError(classname_pos, "missing class '%s' cannot be patched", | 4233 ReportError(classname_pos, "missing class '%s' cannot be patched", |
4232 class_name.ToCString()); | 4234 class_name.ToCString()); |
4233 } | 4235 } |
4234 cls = Class::New(class_name, script_, classname_pos); | 4236 cls = Class::New(class_name, script_, declaration_pos); |
4235 library_.AddClass(cls); | 4237 library_.AddClass(cls); |
4236 } else { | 4238 } else { |
4237 if (!obj.IsClass()) { | 4239 if (!obj.IsClass()) { |
4238 ReportError(classname_pos, "'%s' is already defined", | 4240 ReportError(classname_pos, "'%s' is already defined", |
4239 class_name.ToCString()); | 4241 class_name.ToCString()); |
4240 } | 4242 } |
4241 cls ^= obj.raw(); | 4243 cls ^= obj.raw(); |
4242 if (is_patch) { | 4244 if (is_patch) { |
4243 // Preserve and reuse the original type parameters and bounds since the | 4245 // Preserve and reuse the original type parameters and bounds since the |
4244 // ones defined in the patch class will not be finalized. | 4246 // ones defined in the patch class will not be finalized. |
4245 orig_type_parameters = cls.type_parameters(); | 4247 orig_type_parameters = cls.type_parameters(); |
4246 // A patch class must be given the same name as the class it is patching, | 4248 // A patch class must be given the same name as the class it is patching, |
4247 // otherwise the generic signature classes it defines will not match the | 4249 // otherwise the generic signature classes it defines will not match the |
4248 // patched generic signature classes. Therefore, new signature classes | 4250 // patched generic signature classes. Therefore, new signature classes |
4249 // will be introduced and the original ones will not get finalized. | 4251 // will be introduced and the original ones will not get finalized. |
4250 cls = Class::New(class_name, script_, classname_pos); | 4252 cls = Class::New(class_name, script_, declaration_pos); |
4251 cls.set_library(library_); | 4253 cls.set_library(library_); |
4252 } else { | 4254 } else { |
4253 // Not patching a class, but it has been found. This must be one of the | 4255 // Not patching a class, but it has been found. This must be one of the |
4254 // pre-registered classes from object.cc or a duplicate definition. | 4256 // pre-registered classes from object.cc or a duplicate definition. |
4255 if (!(cls.is_prefinalized() || | 4257 if (!(cls.is_prefinalized() || |
4256 RawObject::IsImplicitFieldClassId(cls.id()))) { | 4258 RawObject::IsImplicitFieldClassId(cls.id()))) { |
4257 ReportError(classname_pos, "class '%s' is already defined", | 4259 ReportError(classname_pos, "class '%s' is already defined", |
4258 class_name.ToCString()); | 4260 class_name.ToCString()); |
4259 } | 4261 } |
4260 // Pre-registered classes need their scripts connected at this time. | 4262 // Pre-registered classes need their scripts connected at this time. |
4261 cls.set_script(script_); | 4263 cls.set_script(script_); |
4262 cls.set_token_pos(classname_pos); | 4264 cls.set_token_pos(declaration_pos); |
4263 } | 4265 } |
4264 } | 4266 } |
4265 ASSERT(!cls.IsNull()); | 4267 ASSERT(!cls.IsNull()); |
4266 ASSERT(cls.functions() == Object::empty_array().raw()); | 4268 ASSERT(cls.functions() == Object::empty_array().raw()); |
4267 set_current_class(cls); | 4269 set_current_class(cls); |
4268 ParseTypeParameters(cls); | 4270 ParseTypeParameters(cls); |
4269 if (is_patch) { | 4271 if (is_patch) { |
4270 // Check that the new type parameters are identical to the original ones. | 4272 // Check that the new type parameters are identical to the original ones. |
4271 const TypeArguments& new_type_parameters = | 4273 const TypeArguments& new_type_parameters = |
4272 TypeArguments::Handle(Z, cls.type_parameters()); | 4274 TypeArguments::Handle(Z, cls.type_parameters()); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4392 } | 4394 } |
4393 } | 4395 } |
4394 | 4396 |
4395 | 4397 |
4396 void Parser::ParseClassDefinition(const Class& cls) { | 4398 void Parser::ParseClassDefinition(const Class& cls) { |
4397 TRACE_PARSER("ParseClassDefinition"); | 4399 TRACE_PARSER("ParseClassDefinition"); |
4398 CompilerStats::num_classes_compiled++; | 4400 CompilerStats::num_classes_compiled++; |
4399 set_current_class(cls); | 4401 set_current_class(cls); |
4400 is_top_level_ = true; | 4402 is_top_level_ = true; |
4401 String& class_name = String::Handle(Z, cls.Name()); | 4403 String& class_name = String::Handle(Z, cls.Name()); |
4404 SkipMetadata(); | |
4405 if (is_patch_source() && | |
hausner
2015/02/13 16:52:27
I believe you don't have to validate whether the p
| |
4406 (CurrentToken() == Token::kIDENT) && | |
4407 CurrentLiteral()->Equals("patch")) { | |
4408 ConsumeToken(); | |
4409 } else if (CurrentToken() == Token::kABSTRACT) { | |
4410 ConsumeToken(); | |
4411 } | |
4412 ExpectToken(Token::kCLASS); | |
4402 const intptr_t class_pos = TokenPos(); | 4413 const intptr_t class_pos = TokenPos(); |
4403 ClassDesc members(cls, class_name, false, class_pos); | 4414 ClassDesc members(cls, class_name, false, class_pos); |
4404 while (CurrentToken() != Token::kLBRACE) { | 4415 while (CurrentToken() != Token::kLBRACE) { |
4405 ConsumeToken(); | 4416 ConsumeToken(); |
4406 } | 4417 } |
4407 ExpectToken(Token::kLBRACE); | 4418 ExpectToken(Token::kLBRACE); |
4408 while (CurrentToken() != Token::kRBRACE) { | 4419 while (CurrentToken() != Token::kRBRACE) { |
4409 intptr_t metadata_pos = SkipMetadata(); | 4420 intptr_t metadata_pos = SkipMetadata(); |
4410 ParseClassMemberDefinition(&members, metadata_pos); | 4421 ParseClassMemberDefinition(&members, metadata_pos); |
4411 } | 4422 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4486 enum_members.AddFunction(getter); | 4497 enum_members.AddFunction(getter); |
4487 | 4498 |
4488 GrowableObjectArray& enum_names = GrowableObjectArray::Handle(Z, | 4499 GrowableObjectArray& enum_names = GrowableObjectArray::Handle(Z, |
4489 GrowableObjectArray::New(8, Heap::kOld)); | 4500 GrowableObjectArray::New(8, Heap::kOld)); |
4490 const String& name_prefix = | 4501 const String& name_prefix = |
4491 String::Handle(String::Concat(enum_name, Symbols::Dot())); | 4502 String::Handle(String::Concat(enum_name, Symbols::Dot())); |
4492 | 4503 |
4493 ASSERT(IsIdentifier()); | 4504 ASSERT(IsIdentifier()); |
4494 ASSERT(CurrentLiteral()->raw() == cls.Name()); | 4505 ASSERT(CurrentLiteral()->raw() == cls.Name()); |
4495 | 4506 |
4496 ConsumeToken(); // Enum type name. | 4507 ConsumeToken(); // Enum type name. |
hausner
2015/02/13 16:52:27
Don't you have to skip metadata here? I'd add a te
rmacnak
2015/02/13 20:46:34
Yikes, yes. I don't think enums are explicitly inc
| |
4497 ExpectToken(Token::kLBRACE); | 4508 ExpectToken(Token::kLBRACE); |
4498 Field& enum_value = Field::Handle(Z); | 4509 Field& enum_value = Field::Handle(Z); |
4499 String& enum_value_name = String::Handle(Z); | 4510 String& enum_value_name = String::Handle(Z); |
4500 intptr_t i = 0; | 4511 intptr_t i = 0; |
4501 GrowableArray<String*> declared_names(8); | 4512 GrowableArray<String*> declared_names(8); |
4502 | 4513 |
4503 while (IsIdentifier()) { | 4514 while (IsIdentifier()) { |
4504 String* enum_ident = CurrentLiteral(); | 4515 String* enum_ident = CurrentLiteral(); |
4505 | 4516 |
4506 // Check for name conflicts. | 4517 // Check for name conflicts. |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4777 } | 4788 } |
4778 SetPosition(saved_pos); | 4789 SetPosition(saved_pos); |
4779 return is_mixin_def; | 4790 return is_mixin_def; |
4780 } | 4791 } |
4781 | 4792 |
4782 | 4793 |
4783 void Parser::ParseTypedef(const GrowableObjectArray& pending_classes, | 4794 void Parser::ParseTypedef(const GrowableObjectArray& pending_classes, |
4784 const Class& toplevel_class, | 4795 const Class& toplevel_class, |
4785 intptr_t metadata_pos) { | 4796 intptr_t metadata_pos) { |
4786 TRACE_PARSER("ParseTypedef"); | 4797 TRACE_PARSER("ParseTypedef"); |
4798 intptr_t declaration_pos = (metadata_pos > 0) ? metadata_pos : TokenPos(); | |
4787 ExpectToken(Token::kTYPEDEF); | 4799 ExpectToken(Token::kTYPEDEF); |
4788 | 4800 |
4789 if (IsMixinAppAlias()) { | 4801 if (IsMixinAppAlias()) { |
4790 if (FLAG_warn_mixin_typedef) { | 4802 if (FLAG_warn_mixin_typedef) { |
4791 ReportWarning(TokenPos(), "deprecated mixin application typedef"); | 4803 ReportWarning(TokenPos(), "deprecated mixin application typedef"); |
4792 } | 4804 } |
4793 ParseMixinAppAlias(pending_classes, toplevel_class, metadata_pos); | 4805 ParseMixinAppAlias(pending_classes, toplevel_class, metadata_pos); |
4794 return; | 4806 return; |
4795 } | 4807 } |
4796 | 4808 |
(...skipping 22 matching lines...) Expand all Loading... | |
4819 } | 4831 } |
4820 | 4832 |
4821 // Create the function type alias signature class. It will be linked to its | 4833 // Create the function type alias signature class. It will be linked to its |
4822 // signature function after it has been parsed. The type parameters, in order | 4834 // signature function after it has been parsed. The type parameters, in order |
4823 // to be properly finalized, need to be associated to this signature class as | 4835 // to be properly finalized, need to be associated to this signature class as |
4824 // they are parsed. | 4836 // they are parsed. |
4825 const Class& function_type_alias = Class::Handle(Z, | 4837 const Class& function_type_alias = Class::Handle(Z, |
4826 Class::NewSignatureClass(*alias_name, | 4838 Class::NewSignatureClass(*alias_name, |
4827 Function::Handle(Z), | 4839 Function::Handle(Z), |
4828 script_, | 4840 script_, |
4829 alias_name_pos)); | 4841 declaration_pos)); |
4830 library_.AddClass(function_type_alias); | 4842 library_.AddClass(function_type_alias); |
4831 set_current_class(function_type_alias); | 4843 set_current_class(function_type_alias); |
4832 // Parse the type parameters of the function type. | 4844 // Parse the type parameters of the function type. |
4833 ParseTypeParameters(function_type_alias); | 4845 ParseTypeParameters(function_type_alias); |
4834 // At this point, the type parameters have been parsed, so we can resolve the | 4846 // At this point, the type parameters have been parsed, so we can resolve the |
4835 // result type. | 4847 // result type. |
4836 if (!result_type.IsNull()) { | 4848 if (!result_type.IsNull()) { |
4837 ResolveTypeFromClass(function_type_alias, | 4849 ResolveTypeFromClass(function_type_alias, |
4838 ClassFinalizer::kResolveTypeParameters, | 4850 ClassFinalizer::kResolveTypeParameters, |
4839 &result_type); | 4851 &result_type); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4986 GrowableObjectArray::Handle(Z, GrowableObjectArray::New()); | 4998 GrowableObjectArray::Handle(Z, GrowableObjectArray::New()); |
4987 intptr_t index = 0; | 4999 intptr_t index = 0; |
4988 TypeParameter& type_parameter = TypeParameter::Handle(Z); | 5000 TypeParameter& type_parameter = TypeParameter::Handle(Z); |
4989 TypeParameter& existing_type_parameter = TypeParameter::Handle(Z); | 5001 TypeParameter& existing_type_parameter = TypeParameter::Handle(Z); |
4990 String& existing_type_parameter_name = String::Handle(Z); | 5002 String& existing_type_parameter_name = String::Handle(Z); |
4991 AbstractType& type_parameter_bound = Type::Handle(Z); | 5003 AbstractType& type_parameter_bound = Type::Handle(Z); |
4992 do { | 5004 do { |
4993 ConsumeToken(); | 5005 ConsumeToken(); |
4994 const intptr_t metadata_pos = SkipMetadata(); | 5006 const intptr_t metadata_pos = SkipMetadata(); |
4995 const intptr_t type_parameter_pos = TokenPos(); | 5007 const intptr_t type_parameter_pos = TokenPos(); |
5008 const intptr_t declaration_pos = (metadata_pos > 0) ? metadata_pos | |
5009 : type_parameter_pos; | |
4996 String& type_parameter_name = | 5010 String& type_parameter_name = |
4997 *ExpectUserDefinedTypeIdentifier("type parameter expected"); | 5011 *ExpectUserDefinedTypeIdentifier("type parameter expected"); |
4998 // Check for duplicate type parameters. | 5012 // Check for duplicate type parameters. |
4999 for (intptr_t i = 0; i < index; i++) { | 5013 for (intptr_t i = 0; i < index; i++) { |
5000 existing_type_parameter ^= type_parameters_array.At(i); | 5014 existing_type_parameter ^= type_parameters_array.At(i); |
5001 existing_type_parameter_name = existing_type_parameter.name(); | 5015 existing_type_parameter_name = existing_type_parameter.name(); |
5002 if (existing_type_parameter_name.Equals(type_parameter_name)) { | 5016 if (existing_type_parameter_name.Equals(type_parameter_name)) { |
5003 ReportError(type_parameter_pos, "duplicate type parameter '%s'", | 5017 ReportError(type_parameter_pos, "duplicate type parameter '%s'", |
5004 type_parameter_name.ToCString()); | 5018 type_parameter_name.ToCString()); |
5005 } | 5019 } |
5006 } | 5020 } |
5007 if (CurrentToken() == Token::kEXTENDS) { | 5021 if (CurrentToken() == Token::kEXTENDS) { |
5008 ConsumeToken(); | 5022 ConsumeToken(); |
5009 // A bound may refer to the owner of the type parameter it applies to, | 5023 // A bound may refer to the owner of the type parameter it applies to, |
5010 // i.e. to the class or interface currently being parsed. | 5024 // i.e. to the class or interface currently being parsed. |
5011 // Postpone resolution in order to avoid resolving the class and its | 5025 // Postpone resolution in order to avoid resolving the class and its |
5012 // type parameters, as they are not fully parsed yet. | 5026 // type parameters, as they are not fully parsed yet. |
5013 type_parameter_bound = ParseType(ClassFinalizer::kDoNotResolve); | 5027 type_parameter_bound = ParseType(ClassFinalizer::kDoNotResolve); |
5014 } else { | 5028 } else { |
5015 type_parameter_bound = I->object_store()->object_type(); | 5029 type_parameter_bound = I->object_store()->object_type(); |
5016 } | 5030 } |
5017 type_parameter = TypeParameter::New(cls, | 5031 type_parameter = TypeParameter::New(cls, |
5018 index, | 5032 index, |
5019 type_parameter_name, | 5033 type_parameter_name, |
5020 type_parameter_bound, | 5034 type_parameter_bound, |
5021 type_parameter_pos); | 5035 declaration_pos); |
5022 type_parameters_array.Add(type_parameter); | 5036 type_parameters_array.Add(type_parameter); |
5023 if (metadata_pos >= 0) { | 5037 if (metadata_pos >= 0) { |
5024 library_.AddTypeParameterMetadata(type_parameter, metadata_pos); | 5038 library_.AddTypeParameterMetadata(type_parameter, metadata_pos); |
5025 } | 5039 } |
5026 index++; | 5040 index++; |
5027 } while (CurrentToken() == Token::kCOMMA); | 5041 } while (CurrentToken() == Token::kCOMMA); |
5028 Token::Kind token = CurrentToken(); | 5042 Token::Kind token = CurrentToken(); |
5029 if ((token == Token::kGT) || (token == Token::kSHR)) { | 5043 if ((token == Token::kGT) || (token == Token::kSHR)) { |
5030 ConsumeRightAngleBracket(); | 5044 ConsumeRightAngleBracket(); |
5031 } else { | 5045 } else { |
(...skipping 7492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12524 void Parser::SkipQualIdent() { | 12538 void Parser::SkipQualIdent() { |
12525 ASSERT(IsIdentifier()); | 12539 ASSERT(IsIdentifier()); |
12526 ConsumeToken(); | 12540 ConsumeToken(); |
12527 if (CurrentToken() == Token::kPERIOD) { | 12541 if (CurrentToken() == Token::kPERIOD) { |
12528 ConsumeToken(); // Consume the kPERIOD token. | 12542 ConsumeToken(); // Consume the kPERIOD token. |
12529 ExpectIdentifier("identifier expected after '.'"); | 12543 ExpectIdentifier("identifier expected after '.'"); |
12530 } | 12544 } |
12531 } | 12545 } |
12532 | 12546 |
12533 } // namespace dart | 12547 } // namespace dart |
OLD | NEW |