| 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 4218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4229 CheckConstructors(&members); | 4229 CheckConstructors(&members); |
| 4230 | 4230 |
| 4231 // Need to compute this here since MakeArray() will clear the | 4231 // Need to compute this here since MakeArray() will clear the |
| 4232 // functions array in members. | 4232 // functions array in members. |
| 4233 const bool need_implicit_constructor = | 4233 const bool need_implicit_constructor = |
| 4234 !members.has_constructor() && !cls.is_patch(); | 4234 !members.has_constructor() && !cls.is_patch(); |
| 4235 | 4235 |
| 4236 cls.AddFields(members.fields()); | 4236 cls.AddFields(members.fields()); |
| 4237 | 4237 |
| 4238 // Creating a new array for functions marks the class as parsed. | 4238 // Creating a new array for functions marks the class as parsed. |
| 4239 const Array& array = Array::Handle(I, | 4239 const Array& array = Array::Handle(I, Array::MakeArray(members.functions())); |
| 4240 Array::MakeArray(members.functions())); | |
| 4241 cls.SetFunctions(array); | 4240 cls.SetFunctions(array); |
| 4242 | 4241 |
| 4243 // Add an implicit constructor if no explicit constructor is present. | 4242 // Add an implicit constructor if no explicit constructor is present. |
| 4244 // No implicit constructors are needed for patch classes. | 4243 // No implicit constructors are needed for patch classes. |
| 4245 if (need_implicit_constructor) { | 4244 if (need_implicit_constructor) { |
| 4246 AddImplicitConstructor(cls); | 4245 AddImplicitConstructor(cls); |
| 4247 } | 4246 } |
| 4248 | 4247 |
| 4249 if (cls.is_patch()) { | 4248 if (cls.is_patch()) { |
| 4250 // Apply the changes to the patched class looked up above. | 4249 // Apply the changes to the patched class looked up above. |
| (...skipping 7126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11377 void Parser::SkipQualIdent() { | 11376 void Parser::SkipQualIdent() { |
| 11378 ASSERT(IsIdentifier()); | 11377 ASSERT(IsIdentifier()); |
| 11379 ConsumeToken(); | 11378 ConsumeToken(); |
| 11380 if (CurrentToken() == Token::kPERIOD) { | 11379 if (CurrentToken() == Token::kPERIOD) { |
| 11381 ConsumeToken(); // Consume the kPERIOD token. | 11380 ConsumeToken(); // Consume the kPERIOD token. |
| 11382 ExpectIdentifier("identifier expected after '.'"); | 11381 ExpectIdentifier("identifier expected after '.'"); |
| 11383 } | 11382 } |
| 11384 } | 11383 } |
| 11385 | 11384 |
| 11386 } // namespace dart | 11385 } // namespace dart |
| OLD | NEW |