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 5387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5398 if (library_.LookupLocalObject(accessor_name) != Object::null()) { | 5398 if (library_.LookupLocalObject(accessor_name) != Object::null()) { |
5399 ReportError(name_pos, "setter for '%s' is already defined", | 5399 ReportError(name_pos, "setter for '%s' is already defined", |
5400 var_name.ToCString()); | 5400 var_name.ToCString()); |
5401 } | 5401 } |
5402 | 5402 |
5403 const bool is_reflectable = | 5403 const bool is_reflectable = |
5404 !(library_.is_dart_scheme() && library_.IsPrivate(var_name)); | 5404 !(library_.is_dart_scheme() && library_.IsPrivate(var_name)); |
5405 field = Field::New(var_name, is_static, is_final, is_const, is_reflectable, | 5405 field = Field::New(var_name, is_static, is_final, is_const, is_reflectable, |
5406 current_class(), name_pos); | 5406 current_class(), name_pos); |
5407 field.set_type(type); | 5407 field.set_type(type); |
5408 field.set_value(Instance::Handle(Z, Instance::null())); | 5408 field.set_value(Object::null_instance()); |
5409 top_level->fields.Add(field); | 5409 top_level->fields.Add(field); |
5410 library_.AddObject(field, var_name); | 5410 library_.AddObject(field, var_name); |
5411 if (metadata_pos >= 0) { | 5411 if (metadata_pos >= 0) { |
5412 library_.AddFieldMetadata(field, metadata_pos); | 5412 library_.AddFieldMetadata(field, metadata_pos); |
5413 } | 5413 } |
5414 if (CurrentToken() == Token::kASSIGN) { | 5414 if (CurrentToken() == Token::kASSIGN) { |
5415 ConsumeToken(); | 5415 ConsumeToken(); |
5416 Instance& field_value = Instance::Handle(Z, Object::sentinel().raw()); | 5416 Instance& field_value = Instance::Handle(Z, Object::sentinel().raw()); |
5417 bool has_simple_literal = false; | 5417 bool has_simple_literal = false; |
5418 if (LookaheadToken(1) == Token::kSEMICOLON) { | 5418 if (LookaheadToken(1) == Token::kSEMICOLON) { |
(...skipping 8649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14068 void Parser::SkipQualIdent() { | 14068 void Parser::SkipQualIdent() { |
14069 ASSERT(IsIdentifier()); | 14069 ASSERT(IsIdentifier()); |
14070 ConsumeToken(); | 14070 ConsumeToken(); |
14071 if (CurrentToken() == Token::kPERIOD) { | 14071 if (CurrentToken() == Token::kPERIOD) { |
14072 ConsumeToken(); // Consume the kPERIOD token. | 14072 ConsumeToken(); // Consume the kPERIOD token. |
14073 ExpectIdentifier("identifier expected after '.'"); | 14073 ExpectIdentifier("identifier expected after '.'"); |
14074 } | 14074 } |
14075 } | 14075 } |
14076 | 14076 |
14077 } // namespace dart | 14077 } // namespace dart |
OLD | NEW |