OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 dart2js.parser.partial; | 5 library dart2js.parser.partial; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../tokens/token.dart' show BeginGroupToken, ErrorToken, Token; | 8 import '../tokens/token.dart' show BeginGroupToken, ErrorToken, Token; |
9 import '../tokens/token_constants.dart' as Tokens show EOF_TOKEN; | 9 import '../tokens/token_constants.dart' as Tokens show EOF_TOKEN; |
10 import '../util/characters.dart' as Characters show $CLOSE_CURLY_BRACKET; | 10 import '../util/characters.dart' as Characters show $CLOSE_CURLY_BRACKET; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 token = parseRedirectingFactoryBody(token); | 149 token = parseRedirectingFactoryBody(token); |
150 expectSemicolon(token); | 150 expectSemicolon(token); |
151 } else { | 151 } else { |
152 token = skipBlock(token); | 152 token = skipBlock(token); |
153 } | 153 } |
154 listener.skippedFunctionBody(token); | 154 listener.skippedFunctionBody(token); |
155 } | 155 } |
156 return token; | 156 return token; |
157 } | 157 } |
158 | 158 |
159 Token parseFormalParameters(Token token) => skipFormals(token); | 159 Token parseFormalParameters(Token token, {bool inFunctionType: false}) |
| 160 => skipFormals(token); |
160 | 161 |
161 Token skipFormals(Token token) { | 162 Token skipFormals(Token token) { |
162 listener.beginOptionalFormalParameters(token); | 163 listener.beginOptionalFormalParameters(token); |
163 if (!optional('(', token)) { | 164 if (!optional('(', token)) { |
164 if (optional(';', token)) { | 165 if (optional(';', token)) { |
165 listener.recoverableError(token, "expected '('"); | 166 listener.recoverableError(token, "expected '('"); |
166 return token; | 167 return token; |
167 } | 168 } |
168 return listener.unexpected(token); | 169 return listener.unexpected(token); |
169 } | 170 } |
170 BeginGroupToken beginGroupToken = token; | 171 BeginGroupToken beginGroupToken = token; |
171 Token endToken = beginGroupToken.endGroup; | 172 Token endToken = beginGroupToken.endGroup; |
172 listener.endFormalParameters(0, token, endToken); | 173 listener.endFormalParameters(0, token, endToken); |
173 return endToken.next; | 174 return endToken.next; |
174 } | 175 } |
175 } | 176 } |
OLD | NEW |