@@ -98,6 +98,7 @@ object PickledQuotes {
98
98
99
99
/** Pickle tree into it's TASTY bytes s*/
100
100
private def pickle (tree : Tree )(implicit ctx : Context ): Array [Byte ] = {
101
+ quotePickling.println(i " **** pickling quote of \n ${tree.show}" )
101
102
val pickler = new TastyPickler (defn.RootClass )
102
103
val treePkl = pickler.treePkl
103
104
treePkl.pickle(tree :: Nil )
@@ -107,32 +108,21 @@ object PickledQuotes {
107
108
if (tree.span.exists)
108
109
new PositionPickler (pickler, treePkl.buf.addrOfTree).picklePositions(tree :: Nil )
109
110
110
- if (quotePickling ne noPrinter)
111
- println(i " **** pickling quote of \n ${tree.show}" )
112
-
113
111
val pickled = pickler.assembleParts()
114
-
115
- if (quotePickling ne noPrinter)
116
- println(new TastyPrinter (pickled).printContents())
117
-
112
+ quotePickling.println(s " **** pickled quote \n ${new TastyPrinter (pickled).printContents()}" )
118
113
pickled
119
114
}
120
115
121
116
/** Unpickle TASTY bytes into it's tree */
122
117
private def unpickle (bytes : Array [Byte ], splices : Seq [Any ], isType : Boolean )(implicit ctx : Context ): Tree = {
123
- if (quotePickling ne noPrinter) {
124
- println(i " **** unpickling quote from TASTY " )
125
- println(new TastyPrinter (bytes).printContents())
126
- }
118
+ quotePickling.println(s " **** unpickling quote from TASTY \n ${new TastyPrinter (bytes).printContents()}" )
127
119
128
120
val mode = if (isType) UnpickleMode .TypeTree else UnpickleMode .Term
129
121
val unpickler = new QuoteUnpickler (bytes, splices, mode)
130
122
unpickler.enter(Set .empty)
131
- val tree = unpickler.tree
132
-
133
- if (quotePickling ne noPrinter)
134
- println(i " **** unpickle quote ${tree.show}" )
135
123
124
+ val tree = unpickler.tree
125
+ quotePickling.println(i " **** unpickle quote ${tree.show}" )
136
126
tree
137
127
}
138
128
0 commit comments