| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.parser; | 8 library engine.parser; |
| 9 | 9 |
| 10 import "dart:math" as math; | 10 import "dart:math" as math; |
| (...skipping 7276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7287 * declaration | 7287 * declaration |
| 7288 * @param externalKeyword the 'external' token | 7288 * @param externalKeyword the 'external' token |
| 7289 * @param staticKeyword the static keyword, or `null` if the getter is not sta
tic | 7289 * @param staticKeyword the static keyword, or `null` if the getter is not sta
tic |
| 7290 * @param returnType the return type of the method | 7290 * @param returnType the return type of the method |
| 7291 * @return the method declaration that was parsed | 7291 * @return the method declaration that was parsed |
| 7292 */ | 7292 */ |
| 7293 MethodDeclaration | 7293 MethodDeclaration |
| 7294 _parseMethodDeclarationAfterReturnType(CommentAndMetadata commentAndMetada
ta, | 7294 _parseMethodDeclarationAfterReturnType(CommentAndMetadata commentAndMetada
ta, |
| 7295 Token externalKeyword, Token staticKeyword, TypeName returnType) { | 7295 Token externalKeyword, Token staticKeyword, TypeName returnType) { |
| 7296 SimpleIdentifier methodName = parseSimpleIdentifier(); | 7296 SimpleIdentifier methodName = parseSimpleIdentifier(); |
| 7297 FormalParameterList parameters = parseFormalParameterList(); | 7297 FormalParameterList parameters; |
| 7298 if (!_matches(TokenType.OPEN_PAREN) && |
| 7299 (_matches(TokenType.OPEN_CURLY_BRACKET) || _matches(TokenType.FUNCTION))
) { |
| 7300 _reportErrorForToken(ParserErrorCode.MISSING_METHOD_PARAMETERS, _currentTo
ken.previous); |
| 7301 parameters = new FormalParameterList( |
| 7302 _createSyntheticToken(TokenType.OPEN_PAREN), |
| 7303 null, |
| 7304 null, |
| 7305 null, |
| 7306 _createSyntheticToken(TokenType.CLOSE_PAREN)); |
| 7307 } else { |
| 7308 parameters = parseFormalParameterList(); |
| 7309 } |
| 7298 _validateFormalParameterList(parameters); | 7310 _validateFormalParameterList(parameters); |
| 7299 return _parseMethodDeclarationAfterParameters( | 7311 return _parseMethodDeclarationAfterParameters( |
| 7300 commentAndMetadata, | 7312 commentAndMetadata, |
| 7301 externalKeyword, | 7313 externalKeyword, |
| 7302 staticKeyword, | 7314 staticKeyword, |
| 7303 returnType, | 7315 returnType, |
| 7304 methodName, | 7316 methodName, |
| 7305 parameters); | 7317 parameters); |
| 7306 } | 7318 } |
| 7307 | 7319 |
| (...skipping 3087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10395 | 10407 |
| 10396 static const ParserErrorCode MISSING_FUNCTION_BODY = const ParserErrorCode( | 10408 static const ParserErrorCode MISSING_FUNCTION_BODY = const ParserErrorCode( |
| 10397 'MISSING_FUNCTION_BODY', | 10409 'MISSING_FUNCTION_BODY', |
| 10398 "A function body must be provided"); | 10410 "A function body must be provided"); |
| 10399 | 10411 |
| 10400 static const ParserErrorCode MISSING_FUNCTION_PARAMETERS = | 10412 static const ParserErrorCode MISSING_FUNCTION_PARAMETERS = |
| 10401 const ParserErrorCode( | 10413 const ParserErrorCode( |
| 10402 'MISSING_FUNCTION_PARAMETERS', | 10414 'MISSING_FUNCTION_PARAMETERS', |
| 10403 "Functions must have an explicit list of parameters"); | 10415 "Functions must have an explicit list of parameters"); |
| 10404 | 10416 |
| 10417 static const ParserErrorCode MISSING_METHOD_PARAMETERS = const ParserErrorCode
( |
| 10418 'MISSING_METHOD_PARAMETERS', |
| 10419 "Methods must have an explicit list of parameters"); |
| 10420 |
| 10405 static const ParserErrorCode MISSING_GET = const ParserErrorCode( | 10421 static const ParserErrorCode MISSING_GET = const ParserErrorCode( |
| 10406 'MISSING_GET', | 10422 'MISSING_GET', |
| 10407 "Getters must have the keyword 'get' before the getter name"); | 10423 "Getters must have the keyword 'get' before the getter name"); |
| 10408 | 10424 |
| 10409 static const ParserErrorCode MISSING_IDENTIFIER = | 10425 static const ParserErrorCode MISSING_IDENTIFIER = |
| 10410 const ParserErrorCode('MISSING_IDENTIFIER', "Expected an identifier"); | 10426 const ParserErrorCode('MISSING_IDENTIFIER', "Expected an identifier"); |
| 10411 | 10427 |
| 10412 static const ParserErrorCode MISSING_INITIALIZER = | 10428 static const ParserErrorCode MISSING_INITIALIZER = |
| 10413 const ParserErrorCode('MISSING_INITIALIZER', "Expected an initializer"); | 10429 const ParserErrorCode('MISSING_INITIALIZER', "Expected an initializer"); |
| 10414 | 10430 |
| (...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12094 * Copy resolution data from one node to another. | 12110 * Copy resolution data from one node to another. |
| 12095 * | 12111 * |
| 12096 * @param fromNode the node from which resolution information will be copied | 12112 * @param fromNode the node from which resolution information will be copied |
| 12097 * @param toNode the node to which resolution information will be copied | 12113 * @param toNode the node to which resolution information will be copied |
| 12098 */ | 12114 */ |
| 12099 static void copyResolutionData(AstNode fromNode, AstNode toNode) { | 12115 static void copyResolutionData(AstNode fromNode, AstNode toNode) { |
| 12100 ResolutionCopier copier = new ResolutionCopier(); | 12116 ResolutionCopier copier = new ResolutionCopier(); |
| 12101 copier._isEqualNodes(fromNode, toNode); | 12117 copier._isEqualNodes(fromNode, toNode); |
| 12102 } | 12118 } |
| 12103 } | 12119 } |
| OLD | NEW |