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

Unified Diff: dart/frog/leg/scanner/token.dart

Issue 9447100: Return null from stringValue and call slowToString() instead of toString(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: changes Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/frog/leg/scanner/string_scanner.dart ('k') | dart/frog/leg/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/scanner/token.dart
diff --git a/dart/frog/leg/scanner/token.dart b/dart/frog/leg/scanner/token.dart
index c87406cc932d493dfe1911f213c3a67be5aa7073..86428a5afc3859f26c228ac30b150a98d0394e3e 100644
--- a/dart/frog/leg/scanner/token.dart
+++ b/dart/frog/leg/scanner/token.dart
@@ -91,6 +91,8 @@ class Token {
int get precedence() => info.precedence;
String toString() => info.value.toString();
+
+ String slowToString() => toString();
}
/**
@@ -119,7 +121,9 @@ class StringToken extends Token {
StringToken.fromSource(PrecedenceInfo info, this.value, int charOffset)
: super(info, charOffset);
- String toString() => value.toString();
+ String toString() => "StringToken(${value.slowToString()})";
+
+ String slowToString() => value.slowToString();
}
interface SourceString extends Hashable, Iterable<int> default StringWrapper {
@@ -146,7 +150,7 @@ class StringWrapper implements SourceString {
int hashCode() => stringValue.hashCode();
bool operator ==(other) {
- return other is SourceString && toString() == other.toString();
+ return other is SourceString && toString() == other.slowToString();
}
Iterator<int> iterator() => new StringCodeIterator(stringValue);
@@ -157,6 +161,8 @@ class StringWrapper implements SourceString {
String toString() => stringValue;
+ String slowToString() => stringValue;
+
SourceString copyWithoutQuotes(int initial, int terminal) {
assert(0 <= initial);
assert(0 <= terminal);
« no previous file with comments | « dart/frog/leg/scanner/string_scanner.dart ('k') | dart/frog/leg/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698