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

Side by Side Diff: pkg/front_end/lib/src/fasta/source/diet_parser.dart

Issue 2744113002: Change the calling conventions for Parser.reportUnrecoverableError. (Closed)
Patch Set: Created 3 years, 9 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 | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 fasta.diet_parser; 5 library fasta.diet_parser;
6 6
7 import '../scanner/token.dart' show BeginGroupToken, Token; 7 import '../scanner/token.dart' show BeginGroupToken, Token;
8 8
9 import '../parser/class_member_parser.dart' show ClassMemberParser; 9 import '../parser/class_member_parser.dart' show ClassMemberParser;
10 10
(...skipping 12 matching lines...) Expand all
23 return skipFormals(token); 23 return skipFormals(token);
24 } 24 }
25 25
26 Token skipFormals(Token token) { 26 Token skipFormals(Token token) {
27 listener.beginOptionalFormalParameters(token); 27 listener.beginOptionalFormalParameters(token);
28 if (!optional('(', token)) { 28 if (!optional('(', token)) {
29 if (optional(';', token)) { 29 if (optional(';', token)) {
30 reportRecoverableError(token, ErrorKind.ExpectedOpenParens, {}); 30 reportRecoverableError(token, ErrorKind.ExpectedOpenParens, {});
31 return token; 31 return token;
32 } 32 }
33 return reportUnrecoverableError(token, ErrorKind.UnexpectedToken); 33 return reportUnrecoverableError(token, ErrorKind.UnexpectedToken)?.next;
34 } 34 }
35 BeginGroupToken beginGroupToken = token; 35 BeginGroupToken beginGroupToken = token;
36 Token endToken = beginGroupToken.endGroup; 36 Token endToken = beginGroupToken.endGroup;
37 listener.endFormalParameters(0, token, endToken); 37 listener.endFormalParameters(0, token, endToken);
38 return endToken.next; 38 return endToken.next;
39 } 39 }
40 } 40 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698