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

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

Issue 2842643004: flatten Keyword into TokenType (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') | pkg/front_end/test/scanner_test.dart » ('j') | 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/token.dart' as fasta; 6 import 'package:front_end/src/fasta/scanner/token.dart' as fasta;
7 import 'package:front_end/src/scanner/token.dart'; 7 import 'package:front_end/src/scanner/token.dart';
8 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; 9 import 'package:test_reflective_loader/test_reflective_loader.dart';
10 10
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 void test_type() { 382 void test_type() {
383 void assertLexeme(String source, TokenType tt) { 383 void assertLexeme(String source, TokenType tt) {
384 var scanner = new StringScanner(source, includeComments: true); 384 var scanner = new StringScanner(source, includeComments: true);
385 var token = scanner.tokenize(); 385 var token = scanner.tokenize();
386 expect(token.type, same(tt), reason: source); 386 expect(token.type, same(tt), reason: source);
387 } 387 }
388 388
389 assertLexeme('1.0', TokenType.DOUBLE); 389 assertLexeme('1.0', TokenType.DOUBLE);
390 assertLexeme('0xA', TokenType.HEXADECIMAL); 390 assertLexeme('0xA', TokenType.HEXADECIMAL);
391 assertLexeme('1', TokenType.INT); 391 assertLexeme('1', TokenType.INT);
392 assertLexeme('var', TokenType.KEYWORD); 392 assertLexeme('var', Keyword.VAR);
393 assertLexeme('#!/', TokenType.SCRIPT_TAG); 393 assertLexeme('#!/', TokenType.SCRIPT_TAG);
394 assertLexeme('foo', TokenType.IDENTIFIER);
394 assertLexeme('"foo"', TokenType.STRING); 395 assertLexeme('"foo"', TokenType.STRING);
395 } 396 }
396 } 397 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/scanner/token.dart ('k') | pkg/front_end/test/scanner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698