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

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

Issue 2477793002: Fix the parsing of generic function expressions (Closed)
Patch Set: Created 4 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 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 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after
4262 _inInitializer = false; 4262 _inInitializer = false;
4263 try { 4263 try {
4264 Expression expression = parseExpression2(); 4264 Expression expression = parseExpression2();
4265 Token rightParenthesis = _expect(TokenType.CLOSE_PAREN); 4265 Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
4266 return new ParenthesizedExpression( 4266 return new ParenthesizedExpression(
4267 leftParenthesis, expression, rightParenthesis); 4267 leftParenthesis, expression, rightParenthesis);
4268 } finally { 4268 } finally {
4269 _inInitializer = wasInInitializer; 4269 _inInitializer = wasInInitializer;
4270 } 4270 }
4271 } else if (type == TokenType.LT || _injectGenericCommentTypeList()) { 4271 } else if (type == TokenType.LT || _injectGenericCommentTypeList()) {
4272 if (isFunctionExpression(currentToken)) {
4273 return parseFunctionExpression();
4274 }
4272 return parseListOrMapLiteral(null); 4275 return parseListOrMapLiteral(null);
4273 } else if (type == TokenType.OPEN_CURLY_BRACKET) { 4276 } else if (type == TokenType.OPEN_CURLY_BRACKET) {
4274 return parseMapLiteral(null, null); 4277 return parseMapLiteral(null, null);
4275 } else if (type == TokenType.OPEN_SQUARE_BRACKET || 4278 } else if (type == TokenType.OPEN_SQUARE_BRACKET ||
4276 type == TokenType.INDEX) { 4279 type == TokenType.INDEX) {
4277 return parseListLiteral(null, null); 4280 return parseListLiteral(null, null);
4278 } else if (type == TokenType.QUESTION && 4281 } else if (type == TokenType.QUESTION &&
4279 _tokenMatches(_peek(), TokenType.IDENTIFIER)) { 4282 _tokenMatches(_peek(), TokenType.IDENTIFIER)) {
4280 _reportErrorForCurrentToken( 4283 _reportErrorForCurrentToken(
4281 ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]); 4284 ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]);
(...skipping 3835 matching lines...) Expand 10 before | Expand all | Expand 10 after
8117 */ 8120 */
8118 Parser_SyntheticKeywordToken(Keyword keyword, int offset) 8121 Parser_SyntheticKeywordToken(Keyword keyword, int offset)
8119 : super(keyword, offset); 8122 : super(keyword, offset);
8120 8123
8121 @override 8124 @override
8122 int get length => 0; 8125 int get length => 0;
8123 8126
8124 @override 8127 @override
8125 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset); 8128 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
8126 } 8129 }
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