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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/scanner/byte_strings.dart

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * An abstract string representation. 6 * An abstract string representation.
7 */ 7 */
8 abstract class ByteString extends Iterable<int> implements SourceString { 8 abstract class ByteString extends Iterable<int> implements SourceString {
9 final List<int> bytes; 9 final List<int> bytes;
10 final int offset; 10 final int offset;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 Iterator<int> get iterator => new AsciiStringIterator(bytes); 69 Iterator<int> get iterator => new AsciiStringIterator(bytes);
70 70
71 SourceString copyWithoutQuotes(int initial, int terminal) { 71 SourceString copyWithoutQuotes(int initial, int terminal) {
72 return new AsciiString(bytes, offset + initial, 72 return new AsciiString(bytes, offset + initial,
73 length - initial - terminal); 73 length - initial - terminal);
74 } 74 }
75 75
76 76
77 static AsciiString fromString(String string) { 77 static AsciiString fromString(String string) {
78 List<int> bytes = string.charCodes; 78 List<int> bytes = string.codeUnits;
79 return AsciiString.of(bytes, 0, bytes.length); 79 return AsciiString.of(bytes, 0, bytes.length);
80 } 80 }
81 } 81 }
82 82
83 83
84 class AsciiStringIterator implements Iterator<int> { 84 class AsciiStringIterator implements Iterator<int> {
85 final List<int> bytes; 85 final List<int> bytes;
86 int offset; 86 int offset;
87 final int end; 87 final int end;
88 int _current; 88 int _current;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 * A ByteString-valued token. 145 * A ByteString-valued token.
146 */ 146 */
147 class ByteStringToken extends Token { 147 class ByteStringToken extends Token {
148 final ByteString value; 148 final ByteString value;
149 149
150 ByteStringToken(PrecedenceInfo info, ByteString this.value, int charOffset) 150 ByteStringToken(PrecedenceInfo info, ByteString this.value, int charOffset)
151 : super(info, charOffset); 151 : super(info, charOffset);
152 152
153 String toString() => value.toString(); 153 String toString() => value.toString();
154 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698