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

Unified Diff: frog/leg/compile_time_constants.dart

Issue 9642001: Make string juxtaposition combine properly with string interpolations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | frog/leg/scanner/listener.dart » ('j') | frog/leg/scanner/listener.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/compile_time_constants.dart
diff --git a/frog/leg/compile_time_constants.dart b/frog/leg/compile_time_constants.dart
index 5572019ca39e77777a8a8f1c8c0ed1d083c0f653..e2fb31236bb7a49e9b44d183bbd9caf7c23c3846 100644
--- a/frog/leg/compile_time_constants.dart
+++ b/frog/leg/compile_time_constants.dart
@@ -59,7 +59,7 @@ class PrimitiveConstant extends Constant {
bool operator ==(var other) {
if (other is !PrimitiveConstant) return false;
PrimitiveConstant otherPrimitive = other;
- // We use == instead of === so that DartStrings compare correctly.
+ // We use == instead of === so that DartStrings compare correctly.
return value == otherPrimitive.value;
}
@@ -119,7 +119,7 @@ class IntConstant extends PrimitiveConstant {
case "~/": return new IntConstant(value ~/ right);
case "|": return new IntConstant(value | right);
case "&": return new IntConstant(value & right);
- case "^": return new IntConstant(value ^ right);
+ case "^": return new IntConstant(value ^ right);
case "<<":
// TODO(floitsch): find a better way to guard against shifts to the
// left.
@@ -171,7 +171,7 @@ class DoubleConstant extends PrimitiveConstant {
} else if (value == -double.INFINITY) {
buffer.add("(-1/0)");
} else {
- buffer.add("($value)");
+ buffer.add("($value)");
}
}
@@ -269,7 +269,7 @@ class StringConstant extends PrimitiveConstant {
if (other.isString() && op == "+") {
StringConstant otherString = other;
DartString right = otherString.value;
- return new StringConstant(new ConsDartString(value, right));
+ return new StringConstant(new DartString.cons(value, right));
}
// Visit super in case the [op] was "==", "===", "!=" or "!===".
return super.binaryFold(op, other);
@@ -295,7 +295,7 @@ class ListConstant extends ObjectConstant {
int _hashCode;
ListConstant(Type type, this.entries) : super(type) {
- // TODO(floitsch): create a better hash.
+ // TODO(floitsch): create a better hash.
int hash = 0;
for (Constant input in entries) hash ^= input.hashCode();
_hashCode = hash;
@@ -342,7 +342,7 @@ class ConstructedConstant extends ObjectConstant {
ConstructedConstant(Type type, this.fields) : super(type) {
assert(type !== null);
- // TODO(floitsch): create a better hash.
+ // TODO(floitsch): create a better hash.
int hash = 0;
for (Constant field in fields) {
hash ^= field.hashCode();
@@ -523,7 +523,7 @@ class ConstantHandler extends CompilerTask {
StringBuffer writeJsCode(StringBuffer buffer, Constant value) {
value.writeJsCode(buffer, this);
- return buffer;
+ return buffer;
}
StringBuffer writeJsCodeForVariable(StringBuffer buffer,
@@ -543,7 +543,7 @@ class ConstantHandler extends CompilerTask {
String name = compiledConstants[constant];
buffer.add("${compiler.namer.ISOLATE}.prototype.$name");
} else {
- writeJsCode(buffer, constant);
+ writeJsCode(buffer, constant);
}
return buffer;
}
@@ -629,11 +629,11 @@ class CompileTimeConstantEvaluator extends AbstractVisitor {
// there.
return node.value ? const BoolConstant(true) : const BoolConstant(false);
}
-
+
Constant visitLiteralDouble(LiteralDouble node) {
return new DoubleConstant(node.value);
}
-
+
Constant visitLiteralInt(LiteralInt node) {
return new IntConstant(node.value);
}
« no previous file with comments | « no previous file | frog/leg/scanner/listener.dart » ('j') | frog/leg/scanner/listener.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698