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

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

Issue 1459543002: Fix a bug parsing generic methods (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 engine.parser; 5 library engine.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 'ast.dart'; 10 import 'ast.dart';
(...skipping 5108 matching lines...) Expand 10 before | Expand all | Expand 10 after
5119 return _parseFunctionDeclaration( 5119 return _parseFunctionDeclaration(
5120 commentAndMetadata, modifiers.externalKeyword, returnType); 5120 commentAndMetadata, modifiers.externalKeyword, returnType);
5121 } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) { 5121 } else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) {
5122 _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken); 5122 _reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken);
5123 return _convertToFunctionDeclaration(_parseOperator( 5123 return _convertToFunctionDeclaration(_parseOperator(
5124 commentAndMetadata, modifiers.externalKeyword, returnType)); 5124 commentAndMetadata, modifiers.externalKeyword, returnType));
5125 } else if (_matchesIdentifier() && 5125 } else if (_matchesIdentifier() &&
5126 _peek().matchesAny([ 5126 _peek().matchesAny([
5127 TokenType.OPEN_PAREN, 5127 TokenType.OPEN_PAREN,
5128 TokenType.OPEN_CURLY_BRACKET, 5128 TokenType.OPEN_CURLY_BRACKET,
5129 TokenType.FUNCTION 5129 TokenType.FUNCTION,
5130 TokenType.LT
5130 ])) { 5131 ])) {
5131 _validateModifiersForTopLevelFunction(modifiers); 5132 _validateModifiersForTopLevelFunction(modifiers);
5132 return _parseFunctionDeclaration( 5133 return _parseFunctionDeclaration(
5133 commentAndMetadata, modifiers.externalKeyword, returnType); 5134 commentAndMetadata, modifiers.externalKeyword, returnType);
5134 } else { 5135 } else {
5135 // 5136 //
5136 // We have found an error of some kind. Try to recover. 5137 // We have found an error of some kind. Try to recover.
5137 // 5138 //
5138 if (_matchesIdentifier()) { 5139 if (_matchesIdentifier()) {
5139 if (_peek().matchesAny( 5140 if (_peek().matchesAny(
(...skipping 6034 matching lines...) Expand 10 before | Expand all | Expand 10 after
11174 } 11175 }
11175 11176
11176 /** 11177 /**
11177 * Copy resolution data from the [fromNode] to the [toNode]. 11178 * Copy resolution data from the [fromNode] to the [toNode].
11178 */ 11179 */
11179 static void copyResolutionData(AstNode fromNode, AstNode toNode) { 11180 static void copyResolutionData(AstNode fromNode, AstNode toNode) {
11180 ResolutionCopier copier = new ResolutionCopier(); 11181 ResolutionCopier copier = new ResolutionCopier();
11181 copier._isEqualNodes(fromNode, toNode); 11182 copier._isEqualNodes(fromNode, toNode);
11182 } 11183 }
11183 } 11184 }
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