Chromium Code Reviews| Index: frog/value.dart |
| diff --git a/frog/value.dart b/frog/value.dart |
| index 2e3a86bd47ea7d560ad25355249d32a18871fca8..f145a16bd888b3bc6e730cf50773148df12bed85 100644 |
| --- a/frog/value.dart |
| +++ b/frog/value.dart |
| @@ -546,7 +546,7 @@ class EvaluatedValue extends Value { |
| static String codeWithComments(String canonicalCode, SourceSpan span) { |
| return (span != null && span.text != canonicalCode) |
| - ? '$canonicalCode/*${span.text}*/' : canonicalCode; |
| + ? '$canonicalCode/*${_escapeForComment(span.text)}*/' : canonicalCode; |
| } |
| } |
| @@ -653,7 +653,7 @@ class GlobalValue extends Value implements Comparable { |
| factory GlobalValue.fromConst(uniqueId, Value exp, dependencies) { |
| var name = "const\$$uniqueId"; |
| - var codeWithComment = "$name/*${exp.span.text}*/"; |
| + var codeWithComment = "$name/*${_escapeForComment(exp.span.text)}*/"; |
| return new GlobalValue( |
| exp.type, codeWithComment, true, null, name, exp, name, |
| exp.span, |
| @@ -738,3 +738,7 @@ class BareValue extends Value { |
| return null; |
| } |
| } |
| + |
| +String _escapeForComment(String text) { |
| + return text.replaceAll('/*', '/ *').replaceAll('*/', '* /'); |
|
jimhug
2011/12/02 00:16:00
I think you need two more spaces to make this bull
Jennifer Messerly
2011/12/02 00:24:23
with the double replace,
|
| +} |