@@ -120,72 +120,95 @@ trait Core {
120
120
121
121
/** Tree representing a pacakage clause in the source code */
122
122
type PackageClause = internal.PackageClause
123
+ given (given ctx : Context ): Typeable [Tree , PackageClause ] = internal.matchPackageClause(_)
123
124
124
125
/** Tree representing a statement in the source code */
125
126
type Statement = internal.Statement
127
+ given (given ctx : Context ): Typeable [Tree , Statement ] = internal.matchStatement(_)
126
128
127
129
/** Tree representing an import in the source code */
128
130
type Import = internal.Import
131
+ given (given ctx : Context ): Typeable [Tree , Import ] = internal.matchImport(_)
129
132
130
133
/** Tree representing a definition in the source code. It can be `PackageDef`, `ClassDef`, `TypeDef`, `DefDef` or `ValDef` */
131
134
type Definition = internal.Definition
135
+ given (given ctx : Context ): Typeable [Tree , Definition ] = internal.matchDefinition(_)
132
136
133
137
/** Tree representing a package definition. This includes definitions in all source files */
134
138
type PackageDef = internal.PackageDef
139
+ given (given ctx : Context ): Typeable [Tree , PackageDef ] = internal.matchPackageDef(_)
135
140
136
141
/** Tree representing a class definition. This includes annonymus class definitions and the class of a module object */
137
142
type ClassDef = internal.ClassDef
143
+ given (given ctx : Context ): Typeable [Tree , ClassDef ] = internal.matchClassDef(_)
138
144
139
145
/** Tree representing a type (paramter or member) definition in the source code */
140
146
type TypeDef = internal.TypeDef
147
+ given (given ctx : Context ): Typeable [Tree , TypeDef ] = internal.matchTypeDef(_)
141
148
142
149
/** Tree representing a method definition in the source code */
143
150
type DefDef = internal.DefDef
151
+ given (given ctx : Context ): Typeable [Tree , DefDef ] = internal.matchDefDef(_)
144
152
145
153
/** Tree representing a value definition in the source code This inclues `val`, `lazy val`, `var`, `object` and parameter defintions. */
146
154
type ValDef = internal.ValDef
155
+ given (given ctx : Context ): Typeable [Tree , ValDef ] = internal.matchValDef(_)
147
156
148
157
/** Tree representing an expression in the source code */
149
158
type Term = internal.Term
159
+ given (given ctx : Context ): Typeable [Tree , Term ] = internal.matchTerm(_)
150
160
151
161
/** Tree representing a reference to definition */
152
162
type Ref = internal.Ref
163
+ given (given ctx : Context ): Typeable [Tree , Ref ] = internal.matchRef(_)
153
164
154
165
/** Tree representing a reference to definition with a given name */
155
166
type Ident = internal.Ident
167
+ given (given ctx : Context ): Typeable [Tree , Ident ] = internal.matchIdent(_)
156
168
157
169
/** Tree representing a selection of definition with a given name on a given prefix */
158
170
type Select = internal.Select
171
+ given (given ctx : Context ): Typeable [Tree , Select ] = internal.matchSelect(_)
159
172
160
173
/** Tree representing a literal value in the source code */
161
174
type Literal = internal.Literal
175
+ given (given ctx : Context ): Typeable [Tree , Literal ] = internal.matchLiteral(_)
162
176
163
177
/** Tree representing `this` in the source code */
164
178
type This = internal.This
179
+ given (given ctx : Context ): Typeable [Tree , This ] = internal.matchThis(_)
165
180
166
181
/** Tree representing `new` in the source code */
167
182
type New = internal.New
183
+ given (given ctx : Context ): Typeable [Tree , New ] = internal.matchNew(_)
168
184
169
185
/** Tree representing an argument passed with an explicit name. Such as `arg1 = x` in `foo(arg1 = x)` */
170
186
type NamedArg = internal.NamedArg
187
+ given (given ctx : Context ): Typeable [Tree , NamedArg ] = internal.matchNamedArg(_)
171
188
172
189
/** Tree an application of arguments. It represents a single list of arguments, multiple argument lists will have nested `Apply`s */
173
190
type Apply = internal.Apply
191
+ given (given ctx : Context ): Typeable [Tree , Apply ] = internal.matchApply(_)
174
192
175
193
/** Tree an application of type arguments */
176
194
type TypeApply = internal.TypeApply
195
+ given (given ctx : Context ): Typeable [Tree , TypeApply ] = internal.matchTypeApply(_)
177
196
178
197
/** Tree representing `super` in the source code */
179
198
type Super = internal.Super
199
+ given (given ctx : Context ): Typeable [Tree , Super ] = internal.matchSuper(_)
180
200
181
201
/** Tree representing a type ascription `x: T` in the source code */
182
202
type Typed = internal.Typed
203
+ given (given ctx : Context ): Typeable [Tree , Typed ] = internal.matchTyped(_)
183
204
184
205
/** Tree representing an assignment `x = y` in the source code */
185
206
type Assign = internal.Assign
207
+ given (given ctx : Context ): Typeable [Tree , Assign ] = internal.matchAssign(_)
186
208
187
209
/** Tree representing a block `{ ... }` in the source code */
188
210
type Block = internal.Block
211
+ given (given ctx : Context ): Typeable [Tree , Block ] = internal.matchBlock(_)
189
212
190
213
/** A lambda `(...) => ...` in the source code is represented as
191
214
* a local method and a closure:
@@ -197,87 +220,114 @@ trait Core {
197
220
*
198
221
*/
199
222
type Closure = internal.Closure
223
+ given (given ctx : Context ): Typeable [Tree , Closure ] = internal.matchClosure(_)
200
224
201
225
/** Tree representing an if/then/else `if (...) ... else ...` in the source code */
202
226
type If = internal.If
227
+ given (given ctx : Context ): Typeable [Tree , If ] = internal.matchIf(_)
203
228
204
229
/** Tree representing a pattern match `x match { ... }` in the source code */
205
230
type Match = internal.Match
231
+ given (given ctx : Context ): Typeable [Tree , Match ] = internal.matchMatch(_)
206
232
207
233
/** Tree representing a pattern match `delegate match { ... }` in the source code */ // TODO: drop
208
234
type ImpliedMatch = internal.ImpliedMatch
235
+ given (given ctx : Context ): Typeable [Tree , ImpliedMatch ] = internal.matchImplicitMatch(_)
209
236
210
237
/** Tree representing a try catch `try x catch { ... } finally { ... }` in the source code */
211
238
type Try = internal.Try
239
+ given (given ctx : Context ): Typeable [Tree , Try ] = internal.matchTry(_)
212
240
213
241
/** Tree representing a `return` in the source code */
214
242
type Return = internal.Return
243
+ given (given ctx : Context ): Typeable [Tree , Return ] = internal.matchReturn(_)
215
244
216
245
/** Tree representing a variable argument list in the source code */
217
246
type Repeated = internal.Repeated
247
+ given (given ctx : Context ): Typeable [Tree , Repeated ] = internal.matchRepeated(_)
218
248
219
249
/** Tree representing the scope of an inlined tree */
220
250
type Inlined = internal.Inlined
251
+ given (given ctx : Context ): Typeable [Tree , Inlined ] = internal.matchInlined(_)
221
252
222
253
/** Tree representing a selection of definition with a given name on a given prefix and number of nested scopes of inlined trees */
223
254
type SelectOuter = internal.SelectOuter
255
+ given (given ctx : Context ): Typeable [Tree , SelectOuter ] = internal.matchSelectOuter(_)
224
256
225
257
/** Tree representing a while loop */
226
258
type While = internal.While
259
+ given (given ctx : Context ): Typeable [Tree , While ] = internal.matchWhile(_)
227
260
228
261
/** Type tree representing a type written in the source */
229
262
type TypeTree = internal.TypeTree
263
+ given (given ctx : Context ): Typeable [Tree , TypeTree ] = internal.matchTypeTree(_)
230
264
231
265
/** Type tree representing an inferred type */
232
266
type Inferred = internal.Inferred
267
+ given (given ctx : Context ): Typeable [Tree , Inferred ] = internal.matchInferred(_)
233
268
234
269
/** Type tree representing a reference to definition with a given name */
235
270
type TypeIdent = internal.TypeIdent
271
+ given (given ctx : Context ): Typeable [Tree , TypeIdent ] = internal.matchTypeIdent(_)
236
272
237
273
/** Type tree representing a selection of definition with a given name on a given term prefix */
238
274
type TypeSelect = internal.TypeSelect
275
+ given (given ctx : Context ): Typeable [Tree , TypeSelect ] = internal.matchTypeSelect(_)
239
276
240
277
/** Type tree representing a selection of definition with a given name on a given type prefix */
241
278
type Projection = internal.Projection
279
+ given (given ctx : Context ): Typeable [Tree , Projection ] = internal.matchProjection(_)
242
280
243
281
/** Type tree representing a singleton type */
244
282
type Singleton = internal.Singleton
283
+ given (given ctx : Context ): Typeable [Tree , Singleton ] = internal.matchSingleton(_)
245
284
246
285
/** Type tree representing a type refinement */
247
286
type Refined = internal.Refined
287
+ given (given ctx : Context ): Typeable [Tree , Refined ] = internal.matchRefined(_)
248
288
249
289
/** Type tree representing a type application */
250
290
type Applied = internal.Applied
291
+ given (given ctx : Context ): Typeable [Tree , Applied ] = internal.matchApplied(_)
251
292
252
293
/** Type tree representing an annotated type */
253
294
type Annotated = internal.Annotated
295
+ given (given ctx : Context ): Typeable [Tree , Annotated ] = internal.matchAnnotated(_)
254
296
255
297
/** Type tree representing a type match */
256
298
type MatchTypeTree = internal.MatchTypeTree
299
+ given (given ctx : Context ): Typeable [Tree , MatchTypeTree ] = internal.matchMatchTypeTree(_)
257
300
258
301
/** Type tree representing a by name parameter */
259
302
type ByName = internal.ByName
303
+ given (given ctx : Context ): Typeable [Tree , ByName ] = internal.matchByName(_)
260
304
261
305
/** Type tree representing a lambda abstraction type */
262
306
type LambdaTypeTree = internal.LambdaTypeTree
307
+ given (given ctx : Context ): Typeable [Tree , LambdaTypeTree ] = internal.matchLambdaTypeTree(_)
263
308
264
309
/** Type tree representing a type binding */
265
310
type TypeBind = internal.TypeBind
311
+ given (given ctx : Context ): Typeable [Tree , TypeBind ] = internal.matchTypeBind(_)
266
312
267
313
/** Type tree within a block with aliases `{ type U1 = ... ; T[U1, U2] }` */
268
314
type TypeBlock = internal.TypeBlock
315
+ given (given ctx : Context ): Typeable [Tree , TypeBlock ] = internal.matchTypeBlock(_)
269
316
270
317
/** Type tree representing a type bound written in the source */
271
318
type TypeBoundsTree = internal.TypeBoundsTree
319
+ given (given ctx : Context ): Typeable [Tree , TypeBoundsTree ] = internal.matchTypeBoundsTree(_)
272
320
273
321
/** Type tree representing wildcard type bounds written in the source.
274
322
* The wildcard type `_` (for example in in `List[_]`) will be a type tree that
275
323
* represents a type but has `TypeBound`a inside.
276
324
*/
277
325
type WildcardTypeTree = internal.WildcardTypeTree
326
+ given (given ctx : Context ): Typeable [Tree , WildcardTypeTree ] = internal.matchWildcardTypeTree(_)
278
327
279
328
/** Branch of a pattern match or catch clause */
280
329
type CaseDef = internal.CaseDef
330
+ given (given ctx : Context ): Typeable [Tree , CaseDef ] = internal.matchCaseDef(_)
281
331
282
332
/** Branch of a type pattern match */
283
333
type TypeCaseDef = internal.TypeCaseDef
0 commit comments