[FIR/IR generator] Rename field's needAcceptAndTransform to isChild
This better describes the semantics.
This commit is contained in:
committed by
Space Team
parent
02052421e6
commit
d0f87f9aba
+6
-3
@@ -57,11 +57,14 @@ abstract class AbstractField<Field : AbstractField<Field>> {
|
||||
var useInBaseTransformerDetection = true
|
||||
|
||||
/**
|
||||
* Whether a visitor should be run on this field in the generated `acceptChildren` in `transformChildren` method.
|
||||
* Whether this field semantically represents a reference to a child node of the tree.
|
||||
*
|
||||
* This may have the effect of including or excluding this field from visiting it by visitors in the generated
|
||||
* `acceptChildren` and `transformChildren` methods (child fields are always visited in those methods).
|
||||
*
|
||||
* Only has effect if [containsElement] is `true`.
|
||||
*/
|
||||
var needAcceptAndTransform: Boolean = true
|
||||
var isChild: Boolean = true
|
||||
|
||||
open val overriddenTypes: MutableSet<TypeRefWithNullability> = mutableSetOf()
|
||||
|
||||
@@ -103,7 +106,7 @@ abstract class AbstractField<Field : AbstractField<Field>> {
|
||||
copy.visibility = visibility
|
||||
copy.fromParent = fromParent
|
||||
copy.useInBaseTransformerDetection = useInBaseTransformerDetection
|
||||
copy.needAcceptAndTransform = needAcceptAndTransform
|
||||
copy.isChild = isChild
|
||||
copy.overriddenTypes += overriddenTypes
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ interface FieldContainer<out Field : AbstractField<*>> {
|
||||
*/
|
||||
val walkableChildren: List<Field>
|
||||
get() = allFields
|
||||
.filter { it.containsElement && !it.withGetter && it.needAcceptAndTransform }
|
||||
.filter { it.containsElement && !it.withGetter && it.isChild }
|
||||
.reorderFieldsIfNecessary(childrenOrderOverride)
|
||||
|
||||
/**
|
||||
|
||||
+6
-4
@@ -378,16 +378,18 @@ abstract class AbstractImplementationConfigurator<Implementation, Element, Imple
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to exclude this field from visiting it by visitors in the generated `acceptChildren` and `transformChildren`
|
||||
* methods.
|
||||
* Whether this field semantically represents a reference to a child node of the tree.
|
||||
*
|
||||
* This has the effect of including or excluding this field from visiting it by visitors in the generated
|
||||
* `acceptChildren` and `transformChildren` methods (child fields are always visited in those methods)
|
||||
*/
|
||||
var needAcceptAndTransform: Boolean = true
|
||||
var isChild: Boolean = true
|
||||
|
||||
fun applyConfiguration() {
|
||||
field.withGetter = withGetter
|
||||
field.customSetter = customSetter
|
||||
isMutable?.let { field.isMutable = it }
|
||||
field.needAcceptAndTransform = needAcceptAndTransform
|
||||
field.isChild = isChild
|
||||
|
||||
when {
|
||||
value != null -> field.defaultValueInImplementation = value
|
||||
|
||||
Reference in New Issue
Block a user