Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: pkg/front_end/test/token_test.dart

Issue 2800583002: move fasta.Keyword methods to analyzer.Keyword (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/front_end/lib/src/scanner/token.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/scanner/token.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698