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 'package:analyzer/src/fasta/token_utils.dart'; | 5 import 'package:analyzer/src/fasta/token_utils.dart'; |
6 import 'package:front_end/src/scanner/errors.dart' as analyzer; | 6 import 'package:front_end/src/scanner/errors.dart' as analyzer; |
7 import 'package:front_end/src/scanner/reader.dart' as analyzer; | 7 import 'package:front_end/src/scanner/reader.dart' as analyzer; |
8 import 'package:front_end/src/scanner/scanner.dart' as analyzer; | 8 import 'package:front_end/src/scanner/scanner.dart' as analyzer; |
9 import 'package:front_end/src/scanner/token.dart'; | 9 import 'package:front_end/src/scanner/token.dart'; |
10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
(...skipping 26 matching lines...) Expand all Loading... |
37 var fastaToken = fromAnalyzerTokenStream(analyzerToken); | 37 var fastaToken = fromAnalyzerTokenStream(analyzerToken); |
38 // Since [scanWithListener] reports errors to the listener, we don't | 38 // Since [scanWithListener] reports errors to the listener, we don't |
39 // expect any error tokens in the Fasta token stream, so we convert using | 39 // expect any error tokens in the Fasta token stream, so we convert using |
40 // ToAnalyzerTokenStreamConverter_NoErrors. | 40 // ToAnalyzerTokenStreamConverter_NoErrors. |
41 return new ToAnalyzerTokenStreamConverter_NoErrors() | 41 return new ToAnalyzerTokenStreamConverter_NoErrors() |
42 .convertTokens(fastaToken); | 42 .convertTokens(fastaToken); |
43 } | 43 } |
44 | 44 |
45 @override | 45 @override |
46 @failingTest | 46 @failingTest |
47 void test_ampersand_ampersand_eq() { | |
48 // TODO(paulberry,ahe): Fasta scanner doesn't support lazy assignment | |
49 // operators. | |
50 super.test_ampersand_ampersand_eq(); | |
51 } | |
52 | |
53 @override | |
54 @failingTest | |
55 void test_bar_bar_eq() { | |
56 // TODO(paulberry,ahe): Fasta scanner doesn't support lazy assignment | |
57 // operators. | |
58 super.test_bar_bar_eq(); | |
59 } | |
60 | |
61 @override | |
62 @failingTest | |
63 void test_comment_generic_method_type_assign() { | 47 void test_comment_generic_method_type_assign() { |
64 // TODO(paulberry,ahe): Fasta scanner doesn't support generic comment | 48 // TODO(paulberry,ahe): Fasta scanner doesn't support generic comment |
65 // syntax. | 49 // syntax. |
66 super.test_comment_generic_method_type_assign(); | 50 super.test_comment_generic_method_type_assign(); |
67 } | 51 } |
68 | 52 |
69 @override | 53 @override |
70 @failingTest | 54 @failingTest |
71 void test_comment_generic_method_type_list() { | 55 void test_comment_generic_method_type_list() { |
72 // TODO(paulberry,ahe): Fasta scanner doesn't support generic comment | 56 // TODO(paulberry,ahe): Fasta scanner doesn't support generic comment |
73 // syntax. | 57 // syntax. |
74 super.test_comment_generic_method_type_list(); | 58 super.test_comment_generic_method_type_list(); |
75 } | 59 } |
76 } | 60 } |
77 | 61 |
78 class TestScanner extends analyzer.Scanner { | 62 class TestScanner extends analyzer.Scanner { |
79 TestScanner(analyzer.CharacterReader reader) : super.create(reader); | 63 TestScanner(analyzer.CharacterReader reader) : super.create(reader); |
80 | 64 |
81 @override | 65 @override |
82 void reportError( | 66 void reportError( |
83 analyzer.ScannerErrorCode errorCode, int offset, List<Object> arguments) { | 67 analyzer.ScannerErrorCode errorCode, int offset, List<Object> arguments) { |
84 fail('Unexpected error $errorCode while scanning offset $offset\n' | 68 fail('Unexpected error $errorCode while scanning offset $offset\n' |
85 ' arguments: $arguments'); | 69 ' arguments: $arguments'); |
86 } | 70 } |
87 } | 71 } |
OLD | NEW |