| 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/token.dart' show TokenType; | 9 import '../../scanner/token.dart' show TokenType; |
| 10 | 10 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 int get stringOffset { | 192 int get stringOffset { |
| 193 if (stringOffsetSlackOffset == byteOffset) { | 193 if (stringOffsetSlackOffset == byteOffset) { |
| 194 return byteOffset - utf8Slack - 1; | 194 return byteOffset - utf8Slack - 1; |
| 195 } else { | 195 } else { |
| 196 return byteOffset - utf8Slack; | 196 return byteOffset - utf8Slack; |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 | 199 |
| 200 @override | 200 @override |
| 201 StringToken createSubstringToken(TokenType info, int start, bool asciiOnly, | 201 StringToken createSubstringToken(TokenType type, int start, bool asciiOnly, |
| 202 [int extraOffset = 0]) { | 202 [int extraOffset = 0]) { |
| 203 return new StringToken.fromUtf8Bytes( | 203 return new StringToken.fromUtf8Bytes( |
| 204 info, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart); | 204 type, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart); |
| 205 } | 205 } |
| 206 | 206 |
| 207 @override | 207 @override |
| 208 CommentToken createCommentToken(TokenType info, int start, bool asciiOnly, | 208 CommentToken createCommentToken(TokenType type, int start, bool asciiOnly, |
| 209 [int extraOffset = 0]) { | 209 [int extraOffset = 0]) { |
| 210 return new CommentToken.fromUtf8Bytes( | 210 return new CommentToken.fromUtf8Bytes( |
| 211 info, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart); | 211 type, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart); |
| 212 } | 212 } |
| 213 | 213 |
| 214 @override | 214 @override |
| 215 DartDocToken createDartDocToken(TokenType info, int start, bool asciiOnly, | 215 DartDocToken createDartDocToken(TokenType type, int start, bool asciiOnly, |
| 216 [int extraOffset = 0]) { | 216 [int extraOffset = 0]) { |
| 217 return new DartDocToken.fromUtf8Bytes( | 217 return new DartDocToken.fromUtf8Bytes( |
| 218 info, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart); | 218 type, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart); |
| 219 } | 219 } |
| 220 | 220 |
| 221 bool atEndOfFile() => byteOffset >= bytes.length - 1; | 221 bool atEndOfFile() => byteOffset >= bytes.length - 1; |
| 222 } | 222 } |
| OLD | NEW |