| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |