| 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:front_end/src/fasta/scanner/string_scanner.dart'; | 5 import 'package:front_end/src/fasta/scanner/string_scanner.dart'; |
| 6 import 'package:front_end/src/fasta/scanner/keyword.dart' as fasta; | 6 import 'package:front_end/src/fasta/scanner/keyword.dart' as fasta; |
| 7 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; | 7 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; |
| 8 import 'package:front_end/src/scanner/token.dart'; | 8 import 'package:front_end/src/scanner/token.dart'; |
| 9 import 'package:front_end/src/scanner/reader.dart' as analyzer; | 9 import 'package:front_end/src/scanner/reader.dart' as analyzer; |
| 10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 Keyword.IMPORT, | 174 Keyword.IMPORT, |
| 175 Keyword.LIBRARY, | 175 Keyword.LIBRARY, |
| 176 Keyword.OPERATOR, | 176 Keyword.OPERATOR, |
| 177 Keyword.PART, | 177 Keyword.PART, |
| 178 Keyword.SET, | 178 Keyword.SET, |
| 179 Keyword.STATIC, | 179 Keyword.STATIC, |
| 180 Keyword.TYPEDEF, | 180 Keyword.TYPEDEF, |
| 181 ]); | 181 ]); |
| 182 for (Keyword keyword in _allKeywords) { | 182 for (Keyword keyword in _allKeywords) { |
| 183 var isBuiltIn = builtInKeywords.contains(keyword); | 183 var isBuiltIn = builtInKeywords.contains(keyword); |
| 184 expect(keyword.isPseudoKeyword, isBuiltIn, reason: keyword.name); | 184 expect(keyword.isBuiltIn, isBuiltIn, reason: keyword.name); |
| 185 expect((keyword as fasta.Keyword).isBuiltIn, isBuiltIn, | 185 expect((keyword as fasta.Keyword).isBuiltIn, isBuiltIn, |
| 186 reason: keyword.name); | 186 reason: keyword.name); |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 void test_pseudo_keywords() { | 190 void test_pseudo_keywords() { |
| 191 var pseudoKeywords = new Set<Keyword>.from([ | 191 var pseudoKeywords = new Set<Keyword>.from([ |
| 192 fasta.Keyword.ASYNC, | 192 fasta.Keyword.ASYNC, |
| 193 fasta.Keyword.AWAIT, | 193 fasta.Keyword.AWAIT, |
| 194 fasta.Keyword.FUNCTION, | 194 fasta.Keyword.FUNCTION, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 218 // General tokens | 218 // General tokens |
| 219 token = token.next; | 219 token = token.next; |
| 220 expect(token.lexeme, '&'); | 220 expect(token.lexeme, '&'); |
| 221 expect(token.value(), '&'); | 221 expect(token.value(), '&'); |
| 222 // String tokens | 222 // String tokens |
| 223 token = token.next; | 223 token = token.next; |
| 224 expect(token.lexeme, '"home"'); | 224 expect(token.lexeme, '"home"'); |
| 225 expect(token.value(), '"home"'); | 225 expect(token.value(), '"home"'); |
| 226 } | 226 } |
| 227 } | 227 } |
| OLD | NEW |