| 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 "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| (...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2187 ErrorMsg(method->name_pos, | 2187 ErrorMsg(method->name_pos, |
| 2188 "field or method '%s' already defined", method->name->ToCString()); | 2188 "field or method '%s' already defined", method->name->ToCString()); |
| 2189 } | 2189 } |
| 2190 | 2190 |
| 2191 // Parse the formal parameters. | 2191 // Parse the formal parameters. |
| 2192 // The first parameter of factory methods is an implicit parameter called | 2192 // The first parameter of factory methods is an implicit parameter called |
| 2193 // 'this' of type AbstractTypeArguments. | 2193 // 'this' of type AbstractTypeArguments. |
| 2194 const bool has_this_param = | 2194 const bool has_this_param = |
| 2195 !method->has_static || method->IsConstructor() || method->has_factory; | 2195 !method->has_static || method->IsConstructor() || method->has_factory; |
| 2196 const bool are_implicitly_final = method->has_const; | 2196 const bool are_implicitly_final = method->has_const; |
| 2197 const bool allow_explicit_default_values = | 2197 const bool allow_explicit_default_values = true; |
| 2198 (!method->has_abstract && !members->is_interface()); | |
| 2199 const intptr_t formal_param_pos = token_index_; | 2198 const intptr_t formal_param_pos = token_index_; |
| 2200 method->params.Clear(); | 2199 method->params.Clear(); |
| 2201 if (has_this_param) { | 2200 if (has_this_param) { |
| 2202 method->params.AddReceiver(formal_param_pos); | 2201 method->params.AddReceiver(formal_param_pos); |
| 2203 } | 2202 } |
| 2204 // Constructors have an implicit parameter for the construction phase. | 2203 // Constructors have an implicit parameter for the construction phase. |
| 2205 if (method->IsConstructor()) { | 2204 if (method->IsConstructor()) { |
| 2206 method->params.AddFinalParameter( | 2205 method->params.AddFinalParameter( |
| 2207 token_index_, | 2206 token_index_, |
| 2208 kPhaseParameterName, | 2207 kPhaseParameterName, |
| (...skipping 6267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8476 void Parser::SkipQualIdent() { | 8475 void Parser::SkipQualIdent() { |
| 8477 ASSERT(IsIdentifier()); | 8476 ASSERT(IsIdentifier()); |
| 8478 ConsumeToken(); | 8477 ConsumeToken(); |
| 8479 if (CurrentToken() == Token::kPERIOD) { | 8478 if (CurrentToken() == Token::kPERIOD) { |
| 8480 ConsumeToken(); // Consume the kPERIOD token. | 8479 ConsumeToken(); // Consume the kPERIOD token. |
| 8481 ExpectIdentifier("identifier expected after '.'"); | 8480 ExpectIdentifier("identifier expected after '.'"); |
| 8482 } | 8481 } |
| 8483 } | 8482 } |
| 8484 | 8483 |
| 8485 } // namespace dart | 8484 } // namespace dart |
| OLD | NEW |