OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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:expect/expect.dart"; |
5 import 'dart:utf'; | 6 import 'dart:utf'; |
6 import '../../../sdk/lib/_internal/compiler/implementation/scanner/scannerlib.da
rt'; | 7 import '../../../sdk/lib/_internal/compiler/implementation/scanner/scannerlib.da
rt'; |
7 import '../../../sdk/lib/_internal/compiler/implementation/scanner/scanner_imple
mentation.dart'; | 8 import '../../../sdk/lib/_internal/compiler/implementation/scanner/scanner_imple
mentation.dart'; |
8 import '../../../sdk/lib/_internal/compiler/implementation/util/characters.dart'
; | 9 import '../../../sdk/lib/_internal/compiler/implementation/util/characters.dart'
; |
9 part '../../../sdk/lib/_internal/compiler/implementation/scanner/byte_strings.da
rt'; | 10 part '../../../sdk/lib/_internal/compiler/implementation/scanner/byte_strings.da
rt'; |
10 part '../../../sdk/lib/_internal/compiler/implementation/scanner/byte_array_scan
ner.dart'; | 11 part '../../../sdk/lib/_internal/compiler/implementation/scanner/byte_array_scan
ner.dart'; |
11 | 12 |
12 Token scan(List<int> bytes) => new ByteArrayScanner(bytes).tokenize(); | 13 Token scan(List<int> bytes) => new ByteArrayScanner(bytes).tokenize(); |
13 | 14 |
14 bool isRunningOnJavaScript() => identical(1, 1.0); | 15 bool isRunningOnJavaScript() => identical(1, 1.0); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // "#!" | 57 // "#!" |
57 token = scan([0x23, 0x21, $EOF]); | 58 token = scan([0x23, 0x21, $EOF]); |
58 Expect.equals(token.info, EOF_INFO); // Treated as a comment. | 59 Expect.equals(token.info, EOF_INFO); // Treated as a comment. |
59 | 60 |
60 // Regression test for issue 1761. | 61 // Regression test for issue 1761. |
61 // "#! Hello, World!" | 62 // "#! Hello, World!" |
62 token = scan([0x23, 0x21, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, | 63 token = scan([0x23, 0x21, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, |
63 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, $EOF]); | 64 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, $EOF]); |
64 Expect.equals(token.info, EOF_INFO); // Treated as a comment. | 65 Expect.equals(token.info, EOF_INFO); // Treated as a comment. |
65 } | 66 } |
OLD | NEW |