| 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 "package:expect/expect.dart"; |
| 6 import 'package:front_end/src/fasta/scanner.dart'; | 6 import 'package:front_end/src/fasta/scanner.dart'; |
| 7 import 'package:front_end/src/fasta/scanner/characters.dart'; | 7 import 'package:front_end/src/fasta/scanner/characters.dart'; |
| 8 import 'package:front_end/src/fasta/scanner/precedence.dart'; | 8 import 'package:front_end/src/fasta/scanner/precedence.dart'; |
| 9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
| 10 | 10 |
| 11 | |
| 12 Token scan(List<int> bytes) { | 11 Token scan(List<int> bytes) { |
| 13 List<int> zeroTerminated = new Uint8List(bytes.length + 1); | 12 List<int> zeroTerminated = new Uint8List(bytes.length + 1); |
| 14 zeroTerminated.setRange(0, bytes.length, bytes); | 13 zeroTerminated.setRange(0, bytes.length, bytes); |
| 15 zeroTerminated[bytes.length] = 0; | 14 zeroTerminated[bytes.length] = 0; |
| 16 return new Utf8BytesScanner(zeroTerminated).tokenize(); | 15 return new Utf8BytesScanner(zeroTerminated).tokenize(); |
| 17 } | 16 } |
| 18 | 17 |
| 19 Token scanUTF8(List<int> bytes) { | 18 Token scanUTF8(List<int> bytes) { |
| 20 int l = bytes.length; | 19 int l = bytes.length; |
| 21 List<int> stringLiteral = new Uint8List(l + 3); | 20 List<int> stringLiteral = new Uint8List(l + 3); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 0x20, | 201 0x20, |
| 203 0x57, | 202 0x57, |
| 204 0x6f, | 203 0x6f, |
| 205 0x72, | 204 0x72, |
| 206 0x6c, | 205 0x6c, |
| 207 0x64, | 206 0x64, |
| 208 0x21 | 207 0x21 |
| 209 ]); | 208 ]); |
| 210 Expect.equals(token.info, EOF_INFO); // Treated as a comment. | 209 Expect.equals(token.info, EOF_INFO); // Treated as a comment. |
| 211 } | 210 } |
| OLD | NEW |