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

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

Issue 713953002: Fix hurt recovery (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« 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 // 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:collection'; 10 import 'dart:collection';
(...skipping 4447 matching lines...) Expand 10 before | Expand all | Expand 10 after
4458 * @return the field initializer that was parsed 4458 * @return the field initializer that was parsed
4459 */ 4459 */
4460 ConstructorFieldInitializer _parseConstructorFieldInitializer() { 4460 ConstructorFieldInitializer _parseConstructorFieldInitializer() {
4461 Token keyword = null; 4461 Token keyword = null;
4462 Token period = null; 4462 Token period = null;
4463 if (_matchesKeyword(Keyword.THIS)) { 4463 if (_matchesKeyword(Keyword.THIS)) {
4464 keyword = andAdvance; 4464 keyword = andAdvance;
4465 period = _expect(TokenType.PERIOD); 4465 period = _expect(TokenType.PERIOD);
4466 } 4466 }
4467 SimpleIdentifier fieldName = parseSimpleIdentifier(); 4467 SimpleIdentifier fieldName = parseSimpleIdentifier();
4468 if (!_matches(TokenType.EQ)) { 4468 Token equals = null;
4469 if (_matches(TokenType.EQ)) {
4470 equals = andAdvance;
4471 } else if (!_matchesKeyword(Keyword.THIS)
4472 && !_matchesKeyword(Keyword.SUPER)
4473 && !_matches(TokenType.OPEN_CURLY_BRACKET)
4474 && !_matches(TokenType.FUNCTION)) {
4475 _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALI ZER);
4476 equals = _createSyntheticToken(TokenType.EQ);
4477 } else {
4469 _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALI ZER); 4478 _reportErrorForCurrentToken(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALI ZER);
4470 return new ConstructorFieldInitializer( 4479 return new ConstructorFieldInitializer(
4471 keyword, 4480 keyword,
4472 period, 4481 period,
4473 fieldName, 4482 fieldName,
4474 _createSyntheticToken(TokenType.EQ), 4483 _createSyntheticToken(TokenType.EQ),
4475 _createSyntheticIdentifier()); 4484 _createSyntheticIdentifier());
4476 } 4485 }
4477 Token equals = _expect(TokenType.EQ);
4478 bool wasInInitializer = _inInitializer; 4486 bool wasInInitializer = _inInitializer;
4479 _inInitializer = true; 4487 _inInitializer = true;
4480 try { 4488 try {
4481 Expression expression = parseConditionalExpression(); 4489 Expression expression = parseConditionalExpression();
4482 TokenType tokenType = _currentToken.type; 4490 TokenType tokenType = _currentToken.type;
4483 if (tokenType == TokenType.PERIOD_PERIOD) { 4491 if (tokenType == TokenType.PERIOD_PERIOD) {
4484 List<Expression> cascadeSections = new List<Expression>(); 4492 List<Expression> cascadeSections = new List<Expression>();
4485 while (tokenType == TokenType.PERIOD_PERIOD) { 4493 while (tokenType == TokenType.PERIOD_PERIOD) {
4486 Expression section = _parseCascadeSection(); 4494 Expression section = _parseCascadeSection();
4487 if (section != null) { 4495 if (section != null) {
(...skipping 5308 matching lines...) Expand 10 before | Expand all | Expand 10 after
9796 return trampoline(target, arguments[0], arguments[1]); 9804 return trampoline(target, arguments[0], arguments[1]);
9797 case 3: 9805 case 3:
9798 return trampoline(target, arguments[0], arguments[1], arguments[2]); 9806 return trampoline(target, arguments[0], arguments[1], arguments[2]);
9799 case 4: 9807 case 4:
9800 return trampoline(target, arguments[0], arguments[1], arguments[2], argu ments[3]); 9808 return trampoline(target, arguments[0], arguments[1], arguments[2], argu ments[3]);
9801 default: 9809 default:
9802 throw new IllegalArgumentException("Not implemented for > 4 arguments"); 9810 throw new IllegalArgumentException("Not implemented for > 4 arguments");
9803 } 9811 }
9804 } 9812 }
9805 } 9813 }
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