@@ -48,7 +48,7 @@ package scala.tasty.reflect
48
48
* | +- Or
49
49
* | +- MatchType
50
50
* | +- ByName
51
- * | +- TypeLambdaTree
51
+ * | +- LambdaTypeTree
52
52
* | +- Bind
53
53
* |
54
54
* +- TypeBoundsTree
@@ -136,29 +136,97 @@ trait Core {
136
136
/** Tree representing an import in the source code */
137
137
type Import <: Statement
138
138
139
- /** Tree representing a definition in the source code. It can be `PackageDef`, `ClassDef`, `TypeDef`, `DefDef` or `ValDef`*/
139
+ /** Tree representing a definition in the source code. It can be `PackageDef`, `ClassDef`, `TypeDef`, `DefDef` or `ValDef` */
140
140
type Definition <: Statement
141
141
142
- /** Tree representing a package definition. This includes definitions in all source files. */
142
+ /** Tree representing a package definition. This includes definitions in all source files */
143
143
type PackageDef <: Definition
144
144
145
- /** Tree representing a class definition. This includes annonymus class definitions and the class of a module object. */
145
+ /** Tree representing a class definition. This includes annonymus class definitions and the class of a module object */
146
146
type ClassDef <: Definition
147
147
148
- /** Tree representing a type (paramter or member) definition in the source code. */
148
+ /** Tree representing a type (paramter or member) definition in the source code */
149
149
type TypeDef <: Definition
150
150
151
- /** Tree representing a method definition in the source code. */
151
+ /** Tree representing a method definition in the source code */
152
152
type DefDef <: Definition
153
153
154
- /** Tree representing a value definition in the source code. This inclues `val`, `lazy val`, `var`, `object` and parameter defintions. */
154
+ /** Tree representing a value definition in the source code This inclues `val`, `lazy val`, `var`, `object` and parameter defintions. */
155
155
type ValDef <: Definition
156
156
157
- /** Tree representing an expression in the source code. */
157
+ /** Tree representing an expression in the source code */
158
158
type Term <: Statement
159
159
160
- // TODO Add subtype types of Term for documentation? Or support refined bindings and add the types.
160
+ /** Trees representing an expression in the source code */
161
+ val Term : TermCoreModule
161
162
163
+ /** Trees representing an expression in the source code */
164
+ trait TermCoreModule {
165
+
166
+ /** Tree representing a reference to definition with a given name */
167
+ type Ident <: Term
168
+
169
+ /** Tree representing a selection of definition with a given name on a given prefix */
170
+ type Select <: Term
171
+
172
+ /** Tree representing a literal value in the source code */
173
+ type Literal <: Term
174
+
175
+ /** Tree representing `this` in the source code */
176
+ type This <: Term
177
+
178
+ /** Tree representing `new` in the source code */
179
+ type New <: Term
180
+
181
+ /** Tree representing an argument passed with an explicit name. Such as `arg1 = x` in `foo(arg1 = x)` */
182
+ type NamedArg <: Term
183
+
184
+ /** Tree an application of arguments. It represents a single list of arguments, multiple argument lists will have nested `Apply`s */
185
+ type Apply <: Term
186
+
187
+ /** Tree an application of type arguments */
188
+ type TypeApply <: Term
189
+
190
+ /** Tree representing `super` in the source code */
191
+ type Super <: Term
192
+
193
+ /** Tree representing a type ascription `x: T` in the source code */
194
+ type Typed <: Term
195
+
196
+ /** Tree representing an assignment `x = y` in the source code */
197
+ type Assign <: Term
198
+
199
+ /** Tree representing a block `{ ... }` in the source code */
200
+ type Block <: Term
201
+
202
+ /** Tree representing a lambda `(...) => ...` in the source code */
203
+ type Lambda <: Term
204
+
205
+ /** Tree representing an if/then/else `if (...) ... else ...` in the source code */
206
+ type If <: Term
207
+
208
+ /** Tree representing a pattern match `x match { ... }` in the source code */
209
+ type Match <: Term
210
+
211
+ /** Tree representing a tyr catch `try x catch { ... } finally { ... }` in the source code */
212
+ type Try <: Term
213
+
214
+ /** Tree representing a `return` in the source code */
215
+ type Return <: Term
216
+
217
+ /** Tree representing a variable argument list in the source code */
218
+ type Repeated <: Term
219
+
220
+ /** Tree representing the scope of an inlined tree */
221
+ type Inlined <: Term
222
+
223
+ /** Tree representing a selection of definition with a given name on a given prefix and number of nested scopes of inlined trees */
224
+ type SelectOuter <: Term
225
+
226
+ /** Tree representing a while loop */
227
+ type While <: Term
228
+
229
+ }
162
230
163
231
/** Branch of a pattern match or catch clause */
164
232
type CaseDef <: AnyRef
@@ -190,8 +258,55 @@ trait Core {
190
258
/** Type tree representing a type written in the source */
191
259
type TypeTree <: TypeOrBoundsTree
192
260
193
- // TODO Add subtype types of TypeTree for documentation? Or support refined bindings and add the types.
261
+ /** Type trees representing a type written in the source */
262
+ val TypeTree : TypeTreeCoreModule
263
+
264
+ /** Type trees representing a type written in the source */
265
+ abstract class TypeTreeCoreModule {
266
+
267
+ /** Type tree representing an inferred type */
268
+ type Synthetic <: TypeTree
269
+
270
+ /** Type tree representing a reference to definition with a given name */
271
+ type Ident <: TypeTree
272
+
273
+ /** Type tree representing a selection of definition with a given name on a given term prefix */
274
+ type Select <: TypeTree
275
+
276
+ /** Type tree representing a selection of definition with a given name on a given type prefix */
277
+ type Project <: TypeTree
278
+
279
+ /** Type tree representing a singleton type */
280
+ type Singleton <: TypeTree
281
+
282
+ /** Type tree representing a type refinement */
283
+ type Refined <: TypeTree
284
+
285
+ /** Type tree representing a type application */
286
+ type Applied <: TypeTree
287
+
288
+ /** Type tree representing an annotated type */
289
+ type Annotated <: TypeTree
290
+
291
+ /** Type tree representing an intersection type */
292
+ type And <: TypeTree
293
+
294
+ /** Type tree representing a union type */
295
+ type Or <: TypeTree
296
+
297
+ /** Type tree representing a type match */
298
+ type MatchType <: TypeTree
299
+
300
+ /** Type tree representing a by name parameter */
301
+ type ByName <: TypeTree
302
+
303
+ /** Type tree representing a lambda abstraction type */
304
+ type LambdaTypeTree <: TypeTree
305
+
306
+ /** Type tree representing a type binding */
307
+ type Bind <: TypeTree
194
308
309
+ }
195
310
196
311
/** Type tree representing a type bound written in the source */
197
312
type TypeBoundsTree <: TypeOrBoundsTree
@@ -250,25 +365,25 @@ trait Core {
250
365
*/
251
366
type Symbol <: AnyRef
252
367
253
- /** Symbol of a package defnition */
368
+ /** Symbol of a package definition */
254
369
type PackageSymbol <: Symbol
255
370
256
- /** Symbol of a class defnition . This includes annonymus class definitions and the class of a module object. */
371
+ /** Symbol of a class definition . This includes anonymous class definitions and the class of a module object. */
257
372
type ClassSymbol <: Symbol
258
373
259
- /** Symbol of a type (paramter or member) definition. */
374
+ /** Symbol of a type (parameter or member) definition. */
260
375
type TypeSymbol <: Symbol
261
376
262
377
/** Symbol representing a method definition. */
263
378
type DefSymbol <: Symbol
264
379
265
- /** Symbol representing a value definition. This inclues `val`, `lazy val`, `var`, `object` and parameter defintions . */
380
+ /** Symbol representing a value definition. This includes `val`, `lazy val`, `var`, `object` and parameter definitions . */
266
381
type ValSymbol <: Symbol
267
382
268
383
/** Symbol representing a bind definition. */
269
384
type BindSymbol <: Symbol
270
385
271
- /** No symbol availabe . */
386
+ /** No symbol available . */
272
387
type NoSymbol <: Symbol
273
388
274
389
}
0 commit comments