@@ -28,43 +28,43 @@ class TastyPrinter[T <: Tasty with Singleton](val tasty: T) {
28
28
29
29
def visitTree (x : Tree ): Buffer = x match {
30
30
case Term .Ident (name) =>
31
- this += " Ident(\" " += name += " \" )"
31
+ this += " Term. Ident(\" " += name += " \" )"
32
32
case Term .Select (qualifier, name, signature) =>
33
- this += " Select(" += qualifier += " , \" " += name += " \" , " += signature += " )"
33
+ this += " Term. Select(" += qualifier += " , \" " += name += " \" , " += signature += " )"
34
34
case Term .This (qual) =>
35
- this += " This(" += qual += " )"
35
+ this += " Term. This(" += qual += " )"
36
36
case Term .Super (qual, mix) =>
37
- this += " TypeApply(" += qual += " , " += mix += " )"
37
+ this += " Term. TypeApply(" += qual += " , " += mix += " )"
38
38
case Term .Apply (fun, args) =>
39
- this += " Apply(" += fun += " , " ++= args += " )"
39
+ this += " Term. Apply(" += fun += " , " ++= args += " )"
40
40
case Term .TypeApply (fun, args) =>
41
- this += " TypeApply(" += fun += " , " ++= args += " )"
41
+ this += " Term. TypeApply(" += fun += " , " ++= args += " )"
42
42
case Term .Literal (const) =>
43
- this += " Literal(" += const += " )"
43
+ this += " Term. Literal(" += const += " )"
44
44
case Term .New (tpt) =>
45
- this += " New(" += tpt += " )"
45
+ this += " Term. New(" += tpt += " )"
46
46
case Term .Typed (expr, tpt) =>
47
- this += " Typed(" += expr += " , " += tpt += " )"
47
+ this += " Term. Typed(" += expr += " , " += tpt += " )"
48
48
case Term .NamedArg (name, arg) =>
49
- this += " NamedArg(\" " += name += " \" , " += arg += " )"
49
+ this += " Term. NamedArg(\" " += name += " \" , " += arg += " )"
50
50
case Term .Assign (lhs, rhs) =>
51
- this += " Assign(" += lhs += " , " += rhs += " )"
51
+ this += " Term. Assign(" += lhs += " , " += rhs += " )"
52
52
case Term .Block (stats, expr) =>
53
- this += " Block(" ++= stats += " , " += expr += " )"
53
+ this += " Term. Block(" ++= stats += " , " += expr += " )"
54
54
case Term .If (cond, thenp, elsep) =>
55
- this += " If(" += cond += " , " += thenp += " , " += elsep += " )"
55
+ this += " Term. If(" += cond += " , " += thenp += " , " += elsep += " )"
56
56
case Term .Lambda (meth, tpt) =>
57
- this += " Lambda(" += meth += " , " += tpt += " )"
57
+ this += " Term. Lambda(" += meth += " , " += tpt += " )"
58
58
case Term .Match (selector, cases) =>
59
- this += " Match(" += selector += " , " ++= cases += " )"
59
+ this += " Term. Match(" += selector += " , " ++= cases += " )"
60
60
case Term .Return (expr) =>
61
- this += " Return(" += expr += " )"
61
+ this += " Term. Return(" += expr += " )"
62
62
case Term .Try (block, handlers, finalizer) =>
63
- this += " Try(" += block += " , " ++= handlers += " , " += finalizer += " )"
63
+ this += " Term. Try(" += block += " , " ++= handlers += " , " += finalizer += " )"
64
64
case Term .Repeated (elems) =>
65
- this += " Repeated(" ++= elems += " )"
65
+ this += " Term. Repeated(" ++= elems += " )"
66
66
case Term .Inlined (call, bindings, expansion) =>
67
- this += " Inlined(" += call += " , " ++= bindings += " , " += expansion += " )"
67
+ this += " Term. Inlined(" += call += " , " ++= bindings += " , " += expansion += " )"
68
68
case ValDef (name, tpt, rhs) =>
69
69
this += " ValDef(\" " += name += " \" , " += tpt += " , " += rhs += " )"
70
70
case DefDef (name, typeParams, paramss, returnTpt, rhs) =>
@@ -88,25 +88,25 @@ class TastyPrinter[T <: Tasty with Singleton](val tasty: T) {
88
88
89
89
def visitTypeTree (x : TypeOrBoundsTree ): Buffer = x match {
90
90
case TypeTree .Synthetic () =>
91
- this += " Synthetic()"
91
+ this += " TypeTree. Synthetic()"
92
92
case TypeTree .TypeIdent (name) =>
93
- this += " TypeIdent(\" " += name += " \" )"
93
+ this += " TypeTree. TypeIdent(\" " += name += " \" )"
94
94
case TypeTree .TypeSelect (qualifier, name) =>
95
- this += " TypeSelect(" += qualifier += " , \" " += name += " \" )"
95
+ this += " TypeTree. TypeSelect(" += qualifier += " , \" " += name += " \" )"
96
96
case TypeTree .Singleton (ref) =>
97
- this += " Singleton(" += ref += " )"
97
+ this += " TypeTree. Singleton(" += ref += " )"
98
98
case TypeTree .And (left, right) =>
99
- this += " And(" += left += " , " += right += " )"
99
+ this += " TypeTree. And(" += left += " , " += right += " )"
100
100
case TypeTree .Or (left, right) =>
101
- this += " Or(" += left += " , " += right += " )"
101
+ this += " TypeTree. Or(" += left += " , " += right += " )"
102
102
case TypeTree .Refined (tpt, refinements) =>
103
- this += " Refined(" += tpt += " , " ++= refinements += " )"
103
+ this += " TypeTree. Refined(" += tpt += " , " ++= refinements += " )"
104
104
case TypeTree .Applied (tpt, args) =>
105
- this += " Applied(" += tpt += " , " ++= args += " )"
105
+ this += " TypeTree. Applied(" += tpt += " , " ++= args += " )"
106
106
case TypeTree .ByName (result) =>
107
- this += " ByName(" += result += " )"
107
+ this += " TypeTree. ByName(" += result += " )"
108
108
case TypeTree .Annotated (arg, annot) =>
109
- this += " Annotated(" += arg += " , " += annot += " )"
109
+ this += " TypeTree. Annotated(" += arg += " , " += annot += " )"
110
110
case TypeBoundsTree (lo, hi) =>
111
111
this += " TypeBoundsTree(" += lo += " , " += hi += " )"
112
112
}
@@ -118,34 +118,34 @@ class TastyPrinter[T <: Tasty with Singleton](val tasty: T) {
118
118
119
119
def visitPattern (x : Pattern ): Buffer = x match {
120
120
case Pattern .Value (v) =>
121
- this += " Value(" += v += " )"
121
+ this += " Pattern. Value(" += v += " )"
122
122
case Pattern .Bind (name, body) =>
123
- this += " Bind(\" " += name += " \" , " += body += " )"
123
+ this += " Pattern. Bind(\" " += name += " \" , " += body += " )"
124
124
case Pattern .Unapply (fun, implicits, patterns) =>
125
- this += " Unapply(" += fun += " , " ++= implicits += " , " ++= patterns += " )"
125
+ this += " Pattern. Unapply(" += fun += " , " ++= implicits += " , " ++= patterns += " )"
126
126
case Pattern .Alternative (patterns) =>
127
- this += " Alternative(" ++= patterns += " )"
127
+ this += " Pattern. Alternative(" ++= patterns += " )"
128
128
case Pattern .TypeTest (tpt) =>
129
- this += " TypeTest(" += tpt += " )"
129
+ this += " Pattern. TypeTest(" += tpt += " )"
130
130
}
131
131
132
132
def visitConstant (x : Constant ): Buffer = x match {
133
- case Constant .Unit () => this += " Unit()"
134
- case Constant .Null () => this += " Null()"
135
- case Constant .Boolean (value) => this += " Boolean(" += value += " )"
136
- case Constant .Byte (value) => this += " Byte(" += value += " )"
137
- case Constant .Short (value) => this += " Short(" += value += " )"
138
- case Constant .Char (value) => this += " Char(" += value += " )"
139
- case Constant .Int (value) => this += " Int(" += value.toString += " )"
140
- case Constant .Long (value) => this += " Long(" += value += " )"
141
- case Constant .Float (value) => this += " Float(" += value += " )"
142
- case Constant .Double (value) => this += " Double(" += value += " )"
143
- case Constant .String (value) => this += " String(\" " += value += " \" )"
133
+ case Constant .Unit () => this += " Constant. Unit()"
134
+ case Constant .Null () => this += " Constant. Null()"
135
+ case Constant .Boolean (value) => this += " Constant. Boolean(" += value += " )"
136
+ case Constant .Byte (value) => this += " Constant. Byte(" += value += " )"
137
+ case Constant .Short (value) => this += " Constant. Short(" += value += " )"
138
+ case Constant .Char (value) => this += " Constant. Char(" += value += " )"
139
+ case Constant .Int (value) => this += " Constant. Int(" += value.toString += " )"
140
+ case Constant .Long (value) => this += " Constant. Long(" += value += " )"
141
+ case Constant .Float (value) => this += " Constant. Float(" += value += " )"
142
+ case Constant .Double (value) => this += " Constant. Double(" += value += " )"
143
+ case Constant .String (value) => this += " Constant. String(\" " += value += " \" )"
144
144
}
145
145
146
146
def visitType (x : TypeOrBounds ): Buffer = x match {
147
147
case Type .ConstantType (value) =>
148
- this += " ConstantType(" += value += " )"
148
+ this += " Type. ConstantType(" += value += " )"
149
149
case Type .SymRef (sym, qual) =>
150
150
def visitName (sym : Definition ): Buffer = sym match {
151
151
case ValDef (name, _, _) => this += " ValDef(\" " += name += " \" , _, _)"
@@ -155,48 +155,48 @@ class TastyPrinter[T <: Tasty with Singleton](val tasty: T) {
155
155
case PackageDef (name, _) => this += " PackageDef(\" " += name += " \" , _)"
156
156
case _ => this += " #"
157
157
}
158
- this += " SymRef("
158
+ this += " Type. SymRef("
159
159
visitName(sym)
160
160
this += " , " += qual += " )"
161
161
case Type .TermRef (name, qual) =>
162
- this += " TermRef(\" " += name += " \" , " += qual += " )"
162
+ this += " Type. TermRef(\" " += name += " \" , " += qual += " )"
163
163
case Type .TypeRef (name, qual) =>
164
- this += " TypeRef(\" " += name += " \" , " += qual += " )"
164
+ this += " Type. TypeRef(\" " += name += " \" , " += qual += " )"
165
165
case Type .Refinement (parent, name, info) =>
166
- this += " Refinement(" += parent += " , " += name += " , " += info += " )"
166
+ this += " Type. Refinement(" += parent += " , " += name += " , " += info += " )"
167
167
case Type .AppliedType (tycon, args) =>
168
- this += " AppliedType(" += tycon += " , " ++= args += " )"
168
+ this += " Type. AppliedType(" += tycon += " , " ++= args += " )"
169
169
case Type .AnnotatedType (underlying, annot) =>
170
- this += " AnnotatedType(" += underlying += " , " += annot += " )"
170
+ this += " Type. AnnotatedType(" += underlying += " , " += annot += " )"
171
171
case Type .AndType (left, right) =>
172
- this += " AndType(" += left += " , " += right += " )"
172
+ this += " Type. AndType(" += left += " , " += right += " )"
173
173
case Type .OrType (left, right) =>
174
- this += " OrType(" += left += " , " += right += " )"
174
+ this += " Type. OrType(" += left += " , " += right += " )"
175
175
case Type .ByNameType (underlying) =>
176
- this += " ByNameType(" += underlying += " )"
176
+ this += " Type. ByNameType(" += underlying += " )"
177
177
case Type .ParamRef (binder, idx) =>
178
- this += " ParamRef(" += binder+= " , " += idx += " )"
178
+ this += " Type. ParamRef(" += binder+= " , " += idx += " )"
179
179
case Type .ThisType (tp) =>
180
- this += " ThisType(" += tp += " )"
180
+ this += " Type. ThisType(" += tp += " )"
181
181
case Type .RecursiveThis (binder) =>
182
- this += " RecursiveThis(" += binder += " )"
182
+ this += " Type. RecursiveThis(" += binder += " )"
183
183
case Type .MethodType (argNames, argTypes, resType) =>
184
- this += " MethodType(" ++= argNames += " , " ++= argTypes += " , " += resType += " )"
184
+ this += " Type. MethodType(" ++= argNames += " , " ++= argTypes += " , " += resType += " )"
185
185
case Type .PolyType (argNames, argBounds, resType) =>
186
- this += " PolyType(" ++= argNames += " , " ++= argBounds += " , " += resType += " )"
186
+ this += " Type. PolyType(" ++= argNames += " , " ++= argBounds += " , " += resType += " )"
187
187
case Type .TypeLambda (argNames, argBounds, resType) =>
188
- this += " TypeLambda(" ++= argNames += " , " ++= argBounds += " , " += resType += " )"
188
+ this += " Type. TypeLambda(" ++= argNames += " , " ++= argBounds += " , " += resType += " )"
189
189
case TypeBounds (lo, hi) =>
190
190
this += " TypeBounds(" += lo += " , " += hi += " )"
191
191
case NoPrefix () =>
192
- this += " NoPrefix"
192
+ this += " NoPrefix() "
193
193
}
194
194
195
195
def visitModifier (x : Modifier ): Buffer = x match {
196
- case Modifier .Flags (flags) => this += " Flags(" += flags.toString += " )"
197
- case Modifier .QualifiedPrivate (tp) => this += " QualifiedPrivate(" += tp += " )"
198
- case Modifier .QualifiedProtected (tp) => this += " QualifiedProtected(" += tp += " )"
199
- case Modifier .Annotation (tree) => this += " Annotation(" += tree += " )"
196
+ case Modifier .Flags (flags) => this += " Modifier. Flags(" += flags.toString += " )"
197
+ case Modifier .QualifiedPrivate (tp) => this += " Modifier. QualifiedPrivate(" += tp += " )"
198
+ case Modifier .QualifiedProtected (tp) => this += " Modifier. QualifiedProtected(" += tp += " )"
199
+ case Modifier .Annotation (tree) => this += " Modifier. Annotation(" += tree += " )"
200
200
}
201
201
202
202
def visitId (x : Id ): Buffer = {
0 commit comments