@@ -41,32 +41,32 @@ class StringInterpolatorOpt extends MiniPhase {
41
41
}
42
42
}
43
43
44
- override def transformApply (tree : Apply )(implicit ctx : Context ): Tree = {
45
- /** Matches an s or raw string interpolator */
46
- if (tree.symbol.eq(defn.StringContextRaw ) || tree.symbol.eq(defn.StringContextS )) {
47
- tree match {
48
- case Apply (Select (Apply (StringContextApply (), List (Literals (strs))), _),
49
- List (SeqLiteral (elems, _))) if elems.length == strs.length - 1 =>
50
- /** Match trees that resemble s and raw string interpolations. In the case of the s
51
- * interpolator, escapes the string constants. Exposes the string constants as well as
52
- * the variable references.
53
- */
54
- if (tree.symbol == defn.StringContextRaw ) interpolate(strs, elems)
55
- else { // tree.symbol == defn.StringContextS
56
- try {
57
- val escapedStrs = strs.map { str =>
58
- val escapedValue = StringContext .processEscapes(str.const.stringValue)
59
- cpy.Literal (str)(Constant (escapedValue))
60
- }
61
- interpolate(escapedStrs, elems)
62
- } catch {
63
- case _ : StringContext .InvalidEscapeException => tree
64
- }
65
- }
66
- case _ => tree
67
- }
68
- } else tree
69
- }
44
+ // override def transformApply(tree: Apply)(implicit ctx: Context): Tree = {
45
+ // /** Matches an s or raw string interpolator */
46
+ // if (tree.symbol.eq(defn.StringContextRaw) || tree.symbol.eq(defn.StringContextS)) {
47
+ // tree match {
48
+ // case Apply(Select(Apply(StringContextApply(), List(Literals(strs))), _),
49
+ // List(SeqLiteral(elems, _))) if elems.length == strs.length - 1 =>
50
+ // /** Match trees that resemble s and raw string interpolations. In the case of the s
51
+ // * interpolator, escapes the string constants. Exposes the string constants as well as
52
+ // * the variable references.
53
+ // */
54
+ // if (tree.symbol == defn.StringContextRaw) interpolate(strs, elems)
55
+ // else { // tree.symbol == defn.StringContextS
56
+ // try {
57
+ // val escapedStrs = strs.map { str =>
58
+ // val escapedValue = StringContext.processEscapes(str.const.stringValue)
59
+ // cpy.Literal(str)(Constant(escapedValue))
60
+ // }
61
+ // interpolate(escapedStrs, elems)
62
+ // } catch {
63
+ // case _: StringContext.InvalidEscapeException => tree
64
+ // }
65
+ // }
66
+ // case _ => tree
67
+ // }
68
+ // } else tree
69
+ // }
70
70
71
71
private def interpolate (strs : List [Literal ], elems : List [Tree ])(implicit ctx : Context ): Tree = {
72
72
val stri = strs.iterator
0 commit comments