| 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/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 Loading... |
| 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 } |
| OLD | NEW |