Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1044383002: improve parser recovery when top level function is missing parameters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5720 matching lines...) Expand 10 before | Expand all | Expand 10 after
5731 } 5731 }
5732 SimpleIdentifier name = parseSimpleIdentifier(); 5732 SimpleIdentifier name = parseSimpleIdentifier();
5733 FormalParameterList parameters = null; 5733 FormalParameterList parameters = null;
5734 if (!isGetter) { 5734 if (!isGetter) {
5735 if (_matches(TokenType.OPEN_PAREN)) { 5735 if (_matches(TokenType.OPEN_PAREN)) {
5736 parameters = parseFormalParameterList(); 5736 parameters = parseFormalParameterList();
5737 _validateFormalParameterList(parameters); 5737 _validateFormalParameterList(parameters);
5738 } else { 5738 } else {
5739 _reportErrorForCurrentToken( 5739 _reportErrorForCurrentToken(
5740 ParserErrorCode.MISSING_FUNCTION_PARAMETERS); 5740 ParserErrorCode.MISSING_FUNCTION_PARAMETERS);
5741 parameters = new FormalParameterList(
5742 _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
5743 _createSyntheticToken(TokenType.CLOSE_PAREN));
5741 } 5744 }
5742 } else if (_matches(TokenType.OPEN_PAREN)) { 5745 } else if (_matches(TokenType.OPEN_PAREN)) {
5743 _reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS); 5746 _reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS);
5744 parseFormalParameterList(); 5747 parseFormalParameterList();
5745 } 5748 }
5746 FunctionBody body; 5749 FunctionBody body;
5747 if (externalKeyword == null) { 5750 if (externalKeyword == null) {
5748 body = _parseFunctionBody( 5751 body = _parseFunctionBody(
5749 false, ParserErrorCode.MISSING_FUNCTION_BODY, false); 5752 false, ParserErrorCode.MISSING_FUNCTION_BODY, false);
5750 } else { 5753 } else {
(...skipping 4789 matching lines...) Expand 10 before | Expand all | Expand 10 after
10540 } 10543 }
10541 10544
10542 /** 10545 /**
10543 * Copy resolution data from the [fromNode] to the [toNode]. 10546 * Copy resolution data from the [fromNode] to the [toNode].
10544 */ 10547 */
10545 static void copyResolutionData(AstNode fromNode, AstNode toNode) { 10548 static void copyResolutionData(AstNode fromNode, AstNode toNode) {
10546 ResolutionCopier copier = new ResolutionCopier(); 10549 ResolutionCopier copier = new ResolutionCopier();
10547 copier._isEqualNodes(fromNode, toNode); 10550 copier._isEqualNodes(fromNode, toNode);
10548 } 10551 }
10549 } 10552 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/completion/local_computer_test.dart ('k') | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698