@@ -124,19 +124,42 @@ trait Core {
124
124
/** Workaround missing `|` types in Scala 2 to represent `Term | TypeTree` */
125
125
type TermOrTypeTree /* Term | TypeTree */
126
126
127
- /** Tree representing executable code written in the source */
127
+ /** Tree representing code written in the source */
128
128
type Tree
129
+
130
+ /** Tree representing a pacakage clause in the source code */
129
131
type PackageClause <: Tree
132
+
133
+ /** Tree representing a statement in the source code */
130
134
type Statement <: Tree
135
+
136
+ /** Tree representing an import in the source code */
131
137
type Import <: Statement
138
+
139
+ /** Tree representing a definition in the source code. It can be `PackageDef`, `ClassDef`, `TypeDef`, `DefDef` or `ValDef`*/
132
140
type Definition <: Statement
141
+
142
+ /** Tree representing a package definition. This includes definitions in all source files. */
133
143
type PackageDef <: Definition
144
+
145
+ /** Tree representing a class definition. This includes annonymus class definitions and the class of a module object. */
134
146
type ClassDef <: Definition
147
+
148
+ /** Tree representing a type (paramter or member) definition in the source code. */
135
149
type TypeDef <: Definition
150
+
151
+ /** Tree representing a method definition in the source code. */
136
152
type DefDef <: Definition
153
+
154
+ /** Tree representing a value definition in the source code. This inclues `val`, `lazy val`, `var`, `object` and parameter defintions. */
137
155
type ValDef <: Definition
156
+
157
+ /** Tree representing an expression in the source code. */
138
158
type Term <: Statement
139
159
160
+ // TODO Add subtype types of Term for documentation? Or support refined bindings and add the types.
161
+
162
+
140
163
/** Branch of a pattern match or catch clause */
141
164
type CaseDef
142
165
@@ -145,30 +168,69 @@ trait Core {
145
168
146
169
/** Pattern tree of the pattern part of a CaseDef */
147
170
type Pattern
171
+
172
+ /** Pattern representing a value. This includes `1`, ```x``` and `_` */
148
173
type Value <: Pattern
174
+
175
+ /** Pattern representing a `_ @ _` binding. */
149
176
type Bind <: Pattern
177
+
178
+ /** Pattern representing a `Xyz(...)` unapply. */
150
179
type Unapply <: Pattern
180
+
181
+ /** Pattern representing `X | Y | ...` alternatives. */
151
182
type Alternative <: Pattern
183
+
184
+ /** Pattern representing a `x: Y` type test. */
152
185
type TypeTest <: Pattern
153
186
154
- /** Tree representing a type written in the source */
187
+ /** Type tree representing a type or a bounds written in the source */
155
188
type TypeOrBoundsTree
189
+
190
+ /** Type tree representing a type written in the source */
156
191
type TypeTree <: TypeOrBoundsTree
192
+
193
+ // TODO Add subtype types of TypeTree for documentation? Or support refined bindings and add the types.
194
+
195
+
196
+ /** Type tree representing a type bound written in the source */
157
197
type TypeBoundsTree <: TypeOrBoundsTree
158
198
199
+ /** Type or bounds */
159
200
type TypeOrBounds
201
+
202
+ /** NoPrefix for a type selection */
160
203
type NoPrefix <: TypeOrBounds
204
+
205
+ /** Type bounds */
161
206
type TypeBounds <: TypeOrBounds
207
+
208
+ /** A type */
162
209
type Type <: TypeOrBounds
210
+
211
+ /** A type that is recursively defined */
163
212
type RecursiveType <: Type
213
+
164
214
// TODO can we add the bound back without an cake?
165
215
// TODO is LambdaType really needed? ParamRefExtractor could be split into more precise extractors
216
+ /** Common abstraction for lambda types (MethodType, PolyType and TypeLambda). */
166
217
type LambdaType [ParamInfo /* <: TypeOrBounds*/ ] <: Type
218
+
219
+ /** Type of the definition of a method taking a single list of parameters. It's return type may be a MethodType. */
167
220
type MethodType <: LambdaType [Type ]
221
+
222
+ /** Type of the definition of a method taking a list of type parameters. It's return type may be a MethodType. */
168
223
type PolyType <: LambdaType [TypeBounds ]
224
+
225
+ /** Type of the definition of a type lambda taking a list of type parameters. It's return type may be a TypeLambda. */
169
226
type TypeLambda <: LambdaType [TypeBounds ]
170
227
171
228
229
+ /** Import selectors:
230
+ * * SimpleSelector: `.bar` in `import foo.bar`
231
+ * * RenameSelector: `.{bar => baz}` in `import foo.{bar => baz}`
232
+ * * OmitSelector: `.{bar => _}` in `import foo.{bar => _}`
233
+ */
172
234
type ImportSelector
173
235
174
236
/** Untyped identifier */
@@ -187,12 +249,26 @@ trait Core {
187
249
* Then can be compared with == to know if the definition is the same.
188
250
*/
189
251
type Symbol
252
+
253
+ /** Symbol of a package defnition */
190
254
type PackageSymbol <: Symbol
255
+
256
+ /** Symbol of a class defnition. This includes annonymus class definitions and the class of a module object. */
191
257
type ClassSymbol <: Symbol
258
+
259
+ /** Symbol of a type (paramter or member) definition. */
192
260
type TypeSymbol <: Symbol
261
+
262
+ /** Symbol representing a method definition. */
193
263
type DefSymbol <: Symbol
264
+
265
+ /** Symbol representing a value definition. This inclues `val`, `lazy val`, `var`, `object` and parameter defintions. */
194
266
type ValSymbol <: Symbol
267
+
268
+ /** Symbol representing a bind definition. */
195
269
type BindSymbol <: Symbol
270
+
271
+ /** No symbol availabe. */
196
272
type NoSymbol <: Symbol
197
273
198
274
}
0 commit comments