OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:convert' show UTF8; | 5 import 'dart:convert' show UTF8; |
6 | 6 |
7 import 'package:front_end/src/fasta/scanner/recover.dart' | 7 import 'package:front_end/src/fasta/scanner/recover.dart' |
8 show defaultRecoveryStrategy; | 8 show defaultRecoveryStrategy; |
9 import 'package:front_end/src/fasta/scanner.dart' as fasta; | 9 import 'package:front_end/src/fasta/scanner.dart' as fasta; |
10 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; | 10 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 expect(closeParen1.isSynthetic, isTrue); | 185 expect(closeParen1.isSynthetic, isTrue); |
186 expect(openBrace.endToken, same(closeBrace)); | 186 expect(openBrace.endToken, same(closeBrace)); |
187 expect(closeBrace.isSynthetic, isFalse); | 187 expect(closeBrace.isSynthetic, isFalse); |
188 expect(openParen2.endToken, same(closeParen2)); | 188 expect(openParen2.endToken, same(closeParen2)); |
189 expect(closeParen2.isSynthetic, isTrue); | 189 expect(closeParen2.isSynthetic, isTrue); |
190 expect(eof.isEof, isTrue); | 190 expect(eof.isEof, isTrue); |
191 } | 191 } |
192 | 192 |
193 @override | 193 @override |
194 @failingTest | 194 @failingTest |
195 void test_string_multi_unterminated() { | |
196 // See defaultRecoveryStrategy recoverString | |
197 super.test_string_multi_unterminated(); | |
198 } | |
199 | |
200 @override | |
201 @failingTest | |
202 void test_string_multi_unterminated_interpolation_block() { | |
203 // See defaultRecoveryStrategy recoverString | |
204 super.test_string_multi_unterminated_interpolation_block(); | |
205 } | |
206 | |
207 @override | |
208 @failingTest | |
209 void test_string_multi_unterminated_interpolation_identifier() { | |
210 // See defaultRecoveryStrategy recoverString | |
211 super.test_string_multi_unterminated_interpolation_identifier(); | |
212 } | |
213 | |
214 @override | |
215 @failingTest | |
216 void test_string_raw_multi_unterminated() { | |
217 // See defaultRecoveryStrategy recoverString | |
218 super.test_string_raw_multi_unterminated(); | |
219 } | |
220 | |
221 @override | |
222 @failingTest | |
223 void test_string_raw_simple_unterminated_eof() { | |
224 // See defaultRecoveryStrategy recoverString | |
225 super.test_string_raw_simple_unterminated_eof(); | |
226 } | |
227 | |
228 @override | |
229 @failingTest | |
230 void test_string_raw_simple_unterminated_eol() { | |
231 // See defaultRecoveryStrategy recoverString | |
232 super.test_string_raw_simple_unterminated_eol(); | |
233 } | |
234 | |
235 @override | |
236 @failingTest | |
237 void test_string_simple_interpolation_missingIdentifier() { | 195 void test_string_simple_interpolation_missingIdentifier() { |
238 // See defaultRecoveryStrategy recoverStringInterpolation | 196 // See defaultRecoveryStrategy recoverStringInterpolation |
239 super.test_string_simple_interpolation_missingIdentifier(); | 197 super.test_string_simple_interpolation_missingIdentifier(); |
240 } | 198 } |
241 | 199 |
242 @override | 200 @override |
243 @failingTest | 201 @failingTest |
244 void test_string_simple_interpolation_nonIdentifier() { | 202 void test_string_simple_interpolation_nonIdentifier() { |
245 // See defaultRecoveryStrategy recoverStringInterpolation | 203 // See defaultRecoveryStrategy recoverStringInterpolation |
246 super.test_string_simple_interpolation_nonIdentifier(); | 204 super.test_string_simple_interpolation_nonIdentifier(); |
247 } | 205 } |
248 | 206 |
249 @override | 207 @override |
250 @failingTest | |
251 void test_string_simple_unterminated_eof() { | |
252 // See defaultRecoveryStrategy recoverString | |
253 super.test_string_simple_unterminated_eof(); | |
254 } | |
255 | |
256 @override | |
257 @failingTest | |
258 void test_string_simple_unterminated_eol() { | |
259 // See defaultRecoveryStrategy recoverString | |
260 super.test_string_simple_unterminated_eol(); | |
261 } | |
262 | |
263 @override | |
264 @failingTest | |
265 void test_string_simple_unterminated_interpolation_block() { | |
266 // See defaultRecoveryStrategy recoverString | |
267 super.test_string_simple_unterminated_interpolation_block(); | |
268 } | |
269 | |
270 @override | |
271 @failingTest | |
272 void test_string_simple_unterminated_interpolation_identifier() { | |
273 // See defaultRecoveryStrategy recoverString | |
274 super.test_string_simple_unterminated_interpolation_identifier(); | |
275 } | |
276 | |
277 @override | |
278 void test_unmatched_openers() { | 208 void test_unmatched_openers() { |
279 // fasta inserts missing closers except for '<' | 209 // fasta inserts missing closers except for '<' |
280 var openBrace = _scan('{[(<') as analyzer.BeginToken; | 210 var openBrace = _scan('{[(<') as analyzer.BeginToken; |
281 var openBracket = openBrace.next as analyzer.BeginToken; | 211 var openBracket = openBrace.next as analyzer.BeginToken; |
282 var openParen = openBracket.next as analyzer.BeginToken; | 212 var openParen = openBracket.next as analyzer.BeginToken; |
283 var openLT = openParen.next as analyzer.BeginToken; | 213 var openLT = openParen.next as analyzer.BeginToken; |
284 var closeParen = openLT.next; | 214 var closeParen = openLT.next; |
285 var closeBracket = closeParen.next; | 215 var closeBracket = closeParen.next; |
286 var closeBrace = closeBracket.next; | 216 var closeBrace = closeBracket.next; |
287 var eof = closeBrace.next; | 217 var eof = closeBrace.next; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 } else if (token is fasta.UnmatchedToken) { | 295 } else if (token is fasta.UnmatchedToken) { |
366 expect(lastClosedGroup?.endGroup?.next, same(token), | 296 expect(lastClosedGroup?.endGroup?.next, same(token), |
367 reason: 'Unexpected error token for group: $lastClosedGroup'); | 297 reason: 'Unexpected error token for group: $lastClosedGroup'); |
368 expect(token.begin, lastClosedGroup); | 298 expect(token.begin, lastClosedGroup); |
369 } | 299 } |
370 token = token.next; | 300 token = token.next; |
371 } | 301 } |
372 expect(openerStack, isEmpty, reason: 'Missing closers'); | 302 expect(openerStack, isEmpty, reason: 'Missing closers'); |
373 } | 303 } |
374 } | 304 } |
OLD | NEW |