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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 super.test_comment_generic_method_type_assign(); | 66 super.test_comment_generic_method_type_assign(); |
67 } | 67 } |
68 | 68 |
69 @override | 69 @override |
70 @failingTest | 70 @failingTest |
71 void test_comment_generic_method_type_list() { | 71 void test_comment_generic_method_type_list() { |
72 // TODO(paulberry,ahe): Fasta scanner doesn't support generic comment | 72 // TODO(paulberry,ahe): Fasta scanner doesn't support generic comment |
73 // syntax. | 73 // syntax. |
74 super.test_comment_generic_method_type_list(); | 74 super.test_comment_generic_method_type_list(); |
75 } | 75 } |
76 | |
77 void test_pseudo_keywords() { | |
78 var pseudoAnalyzerKeywords = new Set<Keyword>.from([ | |
79 Keyword.ABSTRACT, | |
80 Keyword.AS, | |
81 Keyword.COVARIANT, | |
82 Keyword.DEFERRED, | |
83 Keyword.DYNAMIC, | |
84 Keyword.EXPORT, | |
85 Keyword.EXTERNAL, | |
86 Keyword.FACTORY, | |
87 Keyword.GET, | |
88 Keyword.IMPLEMENTS, | |
89 Keyword.IMPORT, | |
90 Keyword.LIBRARY, | |
91 Keyword.OPERATOR, | |
92 Keyword.PART, | |
93 Keyword.SET, | |
94 Keyword.STATIC, | |
95 Keyword.TYPEDEF, | |
96 ]); | |
97 for (Keyword keyword in Keyword.values) { | |
98 expect(keyword.isPseudoKeyword, pseudoAnalyzerKeywords.contains(keyword), | |
99 reason: keyword.name); | |
100 } | |
101 } | |
102 } | 76 } |
103 | 77 |
104 class TestScanner extends analyzer.Scanner { | 78 class TestScanner extends analyzer.Scanner { |
105 TestScanner(analyzer.CharacterReader reader) : super(reader); | 79 TestScanner(analyzer.CharacterReader reader) : super(reader); |
106 | 80 |
107 @override | 81 @override |
108 void reportError( | 82 void reportError( |
109 analyzer.ScannerErrorCode errorCode, int offset, List<Object> arguments) { | 83 analyzer.ScannerErrorCode errorCode, int offset, List<Object> arguments) { |
110 fail('Unexpected error $errorCode while scanning offset $offset\n' | 84 fail('Unexpected error $errorCode while scanning offset $offset\n' |
111 ' arguments: $arguments'); | 85 ' arguments: $arguments'); |
112 } | 86 } |
113 } | 87 } |
OLD | NEW |