Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: pkg/front_end/lib/src/fasta/scanner/utf8_bytes_scanner.dart

Issue 2731863002: move comment tokens into preceedingComments field (Closed)
Patch Set: merge Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/token.dart ('k') | pkg/front_end/test/scanner_fasta_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698