| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 target._validateModifiersForTopLevelVariable(arg0)), | 416 target._validateModifiersForTopLevelVariable(arg0)), |
| 417 'validateModifiersForTypedef_1': new MethodTrampoline( | 417 'validateModifiersForTypedef_1': new MethodTrampoline( |
| 418 1, (Parser target, arg0) => target._validateModifiersForTypedef(arg0)), | 418 1, (Parser target, arg0) => target._validateModifiersForTypedef(arg0)), |
| 419 }; | 419 }; |
| 420 | 420 |
| 421 Object invokeParserMethodImpl( | 421 Object invokeParserMethodImpl( |
| 422 Parser parser, String methodName, List<Object> objects, Token tokenStream) { | 422 Parser parser, String methodName, List<Object> objects, Token tokenStream) { |
| 423 parser.currentToken = tokenStream; | 423 parser.currentToken = tokenStream; |
| 424 MethodTrampoline method = | 424 MethodTrampoline method = |
| 425 methodTable_Parser['${methodName}_${objects.length}']; | 425 methodTable_Parser['${methodName}_${objects.length}']; |
| 426 if (method == null) { |
| 427 throw new IllegalArgumentException('There is no method named $methodName'); |
| 428 } |
| 426 return method.invoke(parser, objects); | 429 return method.invoke(parser, objects); |
| 427 } | 430 } |
| 428 | 431 |
| 429 /** | 432 /** |
| 430 * A simple data-holder for a method that needs to return multiple values. | 433 * A simple data-holder for a method that needs to return multiple values. |
| 431 */ | 434 */ |
| 432 class CommentAndMetadata { | 435 class CommentAndMetadata { |
| 433 /** | 436 /** |
| 434 * The documentation comment that was parsed, or `null` if none was given. | 437 * The documentation comment that was parsed, or `null` if none was given. |
| 435 */ | 438 */ |
| (...skipping 5791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6227 Token staticKeyword, TypeName returnType, SimpleIdentifier name, | 6230 Token staticKeyword, TypeName returnType, SimpleIdentifier name, |
| 6228 FormalParameterList parameters) { | 6231 FormalParameterList parameters) { |
| 6229 FunctionBody body = _parseFunctionBody( | 6232 FunctionBody body = _parseFunctionBody( |
| 6230 externalKeyword != null || staticKeyword == null, | 6233 externalKeyword != null || staticKeyword == null, |
| 6231 ParserErrorCode.MISSING_FUNCTION_BODY, false); | 6234 ParserErrorCode.MISSING_FUNCTION_BODY, false); |
| 6232 if (externalKeyword != null) { | 6235 if (externalKeyword != null) { |
| 6233 if (body is! EmptyFunctionBody) { | 6236 if (body is! EmptyFunctionBody) { |
| 6234 _reportErrorForNode(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, body); | 6237 _reportErrorForNode(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, body); |
| 6235 } | 6238 } |
| 6236 } else if (staticKeyword != null) { | 6239 } else if (staticKeyword != null) { |
| 6237 if (body is EmptyFunctionBody) { | 6240 if (body is EmptyFunctionBody && _parseFunctionBodies) { |
| 6238 _reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body); | 6241 _reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body); |
| 6239 } | 6242 } |
| 6240 } | 6243 } |
| 6241 return new MethodDeclaration(commentAndMetadata.comment, | 6244 return new MethodDeclaration(commentAndMetadata.comment, |
| 6242 commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, | 6245 commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, |
| 6243 null, null, name, parameters, body); | 6246 null, null, name, parameters, body); |
| 6244 } | 6247 } |
| 6245 | 6248 |
| 6246 /** | 6249 /** |
| 6247 * Parse a method declaration. The [commentAndMetadata] is the documentation | 6250 * Parse a method declaration. The [commentAndMetadata] is the documentation |
| (...skipping 4336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10584 } | 10587 } |
| 10585 | 10588 |
| 10586 /** | 10589 /** |
| 10587 * Copy resolution data from the [fromNode] to the [toNode]. | 10590 * Copy resolution data from the [fromNode] to the [toNode]. |
| 10588 */ | 10591 */ |
| 10589 static void copyResolutionData(AstNode fromNode, AstNode toNode) { | 10592 static void copyResolutionData(AstNode fromNode, AstNode toNode) { |
| 10590 ResolutionCopier copier = new ResolutionCopier(); | 10593 ResolutionCopier copier = new ResolutionCopier(); |
| 10591 copier._isEqualNodes(fromNode, toNode); | 10594 copier._isEqualNodes(fromNode, toNode); |
| 10592 } | 10595 } |
| 10593 } | 10596 } |
| OLD | NEW |