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

Unified Diff: pkg/compiler/lib/src/tree/dartstring.dart

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/tracer.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/tree/dartstring.dart
diff --git a/pkg/compiler/lib/src/tree/dartstring.dart b/pkg/compiler/lib/src/tree/dartstring.dart
index 7ada1fa2fdfd80a8d129a374c27c992af5db35ff..684f55bdbf08f071df07b66020185736756ff309 100644
--- a/pkg/compiler/lib/src/tree/dartstring.dart
+++ b/pkg/compiler/lib/src/tree/dartstring.dart
@@ -43,7 +43,7 @@ abstract class DartString extends IterableBase<int> {
String slowToString();
bool operator ==(var other) {
- if (other is !DartString) return false;
+ if (other is! DartString) return false;
DartString otherString = other;
if (length != otherString.length) return false;
Iterator it1 = iterator;
@@ -64,7 +64,6 @@ abstract class DartString extends IterableBase<int> {
String toString() => "DartString#${length}:${slowToString()}";
}
-
/**
* A [DartString] where the content is represented by an actual [String].
*/
@@ -112,6 +111,7 @@ class EscapedSourceDartString extends SourceBasedDartString {
if (toStringCache != null) return toStringCache.codeUnits.iterator;
return new StringEscapeIterator(source);
}
+
String slowToString() {
if (toStringCache != null) return toStringCache;
StringBuffer buffer = new StringBuffer();
@@ -144,6 +144,7 @@ class ConsDartString extends DartString {
toStringCache = left.slowToString() + right.slowToString();
return toStringCache;
}
+
String get source => slowToString();
}
@@ -176,6 +177,7 @@ class ConsDartStringIterator implements Iterator<int> {
}
return true;
}
+
void nextPart() {
if (right != null) {
currentIterator = new HasNextIterator<int>(right.iterator);
@@ -188,7 +190,7 @@ class ConsDartStringIterator implements Iterator<int> {
/**
*Iterator that returns the actual string contents of a string with escapes.
*/
-class StringEscapeIterator implements Iterator<int>{
+class StringEscapeIterator implements Iterator<int> {
final Iterator<int> source;
int _current = null;
@@ -209,12 +211,24 @@ class StringEscapeIterator implements Iterator<int>{
source.moveNext();
code = source.current;
switch (code) {
- case $n: _current = $LF; break;
- case $r: _current = $CR; break;
- case $t: _current = $TAB; break;
- case $b: _current = $BS; break;
- case $f: _current = $FF; break;
- case $v: _current = $VTAB; break;
+ case $n:
+ _current = $LF;
+ break;
+ case $r:
+ _current = $CR;
+ break;
+ case $t:
+ _current = $TAB;
+ break;
+ case $b:
+ _current = $BS;
+ break;
+ case $f:
+ _current = $FF;
+ break;
+ case $v:
+ _current = $VTAB;
+ break;
case $x:
source.moveNext();
int value = hexDigitValue(source.current);
« no previous file with comments | « pkg/compiler/lib/src/tracer.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698