Add simple documentation to convert methods
This commit is contained in:
committed by
Mikhail Glukhikh
parent
311964acea
commit
d0dfcbb2f2
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.name.FqName
|
|||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens.*
|
import org.jetbrains.kotlin.lexer.KtTokens.*
|
||||||
import org.jetbrains.kotlin.KtNodeTypes.*
|
import org.jetbrains.kotlin.KtNodeTypes.*
|
||||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
|
||||||
import org.jetbrains.kotlin.fir.lightTree.fir.modifier.*
|
import org.jetbrains.kotlin.fir.lightTree.fir.modifier.*
|
||||||
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.nameAsSafeName
|
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.nameAsSafeName
|
||||||
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.toDelegatedSelfType
|
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.toDelegatedSelfType
|
||||||
@@ -35,7 +34,6 @@ import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.joinTypeParameters
|
|||||||
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.extractArgumentsFrom
|
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.extractArgumentsFrom
|
||||||
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.fillEnumEntryConstructor
|
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.fillEnumEntryConstructor
|
||||||
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.fillConstructors
|
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.fillConstructors
|
||||||
import org.jetbrains.kotlin.fir.lightTree.ConverterUtil.toFirExpression
|
|
||||||
import org.jetbrains.kotlin.fir.lightTree.FunctionUtil.removeLast
|
import org.jetbrains.kotlin.fir.lightTree.FunctionUtil.removeLast
|
||||||
import org.jetbrains.kotlin.fir.lightTree.fir.TypeConstraint
|
import org.jetbrains.kotlin.fir.lightTree.fir.TypeConstraint
|
||||||
import org.jetbrains.kotlin.fir.lightTree.fir.ValueParameter
|
import org.jetbrains.kotlin.fir.lightTree.fir.ValueParameter
|
||||||
@@ -213,11 +211,14 @@ class Converter(
|
|||||||
throw Exception()
|
throw Exception()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseClassOrObject
|
||||||
|
*/
|
||||||
private fun convertClass(classNode: LighterASTNode): FirDeclaration {
|
private fun convertClass(classNode: LighterASTNode): FirDeclaration {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
lateinit var classKind: ClassKind
|
lateinit var classKind: ClassKind
|
||||||
var identifier: String? = null
|
var identifier: String? = null
|
||||||
val typeParameters = mutableListOf<FirTypeParameter>()
|
val firTypeParameters = mutableListOf<FirTypeParameter>()
|
||||||
var primaryConstructor: LighterASTNode? = null
|
var primaryConstructor: LighterASTNode? = null
|
||||||
val superTypeRefs = mutableListOf<FirTypeRef>()
|
val superTypeRefs = mutableListOf<FirTypeRef>()
|
||||||
val superTypeCallEntry = mutableListOf<FirExpression>()
|
val superTypeCallEntry = mutableListOf<FirExpression>()
|
||||||
@@ -231,7 +232,7 @@ class Converter(
|
|||||||
INTERFACE_KEYWORD -> classKind = ClassKind.INTERFACE
|
INTERFACE_KEYWORD -> classKind = ClassKind.INTERFACE
|
||||||
OBJECT_KEYWORD -> classKind = ClassKind.OBJECT
|
OBJECT_KEYWORD -> classKind = ClassKind.OBJECT
|
||||||
IDENTIFIER -> identifier = it.toString()
|
IDENTIFIER -> identifier = it.toString()
|
||||||
TYPE_PARAMETER_LIST -> typeParameters += convertTypeParameters(it)
|
TYPE_PARAMETER_LIST -> firTypeParameters += convertTypeParameters(it)
|
||||||
PRIMARY_CONSTRUCTOR -> primaryConstructor = it
|
PRIMARY_CONSTRUCTOR -> primaryConstructor = it
|
||||||
SUPER_TYPE_LIST -> convertDelegationSpecifiers(it).apply {
|
SUPER_TYPE_LIST -> convertDelegationSpecifiers(it).apply {
|
||||||
delegatedSuperTypeRef = first
|
delegatedSuperTypeRef = first
|
||||||
@@ -270,7 +271,7 @@ class Converter(
|
|||||||
isInline = modifiers.functionModifier == FunctionModifier.INLINE
|
isInline = modifiers.functionModifier == FunctionModifier.INLINE
|
||||||
)
|
)
|
||||||
firClass.annotations += modifiers.annotations
|
firClass.annotations += modifiers.annotations
|
||||||
firClass.typeParameters += typeParameters
|
firClass.typeParameters += firTypeParameters
|
||||||
firClass.joinTypeParameters(typeConstraints)
|
firClass.joinTypeParameters(typeConstraints)
|
||||||
firClass.superTypeRefs += superTypeRefs
|
firClass.superTypeRefs += superTypeRefs
|
||||||
|
|
||||||
@@ -286,7 +287,7 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
getValueParameters(primaryConstructor).forEach {
|
getValueParameters(primaryConstructor).forEach {
|
||||||
if (it.isValOrVar()) {
|
if (it.hasValOrVar()) {
|
||||||
firClass.declarations += it.toFirProperty()
|
firClass.declarations += it.toFirProperty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -310,6 +311,7 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO try to get rid of this method
|
||||||
private fun getValueParameters(primaryConstructor: LighterASTNode?): List<ValueParameter> {
|
private fun getValueParameters(primaryConstructor: LighterASTNode?): List<ValueParameter> {
|
||||||
if (primaryConstructor == null) return listOf()
|
if (primaryConstructor == null) return listOf()
|
||||||
|
|
||||||
@@ -320,6 +322,10 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseClassOrObject
|
||||||
|
* primaryConstructor branch
|
||||||
|
*/
|
||||||
private fun convertPrimaryConstructor(primaryConstructor: LighterASTNode?): FirConstructorImpl {
|
private fun convertPrimaryConstructor(primaryConstructor: LighterASTNode?): FirConstructorImpl {
|
||||||
//if (primaryConstructor == null && hasSecondaryConstructor) return null
|
//if (primaryConstructor == null && hasSecondaryConstructor) return null
|
||||||
|
|
||||||
@@ -347,6 +353,9 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseValueParameterList
|
||||||
|
*/
|
||||||
private fun convertClassParameters(classParameters: LighterASTNode): List<ValueParameter> {
|
private fun convertClassParameters(classParameters: LighterASTNode): List<ValueParameter> {
|
||||||
return classParameters.forEachChildrenReturnList { node, container ->
|
return classParameters.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -355,6 +364,9 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseValueParameter
|
||||||
|
*/
|
||||||
private fun convertClassParameter(classParameter: LighterASTNode): ValueParameter {
|
private fun convertClassParameter(classParameter: LighterASTNode): ValueParameter {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
var isVal = false
|
var isVal = false
|
||||||
@@ -389,6 +401,13 @@ class Converter(
|
|||||||
return ValueParameter(isVal, isVar, modifiers, firValueParameter)
|
return ValueParameter(isVal, isVar, modifiers, firValueParameter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseDelegationSpecifierList
|
||||||
|
*
|
||||||
|
* SUPER_TYPE_ENTRY - userType
|
||||||
|
* SUPER_TYPE_CALL_ENTRY - constructorInvocation
|
||||||
|
* DELEGATED_SUPER_TYPE_ENTRY - explicitDelegation
|
||||||
|
*/
|
||||||
private fun convertDelegationSpecifiers(delegationSpecifiers: LighterASTNode): Triple<FirTypeRef?, List<FirTypeRef>, List<FirExpression>> {
|
private fun convertDelegationSpecifiers(delegationSpecifiers: LighterASTNode): Triple<FirTypeRef?, List<FirTypeRef>, List<FirExpression>> {
|
||||||
val superTypeRefs = mutableListOf<FirTypeRef>()
|
val superTypeRefs = mutableListOf<FirTypeRef>()
|
||||||
val superTypeCallEntry = mutableListOf<FirExpression>()
|
val superTypeCallEntry = mutableListOf<FirExpression>()
|
||||||
@@ -407,13 +426,12 @@ class Converter(
|
|||||||
return Triple(delegatedSuperTypeRef, superTypeRefs, superTypeCallEntry)
|
return Triple(delegatedSuperTypeRef, superTypeRefs, superTypeCallEntry)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private fun convertDelegationSpecifier(delegationSpecifier: LighterASTNode): FirElement {
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseDelegationSpecifier
|
||||||
}*/
|
*
|
||||||
|
|
||||||
/*
|
|
||||||
* constructorInvocation
|
* constructorInvocation
|
||||||
* : userType valueArguments
|
* : userType valueArguments
|
||||||
|
* ;
|
||||||
*/
|
*/
|
||||||
private fun convertConstructorInvocation(constructorInvocation: LighterASTNode): Pair<FirTypeRef, List<FirExpression>> {
|
private fun convertConstructorInvocation(constructorInvocation: LighterASTNode): Pair<FirTypeRef, List<FirExpression>> {
|
||||||
lateinit var firTypeRef: FirTypeRef
|
lateinit var firTypeRef: FirTypeRef
|
||||||
@@ -427,6 +445,13 @@ class Converter(
|
|||||||
return Pair(firTypeRef, firValueArguments)
|
return Pair(firTypeRef, firValueArguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseDelegationSpecifier
|
||||||
|
*
|
||||||
|
* explicitDelegation
|
||||||
|
* : userType "by" element
|
||||||
|
* ;
|
||||||
|
*/
|
||||||
private fun convertExplicitDelegation(explicitDelegation: LighterASTNode): FirDelegatedTypeRef {
|
private fun convertExplicitDelegation(explicitDelegation: LighterASTNode): FirDelegatedTypeRef {
|
||||||
lateinit var firTypeRef: FirTypeRef
|
lateinit var firTypeRef: FirTypeRef
|
||||||
var expression: FirExpression? = null
|
var expression: FirExpression? = null
|
||||||
@@ -446,6 +471,9 @@ class Converter(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseClassBody
|
||||||
|
*/
|
||||||
private fun convertClassBody(classBody: LighterASTNode): List<FirDeclaration> {
|
private fun convertClassBody(classBody: LighterASTNode): List<FirDeclaration> {
|
||||||
return classBody.forEachChildrenReturnList { node, container ->
|
return classBody.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -484,6 +512,10 @@ class Converter(
|
|||||||
).extractArgumentsFrom(listOf(), stubMode) //TODO implement
|
).extractArgumentsFrom(listOf(), stubMode) //TODO implement
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse only enum entries, without members
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseEnumClassBody
|
||||||
|
*/
|
||||||
private fun convertEnumClassBody(classBody: LighterASTNode): List<FirEnumEntryImpl> {
|
private fun convertEnumClassBody(classBody: LighterASTNode): List<FirEnumEntryImpl> {
|
||||||
return classBody.forEachChildrenReturnList { node, container ->
|
return classBody.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -492,10 +524,10 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private fun convertClassMemberDeclarations(classMemberDeclarations: LighterASTNode): FirElement {
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseMemberDeclarationRest
|
||||||
}*/
|
* at INIT keyword
|
||||||
|
*/
|
||||||
private fun convertAnonymousInitializer(anonymousInitializer: LighterASTNode): FirDeclaration {
|
private fun convertAnonymousInitializer(anonymousInitializer: LighterASTNode): FirDeclaration {
|
||||||
var firBlock: FirBlock? = null
|
var firBlock: FirBlock? = null
|
||||||
anonymousInitializer.forEachChildren {
|
anonymousInitializer.forEachChildren {
|
||||||
@@ -511,6 +543,9 @@ class Converter(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseSecondaryConstructor
|
||||||
|
*/
|
||||||
private fun convertSecondaryConstructor(secondaryConstructor: LighterASTNode): FirConstructor {
|
private fun convertSecondaryConstructor(secondaryConstructor: LighterASTNode): FirConstructor {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
val firValueParameters = mutableListOf<FirValueParameter>()
|
val firValueParameters = mutableListOf<FirValueParameter>()
|
||||||
@@ -544,6 +579,9 @@ class Converter(
|
|||||||
return firConstructor
|
return firConstructor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseEnumEntry
|
||||||
|
*/
|
||||||
private fun convertEnumEntry(enumEntry: LighterASTNode): FirEnumEntryImpl {
|
private fun convertEnumEntry(enumEntry: LighterASTNode): FirEnumEntryImpl {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
lateinit var identifier: String
|
lateinit var identifier: String
|
||||||
@@ -572,10 +610,13 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseFunction
|
||||||
|
*/
|
||||||
private fun convertFunctionDeclaration(functionDeclaration: LighterASTNode): FirDeclaration {
|
private fun convertFunctionDeclaration(functionDeclaration: LighterASTNode): FirDeclaration {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
lateinit var identifier: String
|
lateinit var identifier: String
|
||||||
val typeParameters = mutableListOf<FirTypeParameter>()
|
val firTypeParameters = mutableListOf<FirTypeParameter>()
|
||||||
val valueParametersList = mutableListOf<FirValueParameter>()
|
val valueParametersList = mutableListOf<FirValueParameter>()
|
||||||
var isReturnType = false
|
var isReturnType = false
|
||||||
var receiverType: FirTypeRef? = null
|
var receiverType: FirTypeRef? = null
|
||||||
@@ -587,7 +628,7 @@ class Converter(
|
|||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
MODIFIER_LIST -> modifiers = convertModifiers(it)
|
MODIFIER_LIST -> modifiers = convertModifiers(it)
|
||||||
IDENTIFIER -> identifier = it.toString()
|
IDENTIFIER -> identifier = it.toString()
|
||||||
TYPE_PARAMETER_LIST -> typeParameters += convertTypeParameters(it)
|
TYPE_PARAMETER_LIST -> firTypeParameters += convertTypeParameters(it)
|
||||||
VALUE_PARAMETER_LIST -> valueParametersList += convertFunctionValueParameters(it)
|
VALUE_PARAMETER_LIST -> valueParametersList += convertFunctionValueParameters(it)
|
||||||
COLON -> isReturnType = true
|
COLON -> isReturnType = true
|
||||||
TYPE_REFERENCE -> if (isReturnType) returnType = convertType(it) else receiverType = convertType(it)
|
TYPE_REFERENCE -> if (isReturnType) returnType = convertType(it) else receiverType = convertType(it)
|
||||||
@@ -601,11 +642,12 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
returnType = if (firBlock != null || (firBlock == null && firExpression == null)) {
|
if (returnType == null) {
|
||||||
returnType ?: implicitUnitType
|
returnType =
|
||||||
} else {
|
if (firBlock != null || (firBlock == null && firExpression == null)) implicitUnitType
|
||||||
returnType ?: implicitType
|
else implicitType
|
||||||
}
|
}
|
||||||
|
|
||||||
val functionName = Name.identifier(identifier)
|
val functionName = Name.identifier(identifier)
|
||||||
val firFunction = FirMemberFunctionImpl(
|
val firFunction = FirMemberFunctionImpl(
|
||||||
session,
|
session,
|
||||||
@@ -630,7 +672,7 @@ class Converter(
|
|||||||
FunctionUtil.firFunctions += firFunction
|
FunctionUtil.firFunctions += firFunction
|
||||||
firFunction.annotations += modifiers.annotations
|
firFunction.annotations += modifiers.annotations
|
||||||
|
|
||||||
firFunction.typeParameters += typeParameters
|
firFunction.typeParameters += firTypeParameters
|
||||||
firFunction.joinTypeParameters(typeConstraints)
|
firFunction.joinTypeParameters(typeConstraints)
|
||||||
|
|
||||||
firFunction.valueParameters += valueParametersList
|
firFunction.valueParameters += valueParametersList
|
||||||
@@ -639,6 +681,9 @@ class Converter(
|
|||||||
return firFunction
|
return firFunction
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseValueParameterList
|
||||||
|
*/
|
||||||
private fun convertFunctionValueParameters(functionValueParameters: LighterASTNode): List<FirValueParameter> {
|
private fun convertFunctionValueParameters(functionValueParameters: LighterASTNode): List<FirValueParameter> {
|
||||||
return functionValueParameters.forEachChildrenReturnList { node, container ->
|
return functionValueParameters.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -647,6 +692,9 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseValueParameter
|
||||||
|
*/
|
||||||
private fun convertFunctionValueParameter(functionValueParameter: LighterASTNode): FirValueParameter {
|
private fun convertFunctionValueParameter(functionValueParameter: LighterASTNode): FirValueParameter {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
lateinit var identifier: String
|
lateinit var identifier: String
|
||||||
@@ -677,6 +725,9 @@ class Converter(
|
|||||||
).apply { annotations += modifiers.annotations }
|
).apply { annotations += modifiers.annotations }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseFunctionParameterRest
|
||||||
|
*/
|
||||||
private fun convertParameter(parameter: LighterASTNode): FirValueParameter {
|
private fun convertParameter(parameter: LighterASTNode): FirValueParameter {
|
||||||
var identifier: String? = null
|
var identifier: String? = null
|
||||||
var firType: FirTypeRef? = null
|
var firType: FirTypeRef? = null
|
||||||
@@ -684,6 +735,7 @@ class Converter(
|
|||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
IDENTIFIER -> identifier = it.toString()
|
IDENTIFIER -> identifier = it.toString()
|
||||||
TYPE_REFERENCE -> firType = convertType(it)
|
TYPE_REFERENCE -> firType = convertType(it)
|
||||||
|
//TODO expression?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,6 +751,11 @@ class Converter(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this is just a VALUE_PARAMETER_LIST
|
||||||
|
*
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parsePropertyGetterOrSetter
|
||||||
|
*/
|
||||||
private fun convertSetterParameter(setterParameter: LighterASTNode, propertyTypeRef: FirTypeRef): FirValueParameter {
|
private fun convertSetterParameter(setterParameter: LighterASTNode, propertyTypeRef: FirTypeRef): FirValueParameter {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
lateinit var firValueParameter: FirValueParameter
|
lateinit var firValueParameter: FirValueParameter
|
||||||
@@ -743,11 +800,14 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseProperty
|
||||||
|
*/
|
||||||
private fun convertPropertyDeclaration(property: LighterASTNode): FirDeclaration {
|
private fun convertPropertyDeclaration(property: LighterASTNode): FirDeclaration {
|
||||||
//TODO DESTRUCTURING_DECLARATION
|
//TODO DESTRUCTURING_DECLARATION
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
lateinit var identifier: String
|
lateinit var identifier: String
|
||||||
val typeParameters = mutableListOf<FirTypeParameter>()
|
val firTypeParameters = mutableListOf<FirTypeParameter>()
|
||||||
var isReturnType = false
|
var isReturnType = false
|
||||||
var isDelegate = false
|
var isDelegate = false
|
||||||
var isVar = false
|
var isVar = false
|
||||||
@@ -761,7 +821,7 @@ class Converter(
|
|||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
MODIFIER_LIST -> modifiers = convertModifiers(it)
|
MODIFIER_LIST -> modifiers = convertModifiers(it)
|
||||||
IDENTIFIER -> identifier = it.toString()
|
IDENTIFIER -> identifier = it.toString()
|
||||||
TYPE_PARAMETER_LIST -> typeParameters += convertTypeParameters(it)
|
TYPE_PARAMETER_LIST -> firTypeParameters += convertTypeParameters(it)
|
||||||
COLON -> isReturnType = true
|
COLON -> isReturnType = true
|
||||||
TYPE_REFERENCE -> if (isReturnType) returnType = convertType(it) else receiverType = convertType(it)
|
TYPE_REFERENCE -> if (isReturnType) returnType = convertType(it) else receiverType = convertType(it)
|
||||||
TYPE_CONSTRAINT_LIST -> typeConstraints += convertTypeConstraints(it)
|
TYPE_CONSTRAINT_LIST -> typeConstraints += convertTypeConstraints(it)
|
||||||
@@ -821,13 +881,16 @@ class Converter(
|
|||||||
//{ property.delegate?.expression }.toFirExpression("Should have delegate")
|
//{ property.delegate?.expression }.toFirExpression("Should have delegate")
|
||||||
} else null
|
} else null
|
||||||
).apply {
|
).apply {
|
||||||
this.typeParameters += typeParameters
|
this.typeParameters += firTypeParameters
|
||||||
this.joinTypeParameters(typeConstraints)
|
this.joinTypeParameters(typeConstraints)
|
||||||
annotations += modifiers.annotations
|
annotations += modifiers.annotations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parsePropertyGetterOrSetter
|
||||||
|
*/
|
||||||
private fun convertGetter(getter: LighterASTNode, propertyTypeRef: FirTypeRef): FirPropertyAccessor {
|
private fun convertGetter(getter: LighterASTNode, propertyTypeRef: FirTypeRef): FirPropertyAccessor {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
|
|
||||||
@@ -862,6 +925,9 @@ class Converter(
|
|||||||
return firAccessor
|
return firAccessor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parsePropertyGetterOrSetter
|
||||||
|
*/
|
||||||
private fun convertSetter(setter: LighterASTNode, propertyTypeRef: FirTypeRef): FirPropertyAccessor {
|
private fun convertSetter(setter: LighterASTNode, propertyTypeRef: FirTypeRef): FirPropertyAccessor {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
|
|
||||||
@@ -893,19 +959,24 @@ class Converter(
|
|||||||
FunctionUtil.firFunctions += firAccessor
|
FunctionUtil.firFunctions += firAccessor
|
||||||
firAccessor.annotations += modifiers.annotations
|
firAccessor.annotations += modifiers.annotations
|
||||||
|
|
||||||
firAccessor.valueParameters += if (firValueParameters.isEmpty()) listOf(
|
firValueParameters.ifEmpty {
|
||||||
FirDefaultSetterValueParameter(
|
firValueParameters +=
|
||||||
session,
|
FirDefaultSetterValueParameter(
|
||||||
null,
|
session,
|
||||||
propertyTypeRef
|
null,
|
||||||
)
|
propertyTypeRef
|
||||||
) else firValueParameters
|
)
|
||||||
|
}
|
||||||
|
firAccessor.valueParameters += firValueParameters
|
||||||
|
|
||||||
firAccessor.body = visitFunctionBody(firBlock, firExpression)
|
firAccessor.body = visitFunctionBody(firBlock, firExpression)
|
||||||
FunctionUtil.firFunctions.removeLast()
|
FunctionUtil.firFunctions.removeLast()
|
||||||
return firAccessor
|
return firAccessor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeAlias
|
||||||
|
*/
|
||||||
private fun convertTypeAlias(typeAlias: LighterASTNode): FirDeclaration {
|
private fun convertTypeAlias(typeAlias: LighterASTNode): FirDeclaration {
|
||||||
var modifiers = Modifier(session)
|
var modifiers = Modifier(session)
|
||||||
lateinit var identifier: String
|
lateinit var identifier: String
|
||||||
@@ -938,6 +1009,9 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeParameterList
|
||||||
|
*/
|
||||||
private fun convertTypeParameters(typeParameterList: LighterASTNode): List<FirTypeParameter> {
|
private fun convertTypeParameters(typeParameterList: LighterASTNode): List<FirTypeParameter> {
|
||||||
return typeParameterList.forEachChildrenReturnList { node, container ->
|
return typeParameterList.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -946,15 +1020,18 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeParameter
|
||||||
|
*/
|
||||||
private fun convertTypeParameter(typeParameter: LighterASTNode): FirTypeParameter {
|
private fun convertTypeParameter(typeParameter: LighterASTNode): FirTypeParameter {
|
||||||
var typeParameterModifiers = TypeParameterModifier(session)
|
var typeParameterModifiers = TypeParameterModifier(session)
|
||||||
lateinit var identifier: String
|
lateinit var identifier: String
|
||||||
var type: FirTypeRef? = null
|
var firType: FirTypeRef? = null
|
||||||
typeParameter.forEachChildren {
|
typeParameter.forEachChildren {
|
||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
MODIFIER_LIST -> typeParameterModifiers = convertTypeParameterModifiers(it)
|
MODIFIER_LIST -> typeParameterModifiers = convertTypeParameterModifiers(it)
|
||||||
IDENTIFIER -> identifier = it.toString()
|
IDENTIFIER -> identifier = it.toString()
|
||||||
TYPE_REFERENCE -> type = convertType(it)
|
TYPE_REFERENCE -> firType = convertType(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,11 +1044,14 @@ class Converter(
|
|||||||
typeParameterModifiers.reificationModifier != null
|
typeParameterModifiers.reificationModifier != null
|
||||||
)
|
)
|
||||||
firTypeParameter.annotations += typeParameterModifiers.annotations
|
firTypeParameter.annotations += typeParameterModifiers.annotations
|
||||||
type?.let { firTypeParameter.bounds += it }
|
firType?.let { firTypeParameter.bounds += it }
|
||||||
|
|
||||||
return firTypeParameter
|
return firTypeParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseModifierList
|
||||||
|
*/
|
||||||
private fun convertTypeParameterModifiers(typeParameterModifiers: LighterASTNode): TypeParameterModifier {
|
private fun convertTypeParameterModifiers(typeParameterModifiers: LighterASTNode): TypeParameterModifier {
|
||||||
val modifier = TypeParameterModifier(session)
|
val modifier = TypeParameterModifier(session)
|
||||||
typeParameterModifiers.forEachChildren {
|
typeParameterModifiers.forEachChildren {
|
||||||
@@ -986,27 +1066,29 @@ class Converter(
|
|||||||
return modifier
|
return modifier
|
||||||
}
|
}
|
||||||
|
|
||||||
/*fun convertTypeParameterModifier(typeParameterModifier: LighterASTNode): TypeParameterModifier {
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeRef
|
||||||
}*/
|
*/
|
||||||
|
|
||||||
private fun convertType(type: LighterASTNode): FirTypeRef {
|
private fun convertType(type: LighterASTNode): FirTypeRef {
|
||||||
var typeModifiers = TypeModifier(session) //TODO what with suspend?
|
var typeModifiers = TypeModifier(session) //TODO what with suspend?
|
||||||
var firType: FirTypeRef? = null
|
lateinit var firType: FirTypeRef
|
||||||
type.forEachChildren {
|
type.forEachChildren { it ->
|
||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
TYPE_REFERENCE -> firType = convertType(it)
|
TYPE_REFERENCE -> firType = convertType(it)
|
||||||
MODIFIER_LIST -> typeModifiers = convertTypeModifiers(it)
|
MODIFIER_LIST -> typeModifiers = convertTypeModifiers(it)
|
||||||
USER_TYPE -> firType = convertUserType(it).also { (it as FirUserTypeRefImpl).qualifier.reverse() }
|
USER_TYPE -> firType = convertUserType(it).also { firUserType -> (firUserType as FirUserTypeRefImpl).qualifier.reverse() }
|
||||||
NULLABLE_TYPE -> firType = convertNullableType(it)
|
NULLABLE_TYPE -> firType = convertNullableType(it)
|
||||||
FUNCTION_TYPE -> firType = convertFunctionType(it)
|
FUNCTION_TYPE -> firType = convertFunctionType(it)
|
||||||
DYNAMIC_TYPE -> firType = FirDynamicTypeRefImpl(session, null, false)
|
DYNAMIC_TYPE -> firType = FirDynamicTypeRefImpl(session, null, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO specify error - unknown type
|
|
||||||
return firType?.also { (it as FirAbstractAnnotatedTypeRef).annotations += typeModifiers.annotations } ?: throw Exception()
|
return firType.also { (it as FirAbstractAnnotatedTypeRef).annotations += typeModifiers.annotations }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseModifierList
|
||||||
|
*/
|
||||||
private fun convertTypeModifiers(typeModifiers: LighterASTNode): TypeModifier {
|
private fun convertTypeModifiers(typeModifiers: LighterASTNode): TypeModifier {
|
||||||
val modifier = TypeModifier(session)
|
val modifier = TypeModifier(session)
|
||||||
typeModifiers.forEachChildren {
|
typeModifiers.forEachChildren {
|
||||||
@@ -1020,25 +1102,26 @@ class Converter(
|
|||||||
return modifier
|
return modifier
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private fun convertTypeModifier(typeModifier: LighterASTNode): TypeModifier {
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseNullableTypeSuffix
|
||||||
}*/
|
*/
|
||||||
|
|
||||||
private fun convertNullableType(nullableType: LighterASTNode): FirTypeRef {
|
private fun convertNullableType(nullableType: LighterASTNode): FirTypeRef {
|
||||||
var firTypeRef: FirTypeRef? = null
|
lateinit var firType: FirTypeRef
|
||||||
nullableType.forEachChildren {
|
nullableType.forEachChildren {
|
||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
USER_TYPE -> firTypeRef = convertUserType(it, true)
|
USER_TYPE -> firType = convertUserType(it, true)
|
||||||
FUNCTION_TYPE -> firTypeRef = convertFunctionType(it, true)
|
FUNCTION_TYPE -> firType = convertFunctionType(it, true)
|
||||||
NULLABLE_TYPE -> firTypeRef = convertNullableType(it)
|
NULLABLE_TYPE -> firType = convertNullableType(it)
|
||||||
DYNAMIC_TYPE -> firTypeRef = FirDynamicTypeRefImpl(session, null, true)
|
DYNAMIC_TYPE -> firType = FirDynamicTypeRefImpl(session, null, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO specify error
|
return firType
|
||||||
return firTypeRef ?: throw Exception()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseFunctionType
|
||||||
|
*/
|
||||||
private fun convertFunctionType(functionType: LighterASTNode, isNullable: Boolean = false): FirTypeRef {
|
private fun convertFunctionType(functionType: LighterASTNode, isNullable: Boolean = false): FirTypeRef {
|
||||||
var receiverTypeReference: FirTypeRef? = null
|
var receiverTypeReference: FirTypeRef? = null
|
||||||
lateinit var returnTypeReference: FirTypeRef
|
lateinit var returnTypeReference: FirTypeRef
|
||||||
@@ -1060,7 +1143,10 @@ class Converter(
|
|||||||
).apply { valueParameters += valueParametersList }
|
).apply { valueParameters += valueParametersList }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun convertReceiverType(receiverType: LighterASTNode): FirTypeRef? {
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeRefContents
|
||||||
|
*/
|
||||||
|
private fun convertReceiverType(receiverType: LighterASTNode): FirTypeRef {
|
||||||
receiverType.forEachChildren {
|
receiverType.forEachChildren {
|
||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
TYPE_REFERENCE -> return convertType(it)
|
TYPE_REFERENCE -> return convertType(it)
|
||||||
@@ -1071,6 +1157,9 @@ class Converter(
|
|||||||
throw Exception()
|
throw Exception()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseUserType
|
||||||
|
*/
|
||||||
private fun convertUserType(userType: LighterASTNode, isNullable: Boolean = false): FirUserTypeRef {
|
private fun convertUserType(userType: LighterASTNode, isNullable: Boolean = false): FirUserTypeRef {
|
||||||
var simpleFirUserType: FirUserTypeRef? = null
|
var simpleFirUserType: FirUserTypeRef? = null
|
||||||
lateinit var identifier: String
|
lateinit var identifier: String
|
||||||
@@ -1097,6 +1186,9 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseValueParameter
|
||||||
|
*/
|
||||||
private fun convertFunctionTypeParameters(functionTypeParameters: LighterASTNode): List<FirValueParameter> {
|
private fun convertFunctionTypeParameters(functionTypeParameters: LighterASTNode): List<FirValueParameter> {
|
||||||
return functionTypeParameters.forEachChildrenReturnList { node, container ->
|
return functionTypeParameters.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -1105,6 +1197,9 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeConstraintList
|
||||||
|
*/
|
||||||
private fun convertTypeConstraints(typeConstraints: LighterASTNode): List<TypeConstraint> {
|
private fun convertTypeConstraints(typeConstraints: LighterASTNode): List<TypeConstraint> {
|
||||||
return typeConstraints.forEachChildrenReturnList { node, container ->
|
return typeConstraints.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -1113,22 +1208,29 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeConstraint
|
||||||
|
*/
|
||||||
private fun convertTypeConstraint(typeConstraint: LighterASTNode): TypeConstraint {
|
private fun convertTypeConstraint(typeConstraint: LighterASTNode): TypeConstraint {
|
||||||
lateinit var identifier: String
|
lateinit var identifier: String
|
||||||
lateinit var firType: FirTypeRef
|
lateinit var firType: FirTypeRef
|
||||||
val annotaions = mutableListOf<FirAnnotationCall>()
|
val annotations = mutableListOf<FirAnnotationCall>()
|
||||||
typeConstraint.forEachChildren {
|
typeConstraint.forEachChildren {
|
||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
//TODO check annotations
|
//TODO check annotations
|
||||||
ANNOTATION, ANNOTATION_ENTRY -> annotaions += convertAnnotation(it)
|
ANNOTATION, ANNOTATION_ENTRY -> annotations += convertAnnotation(it)
|
||||||
REFERENCE_EXPRESSION -> identifier = it.toString()
|
REFERENCE_EXPRESSION -> identifier = it.toString()
|
||||||
TYPE_REFERENCE -> firType = convertType(it)
|
TYPE_REFERENCE -> firType = convertType(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TypeConstraint(annotaions, identifier, firType)
|
return TypeConstraint(annotations, identifier, firType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO move to parsing class?
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseValueArgumentList
|
||||||
|
*/
|
||||||
private fun convertValueArguments(valueArguments: LighterASTNode): List<FirExpression> {
|
private fun convertValueArguments(valueArguments: LighterASTNode): List<FirExpression> {
|
||||||
return valueArguments.forEachChildrenReturnList { node, container ->
|
return valueArguments.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -1137,6 +1239,9 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeArgumentList
|
||||||
|
*/
|
||||||
private fun convertTypeArguments(typeArguments: LighterASTNode): List<FirTypeProjection> {
|
private fun convertTypeArguments(typeArguments: LighterASTNode): List<FirTypeProjection> {
|
||||||
return typeArguments.forEachChildrenReturnList { node, container ->
|
return typeArguments.forEachChildrenReturnList { node, container ->
|
||||||
when (node.tokenType) {
|
when (node.tokenType) {
|
||||||
@@ -1145,14 +1250,17 @@ class Converter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.tryParseTypeArgumentList
|
||||||
|
*/
|
||||||
private fun convertTypeProjection(typeProjection: LighterASTNode): FirTypeProjection {
|
private fun convertTypeProjection(typeProjection: LighterASTNode): FirTypeProjection {
|
||||||
var modifiers = TypeProjectionModifier(session)
|
var modifiers = TypeProjectionModifier(session)
|
||||||
lateinit var type: FirTypeRef
|
lateinit var firType: FirTypeRef
|
||||||
var isStarProjection = false
|
var isStarProjection = false
|
||||||
typeProjection.forEachChildren {
|
typeProjection.forEachChildren {
|
||||||
when (it.tokenType) {
|
when (it.tokenType) {
|
||||||
MODIFIER_LIST -> modifiers = convertTypeProjectionModifiers(it)
|
MODIFIER_LIST -> modifiers = convertTypeProjectionModifiers(it)
|
||||||
TYPE_REFERENCE -> type = convertType(it)
|
TYPE_REFERENCE -> firType = convertType(it)
|
||||||
MUL -> isStarProjection = true
|
MUL -> isStarProjection = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1163,10 +1271,13 @@ class Converter(
|
|||||||
session,
|
session,
|
||||||
null,
|
null,
|
||||||
modifiers.varianceModifier.toVariance(),
|
modifiers.varianceModifier.toVariance(),
|
||||||
type
|
firType
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseModifierList
|
||||||
|
*/
|
||||||
private fun convertTypeProjectionModifiers(modifiers: LighterASTNode): TypeProjectionModifier {
|
private fun convertTypeProjectionModifiers(modifiers: LighterASTNode): TypeProjectionModifier {
|
||||||
val modifier = TypeProjectionModifier(session)
|
val modifier = TypeProjectionModifier(session)
|
||||||
modifiers.forEachChildren {
|
modifiers.forEachChildren {
|
||||||
@@ -1180,10 +1291,6 @@ class Converter(
|
|||||||
return modifier
|
return modifier
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private fun convertTypeProjectionModifier(modifier: LighterASTNode): TypeProjectionModifier {
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private fun convertValueArgument(valueArgument: LighterASTNode): FirExpression {
|
private fun convertValueArgument(valueArgument: LighterASTNode): FirExpression {
|
||||||
return FirErrorExpressionImpl(session, null, "Not implemented")
|
return FirErrorExpressionImpl(session, null, "Not implemented")
|
||||||
//TODO implement
|
//TODO implement
|
||||||
@@ -1203,6 +1310,9 @@ class Converter(
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseModifierList
|
||||||
|
*/
|
||||||
private fun convertModifiers(modifiers: LighterASTNode): Modifier {
|
private fun convertModifiers(modifiers: LighterASTNode): Modifier {
|
||||||
val modifier = Modifier(session)
|
val modifier = Modifier(session)
|
||||||
modifiers.forEachChildren {
|
modifiers.forEachChildren {
|
||||||
@@ -1223,10 +1333,6 @@ class Converter(
|
|||||||
return modifier
|
return modifier
|
||||||
}
|
}
|
||||||
|
|
||||||
/*fun convertModifier(modifier: LighterASTNode): Modifier {
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private fun convertClassModifier(classModifier: LighterASTNode): ClassModifier {
|
private fun convertClassModifier(classModifier: LighterASTNode): ClassModifier {
|
||||||
return ClassModifier.valueOf(classModifier.toString().toUpperCase())
|
return ClassModifier.valueOf(classModifier.toString().toUpperCase())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ import org.jetbrains.kotlin.fir.lightTree.fir.modifier.PlatformModifier
|
|||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
|
||||||
|
|
||||||
class ValueParameter(
|
class ValueParameter(
|
||||||
val isVal: Boolean,
|
private val isVal: Boolean,
|
||||||
val isVar: Boolean,
|
private val isVar: Boolean,
|
||||||
val modifier: Modifier,
|
private val modifier: Modifier,
|
||||||
val firValueParameter: FirValueParameter
|
val firValueParameter: FirValueParameter
|
||||||
) {
|
) {
|
||||||
fun isValOrVar(): Boolean {
|
fun hasValOrVar(): Boolean {
|
||||||
return isVal || isVar
|
return isVal || isVar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user