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

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

Issue 1693963002: Fix parsing of generic local functions (issue 25769) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: backout unintended changes Created 4 years, 10 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
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library analyzer.src.generated.parser; 5 library analyzer.src.generated.parser;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 7031 matching lines...) Expand 10 before | Expand all | Expand 10 after
7042 return _parseWhileStatement(); 7042 return _parseWhileStatement();
7043 } else if (keyword == Keyword.VAR || keyword == Keyword.FINAL) { 7043 } else if (keyword == Keyword.VAR || keyword == Keyword.FINAL) {
7044 return _parseVariableDeclarationStatementAfterMetadata( 7044 return _parseVariableDeclarationStatementAfterMetadata(
7045 commentAndMetadata); 7045 commentAndMetadata);
7046 } else if (keyword == Keyword.VOID) { 7046 } else if (keyword == Keyword.VOID) {
7047 TypeName returnType = parseReturnType(); 7047 TypeName returnType = parseReturnType();
7048 if (_matchesIdentifier() && 7048 if (_matchesIdentifier() &&
7049 _peek().matchesAny([ 7049 _peek().matchesAny([
7050 TokenType.OPEN_PAREN, 7050 TokenType.OPEN_PAREN,
7051 TokenType.OPEN_CURLY_BRACKET, 7051 TokenType.OPEN_CURLY_BRACKET,
7052 TokenType.FUNCTION 7052 TokenType.FUNCTION,
7053 TokenType.LT
7053 ])) { 7054 ])) {
7054 return _parseFunctionDeclarationStatementAfterReturnType( 7055 return _parseFunctionDeclarationStatementAfterReturnType(
7055 commentAndMetadata, returnType); 7056 commentAndMetadata, returnType);
7056 } else { 7057 } else {
7057 // 7058 //
7058 // We have found an error of some kind. Try to recover. 7059 // We have found an error of some kind. Try to recover.
7059 // 7060 //
7060 if (_matchesIdentifier()) { 7061 if (_matchesIdentifier()) {
7061 if (_peek().matchesAny( 7062 if (_peek().matchesAny(
7062 [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) { 7063 [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
(...skipping 4295 matching lines...) Expand 10 before | Expand all | Expand 10 after
11358 } 11359 }
11359 11360
11360 /** 11361 /**
11361 * Copy resolution data from the [fromNode] to the [toNode]. 11362 * Copy resolution data from the [fromNode] to the [toNode].
11362 */ 11363 */
11363 static void copyResolutionData(AstNode fromNode, AstNode toNode) { 11364 static void copyResolutionData(AstNode fromNode, AstNode toNode) {
11364 ResolutionCopier copier = new ResolutionCopier(); 11365 ResolutionCopier copier = new ResolutionCopier();
11365 copier._isEqualNodes(fromNode, toNode); 11366 copier._isEqualNodes(fromNode, toNode);
11366 } 11367 }
11367 } 11368 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698