| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library fasta.scanner.utf8_bytes_scanner; | 5 library fasta.scanner.utf8_bytes_scanner; |
| 6 | 6 |
| 7 import 'dart:convert' show UNICODE_BOM_CHARACTER_RUNE, UTF8; | 7 import 'dart:convert' show UNICODE_BOM_CHARACTER_RUNE, UTF8; |
| 8 | 8 |
| 9 import '../scanner.dart' show unicodeReplacementCharacter; | 9 import '../scanner.dart' show unicodeReplacementCharacter; |
| 10 | 10 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (stringOffsetSlackOffset == byteOffset) { | 191 if (stringOffsetSlackOffset == byteOffset) { |
| 192 return byteOffset - utf8Slack - 1; | 192 return byteOffset - utf8Slack - 1; |
| 193 } else { | 193 } else { |
| 194 return byteOffset - utf8Slack; | 194 return byteOffset - utf8Slack; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 Token firstToken() => tokens.next; | 198 Token firstToken() => tokens.next; |
| 199 Token previousToken() => tail; | 199 Token previousToken() => tail; |
| 200 | 200 |
| 201 void appendSubstringToken(PrecedenceInfo info, int start, bool asciiOnly, | 201 @override |
| 202 StringToken createSubstringToken( |
| 203 PrecedenceInfo info, int start, bool asciiOnly, |
| 202 [int extraOffset = 0]) { | 204 [int extraOffset = 0]) { |
| 203 tail.next = new StringToken.fromUtf8Bytes( | 205 return new StringToken.fromUtf8Bytes( |
| 204 info, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart); | 206 info, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart); |
| 205 tail = tail.next; | |
| 206 } | 207 } |
| 207 | 208 |
| 208 bool atEndOfFile() => byteOffset >= bytes.length - 1; | 209 bool atEndOfFile() => byteOffset >= bytes.length - 1; |
| 209 } | 210 } |
| OLD | NEW |