@@ -22,24 +22,24 @@ class StringInterpolatorOpt extends MiniPhase {
22
22
override def phaseName : String = " stringInterpolatorOpt"
23
23
24
24
/** Matches a list of constant literals */
25
- private object Literals {
26
- def unapply (tree : SeqLiteral )(implicit ctx : Context ): Option [List [Literal ]] = {
27
- tree.elems match {
28
- case literals if literals.forall(_.isInstanceOf [Literal ]) =>
29
- Some (literals.map(_.asInstanceOf [Literal ]))
30
- case _ => None
31
- }
32
- }
33
- }
34
-
35
- private object StringContextApply {
36
- def unapply (tree : Select )(implicit ctx : Context ): Boolean = {
37
- tree.symbol.eq(defn.StringContextModule_apply ) && {
38
- val qualifier = tree.qualifier
39
- qualifier.isInstanceOf [Ident ] && qualifier.symbol.eq(defn.StringContextModule )
40
- }
41
- }
42
- }
25
+ // private object Literals {
26
+ // def unapply(tree: SeqLiteral)(implicit ctx: Context): Option[List[Literal]] = {
27
+ // tree.elems match {
28
+ // case literals if literals.forall(_.isInstanceOf[Literal]) =>
29
+ // Some(literals.map(_.asInstanceOf[Literal]))
30
+ // case _ => None
31
+ // }
32
+ // }
33
+ // }
34
+ //
35
+ // private object StringContextApply {
36
+ // def unapply(tree: Select)(implicit ctx: Context): Boolean = {
37
+ // tree.symbol.eq(defn.StringContextModule_apply) && {
38
+ // val qualifier = tree.qualifier
39
+ // qualifier.isInstanceOf[Ident] && qualifier.symbol.eq(defn.StringContextModule)
40
+ // }
41
+ // }
42
+ // }
43
43
44
44
// override def transformApply(tree: Apply)(implicit ctx: Context): Tree = {
45
45
// /** Matches an s or raw string interpolator */
@@ -68,18 +68,18 @@ class StringInterpolatorOpt extends MiniPhase {
68
68
// } else tree
69
69
// }
70
70
71
- private def interpolate (strs : List [Literal ], elems : List [Tree ])(implicit ctx : Context ): Tree = {
72
- val stri = strs.iterator
73
- val elemi = elems.iterator
74
- var result : Tree = stri.next
75
- def concat (tree : Tree ): Unit = {
76
- result = result.select(defn.String_+ ).appliedTo(tree)
77
- }
78
- while (elemi.hasNext) {
79
- concat(elemi.next)
80
- val str = stri.next
81
- if (! str.const.stringValue.isEmpty) concat(str)
82
- }
83
- result
84
- }
71
+ // private def interpolate(strs: List[Literal], elems: List[Tree])(implicit ctx: Context): Tree = {
72
+ // val stri = strs.iterator
73
+ // val elemi = elems.iterator
74
+ // var result: Tree = stri.next
75
+ // def concat(tree: Tree): Unit = {
76
+ // result = result.select(defn.String_+).appliedTo(tree)
77
+ // }
78
+ // while (elemi.hasNext) {
79
+ // concat(elemi.next)
80
+ // val str = stri.next
81
+ // if (!str.const.stringValue.isEmpty) concat(str)
82
+ // }
83
+ // result
84
+ // }
85
85
}
0 commit comments