{ <EOL> val frameMapAtStart = codegen . frameMap . mark ( ) <EOL> prepareConfiguration ( ) <EOL> val hasElse = expression . elseExpression != null <EOL> defaultLabel = if ( hasElse || ! isStatement || isExhaustive ) elseLabel else endLabel <EOL> generateSubjectValue ( ) <EOL> generateSubjectValueToIndex ( ) <EOL> val beginLabel = Label ( ) <EOL> v . mark ( beginLabel ) <EOL> generateSwitchInstructionByTransitionsTable ( ) <EOL> generateEntries ( ) <EOL> if ( ! hasElse && ( ! isStatement || isExhaustive ) ) { <EOL> v . visitLabel ( elseLabel ) <EOL> codegen . putUnitInstanceOntoStackForNonExhaustiveWhen ( expression , isStatement ) <EOL> } <EOL> codegen . markLineNumber ( expression , isStatement ) <EOL> v . mark ( endLabel ) <EOL> frameMapAtStart . dropTo ( ) <EOL> subjectVariableDescriptor ? . let { <EOL> v . visitLocalVariable ( it . name . asString ( ) , subjectType . descriptor , null , beginLabel , endLabel , subjectLocal ) <EOL> } <EOL> }

/**
 * Generates bytecode for entire when expression
 */


{ <EOL> for ( entry in expression . entries ) { <EOL> val entryLabel = Label ( ) <EOL> for ( constant in switchCodegenProvider . getConstantsFromEntry ( entry ) ) { <EOL> if ( constant is NullValue || constant == null ) continue <EOL> processConstant ( constant , entryLabel , entry ) <EOL> } <EOL> if ( entry . isElse ) { <EOL> elseLabel = entryLabel <EOL> } <EOL> entryLabels . add ( entryLabel ) <EOL> } <EOL> }

/**
 * Sets up transitionsTable and maybe something else needed in a special case
 * Behaviour may be changed by overriding processConstant
 */


{ <EOL> if ( subjectVariable != null ) { <EOL> val mySubjectVariable = bindingContext [ BindingContext . VARIABLE , subjectVariable ] <EOL> ? : throw AssertionError ( "<STR_LIT>" ) <EOL> subjectLocal = codegen . frameMap . enter ( mySubjectVariable , subjectType ) <EOL> codegen . visitProperty ( subjectVariable , null ) <EOL> StackValue . local ( subjectLocal , subjectType , subjectKotlinType ) . put ( subjectType , subjectKotlinType , codegen . v ) <EOL> subjectVariableDescriptor = mySubjectVariable <EOL> } else { <EOL> codegen . gen ( subjectExpression , subjectType , subjectKotlinType ) <EOL> subjectVariableDescriptor = null <EOL> } <EOL> }

/**
 * Generates subject value on top of the stack.
 * If the subject is a variable, it's stored and loaded.
 */


protected abstract fun generateSubjectValueToIndex ( )

/**
 * Given a subject value on stack (after [generateSubjectValue]),
 * produces int value to be used in switch.
 */


public suspend fun < S , T : S > Flow < T > . reduce ( operation : suspend ( accumulator : S , value : T ) -> S ) : S

{ <EOL> var accumulator : Any ? = NULL <EOL> collect { value -> <EOL> accumulator = if ( accumulator !== NULL ) { <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> operation ( accumulator as S , value ) <EOL> } else { <EOL> value <EOL> } <EOL> } <EOL> if ( accumulator === NULL ) throw NoSuchElementException ( "<STR_LIT>" ) <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> return accumulator as S <EOL> }

/**
 * Accumulates value starting with the first element and applying [operation] to current accumulator value and each element.
 * Throws [NoSuchElementException] if flow was empty.
 */


public suspend inline fun < T , R > Flow < T > . fold ( initial : R , crossinline operation : suspend ( acc : R , value : T ) -> R ) : R

{ <EOL> var accumulator = initial <EOL> collect { value -> <EOL> accumulator = operation ( accumulator , value ) <EOL> } <EOL> return accumulator <EOL> }

/**
 * Accumulates value starting with [initial] value and applying [operation] current accumulator value and each element
 */


public suspend fun < T > Flow < T > . single ( ) : T

{ <EOL> var result : Any ? = NULL <EOL> collect { value -> <EOL> require ( result === NULL ) { "<STR_LIT>" } <EOL> result = value <EOL> } <EOL> if ( result === NULL ) throw NoSuchElementException ( "<STR_LIT>" ) <EOL> return result as T <EOL> }

/**
 * The terminal operator that awaits for one and only one value to be emitted.
 * Throws [NoSuchElementException] for empty flow and [IllegalArgumentException] for flow
 * that contains more than one element.
 */


public suspend fun < T > Flow < T > . singleOrNull ( ) : T ?

{ <EOL> var result : Any ? = NULL <EOL> collectWhile { <EOL> if ( result === NULL ) { <EOL> result = it <EOL> true <EOL> } else { <EOL> result = NULL <EOL> false <EOL> } <EOL> } <EOL> return if ( result === NULL ) null else result as T <EOL> }

/**
 * The terminal operator that awaits for one and only one value to be emitted.
 * Returns the single value or `null`, if the flow was empty or emitted more than one value.
 */


public suspend fun < T > Flow < T > . first ( ) : T

{ <EOL> var result : Any ? = NULL <EOL> collectWhile { <EOL> result = it <EOL> false <EOL> } <EOL> if ( result === NULL ) throw NoSuchElementException ( "<STR_LIT>" ) <EOL> return result as T <EOL> }

/**
 * The terminal operator that returns the first element emitted by the flow and then cancels flow's collection.
 * Throws [NoSuchElementException] if the flow was empty.
 */


public suspend fun < T > Flow < T > . first ( predicate : suspend ( T ) -> Boolean ) : T

{ <EOL> var result : Any ? = NULL <EOL> collectWhile { <EOL> if ( predicate ( it ) ) { <EOL> result = it <EOL> false <EOL> } else { <EOL> true <EOL> } <EOL> } <EOL> if ( result === NULL ) throw NoSuchElementException ( "<STR_LIT>" ) <EOL> return result as T <EOL> }

/**
 * The terminal operator that returns the first element emitted by the flow matching the given [predicate] and then cancels flow's collection.
 * Throws [NoSuchElementException] if the flow has not contained elements matching the [predicate].
 */


public suspend fun < T > Flow < T > . firstOrNull ( ) : T ?

{ <EOL> var result : T ? = null <EOL> collectWhile { <EOL> result = it <EOL> false <EOL> } <EOL> return result <EOL> }

/**
 * The terminal operator that returns the first element emitted by the flow and then cancels flow's collection.
 * Returns `null` if the flow was empty.
 */


public suspend fun < T > Flow < T > . firstOrNull ( predicate : suspend ( T ) -> Boolean ) : T ?

{ <EOL> var result : T ? = null <EOL> collectWhile { <EOL> if ( predicate ( it ) ) { <EOL> result = it <EOL> false <EOL> } else { <EOL> true <EOL> } <EOL> } <EOL> return result <EOL> }

/**
 * The terminal operator that returns the first element emitted by the flow matching the given [predicate] and then cancels flow's collection.
 * Returns `null` if the flow did not contain an element matching the [predicate].
 */


public suspend fun < T > Flow < T > . last ( ) : T

{ <EOL> var result : Any ? = NULL <EOL> collect { <EOL> result = it <EOL> } <EOL> if ( result === NULL ) throw NoSuchElementException ( "<STR_LIT>" ) <EOL> return result as T <EOL> }

/**
 * The terminal operator that returns the last element emitted by the flow.
 *
 * Throws [NoSuchElementException] if the flow was empty.
 */


public suspend fun < T > Flow < T > . lastOrNull ( ) : T ?

{ <EOL> var result : T ? = null <EOL> collect { <EOL> result = it <EOL> } <EOL> return result <EOL> }

/**
 * The terminal operator that returns the last element emitted by the flow or `null` if the flow was empty.
 */


public fun < T : Number , D : Dimension > MultiArray < T , D > . toSortedSet ( ) : java . util . SortedSet < T >

{ <EOL> return toCollection ( java . util . TreeSet ( ) ) <EOL> }

/**
 * Returns a [SortedSet][java.util.SortedSet] of all elements.
 */


public fun < T , D : Dimension > MultiArray < T , D > . toSortedSet ( comparator : Comparator < in T > ) : java . util . SortedSet < T >

{ <EOL> return toCollection ( java . util . TreeSet ( comparator ) ) <EOL> }

/**
 * Returns a [SortedSet][java.util.SortedSet] of all elements.
 *
 * Elements in the set returned are sorted according to the given [comparator].
 */


public abstract fun provideExtensionsFor ( module : KtModule ) : List < KtResolveExtension >

/**
 * Provides a list of [KtResolveExtension]s for a given [KtModule].
 *
 * Should not perform any heavy analysis and the generation of the actual files. All file generation should be performed only in [KtResolveExtensionFile.buildFileText].
 *
 * Implementations should consider caching the results, so the subsequent invocations should be performed instantly.
 *
 * Implementation cannot use the Kotlin resolve inside, as this function is called during session initialization, so Analysis API access is forbidden.
 */


internal expect fun ensurePlatformExceptionHandlerLoaded ( callback : CoroutineExceptionHandler )

/**
 * Ensures that the given [callback] is present in the [platformExceptionHandlers] list.
 */


internal expect fun propagateExceptionFinalResort ( exception : Throwable )

/**
 * The platform-dependent global exception handler, used so that the exception is logged at least *somewhere*.
 */


internal fun handleUncaughtCoroutineException ( context : CoroutineContext , exception : Throwable )

{ <EOL> for ( handler in platformExceptionHandlers ) { <EOL> try { <EOL> handler . handleException ( context , exception ) <EOL> } catch ( _ : ExceptionSuccessfullyProcessed ) { <EOL> return <EOL> } catch ( t : Throwable ) { <EOL> propagateExceptionFinalResort ( handlerException ( exception , t ) ) <EOL> } <EOL> } <EOL> try { <EOL> exception . addSuppressed ( DiagnosticCoroutineContextException ( context ) ) <EOL> } catch ( e : Throwable ) { <EOL> } <EOL> propagateExceptionFinalResort ( exception ) <EOL> }

/**
 * Deal with exceptions that happened in coroutines and weren't programmatically dealt with.
 *
 * First, it notifies every [CoroutineExceptionHandler] in the [platformExceptionHandlers] list.
 * If one of them throws [ExceptionSuccessfullyProcessed], it means that that handler believes that the exception was
 * dealt with sufficiently well and doesn't need any further processing.
 * Otherwise, the platform-dependent global exception handler is also invoked.
 */


public fun getFloatArray ( result : R , index : Int ) : FloatArray

/**
 * Returns the output at [index] as a [FloatArray].
 */


public fun getLongArray ( result : R , index : Int ) : LongArray

/**
 * Returns the output at [index] as a [LongArray].
 */


abstract fun isVisible ( receiver : ReceiverValue ? , what : DeclarationDescriptorWithVisibility , from : DeclarationDescriptor , useSpecialRulesForPrivateSealedConstructors : Boolean ) : Boolean

/**
 * @param receiver can be used to determine callee accessibility for some special receiver value
 *
 * 'null'-value basically means that receiver is absent in current call
 *
 * In case if it's needed to perform basic checks ignoring ones considering receiver (e.g. when checks happen beyond any call),
 * special value Visibilities.ALWAYS_SUITABLE_RECEIVER should be used.
 * If it's needed to determine whether visibility accepts any receiver, Visibilities.IRRELEVANT_RECEIVER should be used.
 *
 * NB: Currently Visibilities.IRRELEVANT_RECEIVER has the same effect as 'null'
 *
 * Also it's important that implementation that take receiver into account do aware about these special values.
 */


abstract fun mustCheckInImports ( ) : Boolean

/**
 * True, if it makes sense to check this visibility in imports and not import inaccessible declarations with such visibility.
 * Hint: return true, if this visibility can be checked on file's level.
 * Examples:
 * it returns false for PROTECTED because protected members of classes can be imported to be used in subclasses of their containers,
 * so when we are looking at the import, we don't know whether it is legal somewhere in this file or not.
 * it returns true for INTERNAL, because an internal declaration is either visible everywhere in a file, or invisible everywhere in the same file.
 * it returns true for PRIVATE, because there's no point in importing privates: they are inaccessible unless their short name is
 * already available without an import
 */


fun compareTo ( visibility : DescriptorVisibility ) : Int ?

{ <EOL> return delegate . compareTo ( visibility . delegate ) <EOL> }

/**
 * @return null if the answer is unknown
 */


fun convertExpression ( expression : LighterASTNode , errorReason : String ) : FirElement

{ <EOL> return when ( expression . tokenType ) { <EOL> LAMBDA_EXPRESSION -> convertLambdaExpression ( expression ) <EOL> BINARY_EXPRESSION -> convertBinaryExpression ( expression ) <EOL> BINARY_WITH_TYPE -> convertBinaryWithTypeRHSExpression ( expression ) { <EOL> this . getOperationSymbol ( ) . toFirOperation ( ) <EOL> } <EOL> IS_EXPRESSION -> convertBinaryWithTypeRHSExpression ( expression ) { <EOL> if ( this == "<STR_LIT>" ) FirOperation . IS else FirOperation . NOT_IS <EOL> } <EOL> LABELED_EXPRESSION -> convertLabeledExpression ( expression ) <EOL> PREFIX_EXPRESSION , POSTFIX_EXPRESSION -> convertUnaryExpression ( expression ) <EOL> ANNOTATED_EXPRESSION -> convertAnnotatedExpression ( expression ) <EOL> CLASS_LITERAL_EXPRESSION -> convertClassLiteralExpression ( expression ) <EOL> CALLABLE_REFERENCE_EXPRESSION -> convertCallableReferenceExpression ( expression ) <EOL> in QUALIFIED_ACCESS -> convertQualifiedExpression ( expression ) <EOL> CALL_EXPRESSION -> convertCallExpression ( expression ) <EOL> WHEN -> convertWhenExpression ( expression ) <EOL> ARRAY_ACCESS_EXPRESSION -> convertArrayAccessExpression ( expression ) <EOL> COLLECTION_LITERAL_EXPRESSION -> convertCollectionLiteralExpression ( expression ) <EOL> STRING_TEMPLATE -> convertStringTemplate ( expression ) <EOL> is KtConstantExpressionElementType -> convertConstantExpression ( expression ) <EOL> REFERENCE_EXPRESSION -> convertSimpleNameExpression ( expression ) <EOL> DO_WHILE -> convertDoWhile ( expression ) <EOL> WHILE -> convertWhile ( expression ) <EOL> FOR -> convertFor ( expression ) <EOL> TRY -> convertTryExpression ( expression ) <EOL> IF -> convertIfExpression ( expression ) <EOL> BREAK , CONTINUE -> convertLoopJump ( expression ) <EOL> RETURN -> convertReturn ( expression ) <EOL> THROW -> convertThrow ( expression ) <EOL> PARENTHESIZED -> { <EOL> val content = expression . getExpressionInParentheses ( ) <EOL> context . forwardLabelUsagePermission ( expression , content ) <EOL> getAsFirExpression ( content , "<STR_LIT>" ) <EOL> } <EOL> PROPERTY_DELEGATE , INDICES , CONDITION , LOOP_RANGE -> <EOL> getAsFirExpression ( expression . getChildExpression ( ) , errorReason ) <EOL> THIS_EXPRESSION -> convertThisExpression ( expression ) <EOL> SUPER_EXPRESSION -> convertSuperExpression ( expression ) <EOL> OBJECT_LITERAL -> declarationBuilder . convertObjectLiteral ( expression ) <EOL> FUN -> declarationBuilder . convertFunctionDeclaration ( expression ) <EOL> DESTRUCTURING_DECLARATION -> declarationBuilder . convertDestructingDeclaration ( expression ) . toFirDestructingDeclaration ( this , baseModuleData ) <EOL> else -> buildErrorExpression ( expression . toFirSourceElement ( KtFakeSourceElementKind . ErrorTypeRef ) , ConeSimpleDiagnostic ( errorReason , DiagnosticKind . ExpressionExpected ) ) <EOL> } <EOL> }


private fun convertLambdaExpression ( lambdaExpression : LighterASTNode ) : FirExpression

{ <EOL> val valueParameterList = mutableListOf < ValueParameter > ( ) <EOL> var block : LighterASTNode ? = null <EOL> var hasArrow = false <EOL> val functionSymbol = FirAnonymousFunctionSymbol ( ) <EOL> lambdaExpression . getChildNodesByType ( FUNCTION_LITERAL ) . first ( ) . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> VALUE_PARAMETER_LIST -> valueParameterList += declarationBuilder . convertValueParameters ( it , functionSymbol , ValueParameterDeclaration . LAMBDA ) <EOL> BLOCK -> block = it <EOL> ARROW -> hasArrow = true <EOL> } <EOL> } <EOL> val expressionSource = lambdaExpression . toFirSourceElement ( ) <EOL> val target : FirFunctionTarget <EOL> val anonymousFunction = buildAnonymousFunction { <EOL> source = expressionSource <EOL> moduleData = baseModuleData <EOL> origin = FirDeclarationOrigin . Source <EOL> returnTypeRef = implicitType <EOL> receiverParameter = expressionSource . asReceiverParameter ( ) <EOL> symbol = functionSymbol <EOL> isLambda = true <EOL> hasExplicitParameterList = hasArrow <EOL> label = context . getLastLabel ( lambdaExpression ) ? : context . calleeNamesForLambda . lastOrNull ( ) ? . let { <EOL> buildLabel { <EOL> source = expressionSource . fakeElement ( KtFakeSourceElementKind . GeneratedLambdaLabel ) <EOL> name = it . asString ( ) <EOL> } <EOL> } <EOL> target = FirFunctionTarget ( labelName = label ? . name , isLambda = true ) <EOL> context . firFunctionTargets += target <EOL> val destructuringStatements = mutableListOf < FirStatement > ( ) <EOL> for ( valueParameter in valueParameterList ) { <EOL> val multiDeclaration = valueParameter . destructuringDeclaration <EOL> valueParameters += if ( multiDeclaration != null ) { <EOL> val name = SpecialNames . DESTRUCT <EOL> val multiParameter = buildValueParameter { <EOL> source = valueParameter . firValueParameter . source <EOL> containingFunctionSymbol = functionSymbol <EOL> moduleData = baseModuleData <EOL> origin = FirDeclarationOrigin . Source <EOL> returnTypeRef = valueParameter . firValueParameter . returnTypeRef <EOL> this . name = name <EOL> symbol = FirValueParameterSymbol ( name ) <EOL> defaultValue = null <EOL> isCrossinline = false <EOL> isNoinline = false <EOL> isVararg = false <EOL> } <EOL> addDestructuringStatements ( destructuringStatements , baseModuleData , multiDeclaration , multiParameter , tmpVariable = false , forceLocal = true , ) <EOL> multiParameter <EOL> } else { <EOL> valueParameter . firValueParameter <EOL> } <EOL> } <EOL> body = withForcedLocalContext { <EOL> if ( block != null ) { <EOL> val kind = runIf ( destructuringStatements . isNotEmpty ( ) ) { <EOL> KtFakeSourceElementKind . LambdaDestructuringBlock <EOL> } <EOL> val bodyBlock = declarationBuilder . convertBlockExpressionWithoutBuilding ( block ! ! , kind ) . apply { <EOL> statements . firstOrNull ( ) ? . let { <EOL> if ( it . isContractBlockFirCheck ( ) ) { <EOL> this@buildAnonymousFunction . contractDescription = it . toLegacyRawContractDescription ( ) <EOL> statements [ <NUM_LIT:0> ] = FirContractCallBlock ( it ) <EOL> } <EOL> } <EOL> if ( statements . isEmpty ( ) ) { <EOL> statements . add ( buildReturnExpression { <EOL> source = expressionSource . fakeElement ( KtFakeSourceElementKind . ImplicitReturn . FromExpressionBody ) <EOL> this . target = target <EOL> result = buildUnitExpression { <EOL> source = expressionSource . fakeElement ( KtFakeSourceElementKind . ImplicitUnit . LambdaCoercion ) <EOL> } <EOL> } ) <EOL> } <EOL> } . build ( ) <EOL> if ( destructuringStatements . isNotEmpty ( ) ) { <EOL> buildBlock { <EOL> source = bodyBlock . source ? . realElement ( ) <EOL> statements . addAll ( destructuringStatements ) <EOL> statements . add ( bodyBlock ) <EOL> } <EOL> } else { <EOL> bodyBlock <EOL> } <EOL> } else { <EOL> buildSingleExpressionBlock ( buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) ) <EOL> } <EOL> } <EOL> context . firFunctionTargets . removeLast ( ) <EOL> } . also { <EOL> target . bind ( it ) <EOL> } <EOL> return buildAnonymousFunctionExpression { <EOL> source = expressionSource <EOL> this . anonymousFunction = anonymousFunction <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseFunctionLiteral
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitLambdaExpression
 */


private fun convertBinaryExpression ( binaryExpression : LighterASTNode ) : FirStatement

{ <EOL> var isLeftArgument = true <EOL> lateinit var operationTokenName : String <EOL> var leftArgNode : LighterASTNode ? = null <EOL> var rightArg : LighterASTNode ? = null <EOL> var operationReferenceSource : KtLightSourceElement ? = null <EOL> binaryExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> OPERATION_REFERENCE -> { <EOL> isLeftArgument = false <EOL> operationTokenName = it . asText <EOL> operationReferenceSource = it . toFirSourceElement ( ) <EOL> } <EOL> else -> if ( it . isExpression ( ) ) { <EOL> if ( isLeftArgument ) { <EOL> leftArgNode = it <EOL> } else { <EOL> rightArg = it <EOL> } <EOL> } <EOL> } <EOL> } <EOL> val baseSource = binaryExpression . toFirSourceElement ( ) <EOL> val operationToken = operationTokenName . getOperationSymbol ( ) <EOL> if ( operationToken == IDENTIFIER ) { <EOL> context . calleeNamesForLambda += operationTokenName . nameAsSafeName ( ) <EOL> } else { <EOL> context . calleeNamesForLambda += null <EOL> } <EOL> val rightArgAsFir = <EOL> if ( rightArg != null ) <EOL> getAsFirExpression < FirExpression > ( rightArg , "<STR_LIT>" ) <EOL> else <EOL> buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) <EOL> val leftArgAsFir = getAsFirExpression < FirExpression > ( leftArgNode , "<STR_LIT>" ) <EOL> context . calleeNamesForLambda . removeLast ( ) <EOL> when ( operationToken ) { <EOL> ELVIS -> <EOL> return leftArgAsFir . generateNotNullOrOther ( rightArgAsFir , baseSource ) <EOL> ANDAND , OROR -> <EOL> return leftArgAsFir . generateLazyLogicalOperation ( rightArgAsFir , operationToken == ANDAND , baseSource ) <EOL> in OperatorConventions . IN_OPERATIONS -> <EOL> return rightArgAsFir . generateContainsOperation ( leftArgAsFir , operationToken == NOT_IN , baseSource , operationReferenceSource ) <EOL> in OperatorConventions . COMPARISON_OPERATIONS -> <EOL> return leftArgAsFir . generateComparisonExpression ( rightArgAsFir , operationToken , baseSource , operationReferenceSource ) <EOL> } <EOL> val conventionCallName = operationToken . toBinaryName ( ) <EOL> return if ( conventionCallName != null || operationToken == IDENTIFIER ) { <EOL> buildFunctionCall { <EOL> source = binaryExpression . toFirSourceElement ( ) <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = operationReferenceSource ? : this@buildFunctionCall . source <EOL> name = conventionCallName ? : operationTokenName . nameAsSafeName ( ) <EOL> } <EOL> explicitReceiver = leftArgAsFir <EOL> argumentList = buildUnaryArgumentList ( rightArgAsFir ) <EOL> origin = if ( conventionCallName != null ) FirFunctionCallOrigin . Operator else FirFunctionCallOrigin . Infix <EOL> } <EOL> } else { <EOL> val firOperation = operationToken . toFirOperation ( ) <EOL> if ( firOperation in FirOperation . ASSIGNMENTS ) { <EOL> return leftArgNode . generateAssignment ( binaryExpression . toFirSourceElement ( ) , leftArgNode ? . toFirSourceElement ( ) , rightArgAsFir , firOperation , leftArgAsFir . annotations , rightArg , ) { <EOL> getAsFirExpression < FirExpression > ( this , "<STR_LIT>" , sourceWhenInvalidExpression = binaryExpression , isValidExpression = { ! it . isStatementLikeExpression || it . isArraySet } , ) <EOL> } <EOL> } else { <EOL> buildEqualityOperatorCall { <EOL> source = binaryExpression . toFirSourceElement ( ) <EOL> operation = firOperation <EOL> argumentList = buildBinaryArgumentList ( leftArgAsFir , rightArgAsFir ) <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseBinaryExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitBinaryExpression
 */


private fun convertBinaryWithTypeRHSExpression ( binaryExpression : LighterASTNode , toFirOperation : String . ( ) -> FirOperation ) : FirTypeOperatorCall

{ <EOL> lateinit var operationTokenName : String <EOL> var leftArgAsFir : FirExpression ? = null <EOL> lateinit var firType : FirTypeRef <EOL> binaryExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> OPERATION_REFERENCE -> operationTokenName = it . asText <EOL> TYPE_REFERENCE -> firType = declarationBuilder . convertType ( it ) <EOL> else -> if ( it . isExpression ( ) ) leftArgAsFir = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> return buildTypeOperatorCall { <EOL> source = binaryExpression . toFirSourceElement ( ) <EOL> operation = operationTokenName . toFirOperation ( ) <EOL> conversionTypeRef = firType <EOL> argumentList = buildUnaryArgumentList ( leftArgAsFir ? : buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) ) <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.Precedence.parseRightHandSide
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitBinaryWithTypeRHSExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitIsExpression
 */


private fun convertLabeledExpression ( labeledExpression : LighterASTNode ) : FirElement

{ <EOL> var firExpression : FirElement ? = null <EOL> var labelSource : KtSourceElement ? = null <EOL> var forbiddenLabelKind : ForbiddenLabelKind ? = null <EOL> val isRepetitiveLabel = labeledExpression . getLabeledExpression ( ) ? . tokenType == LABELED_EXPRESSION <EOL> labeledExpression . forEachChildren { <EOL> context . setNewLabelUserNode ( it ) <EOL> when ( it . tokenType ) { <EOL> LABEL_QUALIFIER -> { <EOL> val name = it . asText . dropLast ( <NUM_LIT:1> ) <EOL> labelSource = it . getChildNodesByType ( LABEL ) . single ( ) . toFirSourceElement ( ) <EOL> context . addNewLabel ( buildLabel ( name , labelSource ! ! ) ) <EOL> forbiddenLabelKind = getForbiddenLabelKind ( name , isRepetitiveLabel ) <EOL> } <EOL> BLOCK -> firExpression = declarationBuilder . convertBlock ( it ) <EOL> PROPERTY -> firExpression = declarationBuilder . convertPropertyDeclaration ( it ) <EOL> else -> if ( it . isExpression ( ) ) firExpression = getAsFirStatement ( it ) <EOL> } <EOL> } <EOL> context . dropLastLabel ( ) <EOL> return buildExpressionHandlingErrors ( firExpression , labeledExpression . toFirSourceElement ( ) , forbiddenLabelKind , labelSource ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseLabeledExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitLabeledExpression
 */


private fun convertUnaryExpression ( unaryExpression : LighterASTNode ) : FirExpression

{ <EOL> lateinit var operationTokenName : String <EOL> var argument : LighterASTNode ? = null <EOL> var operationReference : LighterASTNode ? = null <EOL> unaryExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> OPERATION_REFERENCE -> { <EOL> operationReference = it <EOL> operationTokenName = it . asText <EOL> } <EOL> else -> if ( it . isExpression ( ) ) argument = it <EOL> } <EOL> } <EOL> val operationToken = operationTokenName . getOperationSymbol ( ) <EOL> val conventionCallName = operationToken . toUnaryName ( ) <EOL> return when { <EOL> operationToken == EXCLEXCL -> { <EOL> buildCheckNotNullCall { <EOL> source = unaryExpression . toFirSourceElement ( ) <EOL> argumentList = buildUnaryArgumentList ( getAsFirExpression < FirExpression > ( argument , "<STR_LIT>" ) ) <EOL> } <EOL> } <EOL> conventionCallName != null -> { <EOL> if ( operationToken in OperatorConventions . INCREMENT_OPERATIONS ) { <EOL> return generateIncrementOrDecrementBlock ( unaryExpression , operationReference , argument , callName = conventionCallName , prefix = unaryExpression . tokenType == PREFIX_EXPRESSION ) { getAsFirExpression ( this ) } <EOL> } <EOL> val receiver = getAsFirExpression < FirExpression > ( argument , "<STR_LIT>" ) <EOL> convertUnaryPlusMinusCallOnIntegerLiteralIfNecessary ( unaryExpression , receiver , operationToken ) ? . let { return it } <EOL> buildFunctionCall { <EOL> source = unaryExpression . toFirSourceElement ( ) <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = operationReference ? . toFirSourceElement ( ) ? : this@buildFunctionCall . source <EOL> name = conventionCallName <EOL> } <EOL> explicitReceiver = receiver <EOL> origin = FirFunctionCallOrigin . Operator <EOL> } <EOL> } <EOL> else -> throw IllegalStateException ( "<STR_LIT>" ) <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parsePostfixExpression
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parsePrefixExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitUnaryExpression
 */


private fun convertAnnotatedExpression ( annotatedExpression : LighterASTNode ) : FirElement

{ <EOL> var firExpression : FirElement ? = null <EOL> val firAnnotationList = mutableListOf < FirAnnotation > ( ) <EOL> annotatedExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> ANNOTATION -> firAnnotationList += declarationBuilder . convertAnnotation ( it ) <EOL> ANNOTATION_ENTRY -> firAnnotationList += declarationBuilder . convertAnnotationEntry ( it ) <EOL> BLOCK -> firExpression = declarationBuilder . convertBlockExpression ( it ) <EOL> else -> if ( it . isExpression ( ) ) { <EOL> context . forwardLabelUsagePermission ( annotatedExpression , it ) <EOL> firExpression = getAsFirStatement ( it ) <EOL> } <EOL> } <EOL> } <EOL> val result = firExpression ? : buildErrorExpression ( null , ConeNotAnnotationContainer ( "<STR_LIT>" ) ) <EOL> require ( result is FirAnnotationContainer ) <EOL> result . replaceAnnotations ( result . annotations . smartPlus ( firAnnotationList ) ) <EOL> return result <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parsePrefixExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitAnnotatedExpression
 */


private fun convertClassLiteralExpression ( classLiteralExpression : LighterASTNode ) : FirExpression

{ <EOL> var firReceiverExpression : FirExpression ? = null <EOL> classLiteralExpression . forEachChildren { <EOL> if ( it . isExpression ( ) ) firReceiverExpression = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> val classLiteralSource = classLiteralExpression . toFirSourceElement ( ) <EOL> return buildGetClassCall { <EOL> source = classLiteralSource <EOL> argumentList = buildUnaryArgumentList ( firReceiverExpression ? : buildErrorExpression ( classLiteralSource , ConeUnsupportedClassLiteralsWithEmptyLhs ) ) <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseDoubleColonSuffix
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitClassLiteralExpression
 */


private fun convertCallableReferenceExpression ( callableReferenceExpression : LighterASTNode ) : FirExpression

{ <EOL> var isReceiver = true <EOL> var hasQuestionMarkAtLHS = false <EOL> var firReceiverExpression : FirExpression ? = null <EOL> lateinit var namedReference : FirNamedReference <EOL> callableReferenceExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> COLONCOLON -> isReceiver = false <EOL> QUEST -> hasQuestionMarkAtLHS = true <EOL> else -> if ( it . isExpression ( ) ) { <EOL> if ( isReceiver ) { <EOL> firReceiverExpression = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } else { <EOL> namedReference = createSimpleNamedReference ( it . toFirSourceElement ( ) , it ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> return buildCallableReferenceAccess { <EOL> source = callableReferenceExpression . toFirSourceElement ( ) <EOL> calleeReference = namedReference <EOL> explicitReceiver = firReceiverExpression <EOL> this . hasQuestionMarkAtLHS = hasQuestionMarkAtLHS <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseDoubleColonSuffix
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitCallableReferenceExpression
 */


private fun convertQualifiedExpression ( dotQualifiedExpression : LighterASTNode ) : FirExpression

{ <EOL> var isSelector = false <EOL> var isSafe = false <EOL> var firSelector : FirExpression ? = null <EOL> var firReceiver : FirExpression ? = null <EOL> dotQualifiedExpression . forEachChildren { <EOL> when ( val tokenType = it . tokenType ) { <EOL> DOT -> isSelector = true <EOL> SAFE_ACCESS -> { <EOL> isSafe = true <EOL> isSelector = true <EOL> } <EOL> else -> { <EOL> val isEffectiveSelector = isSelector && tokenType != TokenType . ERROR_ELEMENT <EOL> val firExpression = <EOL> getAsFirExpression < FirExpression > ( it , "<STR_LIT>" ) <EOL> if ( isEffectiveSelector ) { <EOL> val callExpressionCallee = if ( tokenType == CALL_EXPRESSION ) it . getFirstChildExpressionUnwrapped ( ) else null <EOL> firSelector = <EOL> if ( tokenType is KtNameReferenceExpressionElementType || ( tokenType == CALL_EXPRESSION && callExpressionCallee ? . tokenType != LAMBDA_EXPRESSION ) ) { <EOL> firExpression <EOL> } else { <EOL> buildErrorExpression { <EOL> source = callExpressionCallee ? . toFirSourceElement ( ) ? : it . toFirSourceElement ( ) <EOL> diagnostic = ConeSimpleDiagnostic ( "<STR_LIT>" , if ( callExpressionCallee == null ) DiagnosticKind . IllegalSelector else DiagnosticKind . NoReceiverAllowed ) <EOL> expression = firExpression <EOL> } <EOL> } <EOL> } else { <EOL> firReceiver = firExpression <EOL> } <EOL> } <EOL> } <EOL> } <EOL> var result = firSelector <EOL> ( firSelector as? FirQualifiedAccessExpression ) ? . let { <EOL> if ( isSafe ) { <EOL> @ OptIn ( FirImplementationDetail :: class ) <EOL> it . replaceSource ( dotQualifiedExpression . toFirSourceElement ( KtFakeSourceElementKind . DesugaredSafeCallExpression ) ) <EOL> return it . createSafeCall ( firReceiver ! ! , dotQualifiedExpression . toFirSourceElement ( ) ) <EOL> } <EOL> result = convertFirSelector ( it , dotQualifiedExpression . toFirSourceElement ( ) , firReceiver ! ! ) <EOL> } <EOL> val receiver = firReceiver <EOL> if ( receiver != null ) { <EOL> ( firSelector as? FirErrorExpression ) ? . let { errorExpression -> <EOL> return buildQualifiedErrorAccessExpression { <EOL> this . receiver = receiver <EOL> this . selector = errorExpression <EOL> source = dotQualifiedExpression . toFirSourceElement ( ) <EOL> diagnostic = ConeSyntaxDiagnostic ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } <EOL> return result ? : buildErrorExpression { <EOL> source = dotQualifiedExpression . toFirSourceElement ( ) <EOL> diagnostic = ConeSyntaxDiagnostic ( "<STR_LIT>" ) <EOL> expression = firReceiver <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parsePostfixExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitQualifiedExpression
 */


private fun convertCallExpression ( callSuffix : LighterASTNode ) : FirExpression

{ <EOL> var name : String ? = null <EOL> val firTypeArguments = mutableListOf < FirTypeProjection > ( ) <EOL> val valueArguments = mutableListOf < LighterASTNode > ( ) <EOL> var additionalArgument : FirExpression ? = null <EOL> var hasArguments = false <EOL> var superNode : LighterASTNode ? = null <EOL> callSuffix . forEachChildren { child -> <EOL> fun process ( node : LighterASTNode ) { <EOL> when ( node . tokenType ) { <EOL> REFERENCE_EXPRESSION -> { <EOL> name = node . asText <EOL> } <EOL> SUPER_EXPRESSION -> { <EOL> superNode = node <EOL> } <EOL> PARENTHESIZED -> if ( node . tokenType != TokenType . ERROR_ELEMENT ) { <EOL> additionalArgument = getAsFirExpression ( node . getExpressionInParentheses ( ) , "<STR_LIT>" ) <EOL> } <EOL> TYPE_ARGUMENT_LIST -> { <EOL> firTypeArguments += declarationBuilder . convertTypeArguments ( node , allowedUnderscoredTypeArgument = true ) <EOL> } <EOL> VALUE_ARGUMENT_LIST , LAMBDA_ARGUMENT -> { <EOL> hasArguments = true <EOL> valueArguments += node <EOL> } <EOL> else -> if ( node . tokenType != TokenType . ERROR_ELEMENT ) { <EOL> additionalArgument = getAsFirExpression ( node , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } <EOL> process ( child ) <EOL> } <EOL> val source = callSuffix . toFirSourceElement ( ) <EOL> val ( calleeReference , explicitReceiver , isImplicitInvoke ) = when { <EOL> name != null -> CalleeAndReceiver ( buildSimpleNamedReference { <EOL> this . source = callSuffix . getFirstChildExpressionUnwrapped ( ) ? . toFirSourceElement ( ) ? : source <EOL> this . name = name . nameAsSafeName ( ) <EOL> } ) <EOL> superNode != null || ( additionalArgument as? FirResolvable ) ? . calleeReference is FirSuperReference -> { <EOL> CalleeAndReceiver ( buildErrorNamedReference { <EOL> this . source = superNode ? . toFirSourceElement ( ) ? : ( additionalArgument as? FirResolvable ) ? . calleeReference ? . source <EOL> diagnostic = ConeSimpleDiagnostic ( "<STR_LIT>" , DiagnosticKind . SuperNotAllowed ) <EOL> } ) <EOL> } <EOL> additionalArgument != null -> { <EOL> CalleeAndReceiver ( buildSimpleNamedReference { <EOL> this . source = source <EOL> this . name = OperatorNameConventions . INVOKE <EOL> } , additionalArgument ! ! , isImplicitInvoke = true ) <EOL> } <EOL> else -> CalleeAndReceiver ( buildErrorNamedReference { <EOL> this . source = source <EOL> diagnostic = ConeSyntaxDiagnostic ( "<STR_LIT>" ) <EOL> } ) <EOL> } <EOL> val builder : FirQualifiedAccessExpressionBuilder = if ( hasArguments ) { <EOL> val builder = if ( isImplicitInvoke ) FirImplicitInvokeCallBuilder ( ) else FirFunctionCallBuilder ( ) <EOL> builder . apply { <EOL> this . source = source <EOL> this . calleeReference = calleeReference <EOL> context . calleeNamesForLambda += calleeReference . name <EOL> this . extractArgumentsFrom ( valueArguments . flatMap { convertValueArguments ( it ) } ) <EOL> context . calleeNamesForLambda . removeLast ( ) <EOL> } <EOL> } else { <EOL> FirPropertyAccessExpressionBuilder ( ) . apply { <EOL> this . source = source <EOL> this . calleeReference = calleeReference <EOL> } <EOL> } <EOL> return builder . apply { <EOL> this . explicitReceiver = explicitReceiver <EOL> typeArguments += firTypeArguments <EOL> } . build ( ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseCallSuffix
 */


private fun convertStringTemplate ( stringTemplate : LighterASTNode ) : FirExpression

{ <EOL> return stringTemplate . getChildrenAsArray ( ) . toInterpolatingCall ( stringTemplate ) { convertShortOrLongStringTemplate ( it ) } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseStringTemplate
 */


private fun convertConstantExpression ( constantExpression : LighterASTNode ) : FirExpression

{ <EOL> return generateConstantExpressionByLiteral ( constantExpression ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseLiteralConstant
 */


private fun convertWhenExpression ( whenExpression : LighterASTNode ) : FirExpression

{ <EOL> var subjectExpression : FirExpression ? = null <EOL> var subjectVariable : FirVariable ? = null <EOL> val whenEntryNodes = mutableListOf < LighterASTNode > ( ) <EOL> val whenEntries = mutableListOf < WhenEntry > ( ) <EOL> whenExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> PROPERTY -> subjectVariable = ( declarationBuilder . convertPropertyDeclaration ( it ) as FirVariable ) . let { variable -> <EOL> buildProperty { <EOL> source = it . toFirSourceElement ( ) <EOL> origin = FirDeclarationOrigin . Source <EOL> moduleData = baseModuleData <EOL> returnTypeRef = variable . returnTypeRef <EOL> name = variable . name <EOL> initializer = variable . initializer <EOL> isVar = false <EOL> symbol = FirPropertySymbol ( variable . name ) <EOL> isLocal = true <EOL> status = FirDeclarationStatusImpl ( Visibilities . Local , Modality . FINAL ) <EOL> annotations += variable . annotations <EOL> } <EOL> } <EOL> DESTRUCTURING_DECLARATION -> subjectExpression = <EOL> getAsFirExpression ( it , "<STR_LIT>" ) <EOL> WHEN_ENTRY -> whenEntryNodes += it <EOL> else -> if ( it . isExpression ( ) ) subjectExpression = <EOL> getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> subjectExpression = subjectVariable ? . initializer ? : subjectExpression <EOL> val hasSubject = subjectExpression != null <EOL> @ OptIn ( FirContractViolation :: class ) <EOL> val subject = FirExpressionRef < FirWhenExpression > ( ) <EOL> var shouldBind = hasSubject <EOL> whenEntryNodes . mapTo ( whenEntries ) { <EOL> convertWhenEntry ( it , subject , hasSubject ) <EOL> } <EOL> return buildWhenExpression { <EOL> source = whenExpression . toFirSourceElement ( ) <EOL> this . subject = subjectExpression <EOL> this . subjectVariable = subjectVariable <EOL> usedAsExpression = whenExpression . usedAsExpression <EOL> for ( entry in whenEntries ) { <EOL> shouldBind = shouldBind || entry . shouldBindSubject <EOL> val branch = entry . firBlock <EOL> val entrySource = entry . node . toFirSourceElement ( ) <EOL> branches += if ( ! entry . isElse ) { <EOL> if ( hasSubject ) { <EOL> val firCondition = entry . toFirWhenCondition ( ) <EOL> buildWhenBranch { <EOL> source = entrySource <EOL> condition = firCondition <EOL> result = branch <EOL> } <EOL> } else { <EOL> val firCondition = entry . toFirWhenConditionWithoutSubject ( ) <EOL> buildWhenBranch { <EOL> source = entrySource <EOL> condition = firCondition <EOL> result = branch <EOL> } <EOL> } <EOL> } else { <EOL> buildWhenBranch { <EOL> source = entrySource <EOL> condition = buildElseIfTrueCondition ( ) <EOL> result = branch <EOL> } <EOL> } <EOL> } <EOL> } . also { <EOL> if ( shouldBind ) { <EOL> subject . bind ( it ) <EOL> } <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseWhen
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitWhenExpression
 */


private fun convertWhenEntry ( whenEntry : LighterASTNode , whenRefWithSubject : FirExpressionRef < FirWhenExpression > , hasSubject : Boolean , ) : WhenEntry

{ <EOL> var isElse = false <EOL> var firBlock : FirBlock = buildEmptyExpressionBlock ( ) <EOL> val conditions = mutableListOf < FirExpression > ( ) <EOL> var shouldBindSubject = false <EOL> whenEntry . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> WHEN_CONDITION_EXPRESSION -> conditions += convertWhenConditionExpression ( it , whenRefWithSubject . takeIf { hasSubject } ) <EOL> WHEN_CONDITION_IN_RANGE -> { <EOL> val ( condition , shouldBind ) = convertWhenConditionInRange ( it , whenRefWithSubject , hasSubject ) <EOL> conditions += condition <EOL> shouldBindSubject = shouldBindSubject || shouldBind <EOL> } <EOL> WHEN_CONDITION_IS_PATTERN -> { <EOL> val ( condition , shouldBind ) = convertWhenConditionIsPattern ( it , whenRefWithSubject , hasSubject ) <EOL> conditions += condition <EOL> shouldBindSubject = shouldBindSubject || shouldBind <EOL> } <EOL> ELSE_KEYWORD -> isElse = true <EOL> BLOCK -> firBlock = declarationBuilder . convertBlock ( it ) <EOL> else -> if ( it . isExpression ( ) ) firBlock = declarationBuilder . convertBlock ( it ) <EOL> } <EOL> } <EOL> return WhenEntry ( conditions , firBlock , whenEntry , isElse , shouldBindSubject ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseWhenEntry
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseWhenEntryNotElse
 */


private fun convertArrayAccessExpression ( arrayAccess : LighterASTNode ) : FirExpression

{ <EOL> var firExpression : FirExpression ? = null <EOL> val indices : MutableList < FirExpression > = mutableListOf ( ) <EOL> arrayAccess . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> INDICES -> indices += convertIndices ( it ) <EOL> else -> if ( it . isExpression ( ) ) firExpression = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> val getArgument = context . arraySetArgument . remove ( arrayAccess ) <EOL> return buildFunctionCall { <EOL> val isGet = getArgument == null <EOL> source = ( if ( isGet ) arrayAccess else arrayAccess . getParent ( ) ! ! ) . toFirSourceElement ( ) <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = arrayAccess . toFirSourceElement ( ) . fakeElement ( KtFakeSourceElementKind . ArrayAccessNameReference ) <EOL> name = if ( isGet ) OperatorNameConventions . GET else OperatorNameConventions . SET <EOL> } <EOL> explicitReceiver = <EOL> firExpression ? : buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) <EOL> argumentList = buildArgumentList { <EOL> arguments += indices <EOL> getArgument ? . let { arguments += it } <EOL> } <EOL> origin = FirFunctionCallOrigin . Operator <EOL> } . pullUpSafeCallIfNecessary ( ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseArrayAccess
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitArrayAccessExpression
 */


private fun convertCollectionLiteralExpression ( expression : LighterASTNode ) : FirExpression

{ <EOL> val firExpressionList = mutableListOf < FirExpression > ( ) <EOL> expression . forEachChildren { <EOL> if ( it . isExpression ( ) ) firExpressionList += getAsFirExpression < FirExpression > ( it , "<STR_LIT>" ) <EOL> } <EOL> return buildArrayLiteral { <EOL> source = expression . toFirSourceElement ( ) <EOL> argumentList = buildArgumentList { <EOL> arguments += firExpressionList <EOL> } <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseCollectionLiteralExpression
 */


private fun convertIndices ( indices : LighterASTNode ) : List < FirExpression >

{ <EOL> val firExpressionList : MutableList < FirExpression > = mutableListOf ( ) <EOL> indices . forEachChildren { <EOL> if ( it . isExpression ( ) ) firExpressionList += getAsFirExpression < FirExpression > ( it , "<STR_LIT>" ) <EOL> } <EOL> return firExpressionList <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseAsCollectionLiteralExpression
 */


private fun convertSimpleNameExpression ( referenceExpression : LighterASTNode ) : FirQualifiedAccessExpression

{ <EOL> val nameSource = referenceExpression . toFirSourceElement ( ) <EOL> val referenceSourceElement = if ( nameSource . kind is KtFakeSourceElementKind ) { <EOL> nameSource <EOL> } else { <EOL> nameSource . fakeElement ( KtFakeSourceElementKind . ReferenceInAtomicQualifiedAccess ) <EOL> } <EOL> return buildPropertyAccessExpression { <EOL> val rawText = referenceExpression . asText <EOL> if ( rawText . isUnderscore ) { <EOL> nonFatalDiagnostics . add ( ConeUnderscoreUsageWithoutBackticks ( nameSource ) ) <EOL> } <EOL> source = nameSource <EOL> calleeReference = createSimpleNamedReference ( referenceSourceElement , referenceExpression ) <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseSimpleNameExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitSimpleNameExpression
 */


private fun convertDoWhile ( doWhileLoop : LighterASTNode ) : FirElement

{ <EOL> var block : LighterASTNode ? = null <EOL> var firCondition : FirExpression ? = null <EOL> val target : FirLoopTarget <EOL> return FirDoWhileLoopBuilder ( ) . apply { <EOL> source = doWhileLoop . toFirSourceElement ( ) <EOL> target = prepareTarget ( doWhileLoop ) <EOL> doWhileLoop . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> BODY -> block = it <EOL> CONDITION -> firCondition = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> condition = <EOL> firCondition ? : buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) <EOL> } . configure ( target ) { convertLoopBody ( block ) } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseDoWhile
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitDoWhileExpression
 */


private fun convertWhile ( whileLoop : LighterASTNode ) : FirElement

{ <EOL> var block : LighterASTNode ? = null <EOL> var firCondition : FirExpression ? = null <EOL> whileLoop . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> BODY -> block = it <EOL> CONDITION -> firCondition = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> val target : FirLoopTarget <EOL> return FirWhileLoopBuilder ( ) . apply { <EOL> source = whileLoop . toFirSourceElement ( ) <EOL> condition = <EOL> firCondition ? : buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) <EOL> target = prepareTarget ( whileLoop ) <EOL> } . configure ( target ) { convertLoopBody ( block ) } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseWhile
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitWhileExpression
 */


private fun convertFor ( forLoop : LighterASTNode ) : FirElement

{ <EOL> var parameter : ValueParameter ? = null <EOL> var rangeExpression : FirExpression ? = null <EOL> var blockNode : LighterASTNode ? = null <EOL> forLoop . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> VALUE_PARAMETER -> parameter = declarationBuilder . convertValueParameter ( it , null , ValueParameterDeclaration . FOR_LOOP ) <EOL> LOOP_RANGE -> rangeExpression = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> BODY -> blockNode = it <EOL> } <EOL> } <EOL> val calculatedRangeExpression = <EOL> rangeExpression ? : buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) <EOL> val fakeSource = forLoop . toFirSourceElement ( KtFakeSourceElementKind . DesugaredForLoop ) <EOL> val rangeSource = calculatedRangeExpression . source ? . fakeElement ( KtFakeSourceElementKind . DesugaredForLoop ) ? : fakeSource <EOL> val target : FirLoopTarget <EOL> return buildBlock { <EOL> source = fakeSource <EOL> val iteratorVal = generateTemporaryVariable ( baseModuleData , rangeSource , SpecialNames . ITERATOR , buildFunctionCall { <EOL> source = rangeSource <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = rangeSource <EOL> name = OperatorNameConventions . ITERATOR <EOL> } <EOL> explicitReceiver = calculatedRangeExpression <EOL> origin = FirFunctionCallOrigin . Operator <EOL> } ) <EOL> statements += iteratorVal <EOL> statements += FirWhileLoopBuilder ( ) . apply { <EOL> source = fakeSource <EOL> condition = buildFunctionCall { <EOL> source = rangeSource <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = rangeSource <EOL> name = OperatorNameConventions . HAS_NEXT <EOL> } <EOL> explicitReceiver = generateResolvedAccessExpression ( rangeSource , iteratorVal ) <EOL> origin = FirFunctionCallOrigin . Operator <EOL> } <EOL> target = prepareTarget ( forLoop ) <EOL> } . configure ( target ) { <EOL> buildBlock block @ { <EOL> source = blockNode ? . toFirSourceElement ( ) <EOL> val valueParameter = parameter ? : return@block <EOL> val multiDeclaration = valueParameter . destructuringDeclaration <EOL> val firLoopParameter = generateTemporaryVariable ( baseModuleData , valueParameter . source , if ( multiDeclaration != null ) SpecialNames . DESTRUCT else valueParameter . name , buildFunctionCall { <EOL> source = rangeSource <EOL> calleeReference = buildSimpleNamedReference { <EOL> source = rangeSource <EOL> name = OperatorNameConventions . NEXT <EOL> } <EOL> explicitReceiver = generateResolvedAccessExpression ( rangeSource , iteratorVal ) <EOL> origin = FirFunctionCallOrigin . Operator <EOL> } , valueParameter . returnTypeRef , extractedAnnotations = valueParameter . annotations ) <EOL> if ( multiDeclaration != null ) { <EOL> addDestructuringStatements ( statements , baseModuleData , multiDeclaration , firLoopParameter , tmpVariable = true , forceLocal = true , ) <EOL> } else { <EOL> statements . add ( firLoopParameter ) <EOL> } <EOL> statements += convertLoopBody ( blockNode ) <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseFor
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitForExpression
 */


private fun convertLoopBody ( body : LighterASTNode ? ) : FirBlock

{ <EOL> return convertLoopOrIfBody ( body ) ? : buildEmptyExpressionBlock ( ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseLoopBody
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.toFirBlock
 */


private fun convertTryExpression ( tryExpression : LighterASTNode ) : FirExpression

{ <EOL> lateinit var tryBlock : FirBlock <EOL> val catchClauses = mutableListOf < Triple < ValueParameter ? , FirBlock , KtLightSourceElement > > ( ) <EOL> var finallyBlock : FirBlock ? = null <EOL> tryExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> BLOCK -> tryBlock = declarationBuilder . convertBlock ( it ) <EOL> CATCH -> convertCatchClause ( it ) ? . also { oneClause -> catchClauses += oneClause } <EOL> FINALLY -> finallyBlock = convertFinally ( it ) <EOL> } <EOL> } <EOL> return buildTryExpression { <EOL> source = tryExpression . toFirSourceElement ( ) <EOL> this . tryBlock = tryBlock <EOL> this . finallyBlock = finallyBlock <EOL> for ( ( parameter , block , clauseSource ) in catchClauses ) { <EOL> if ( parameter == null ) continue <EOL> catches += buildCatch { <EOL> this . parameter = buildProperty { <EOL> source = parameter . source <EOL> moduleData = baseModuleData <EOL> origin = FirDeclarationOrigin . Source <EOL> returnTypeRef = parameter . returnTypeRef <EOL> isVar = false <EOL> status = FirResolvedDeclarationStatusImpl ( Visibilities . Local , Modality . FINAL , EffectiveVisibility . Local ) <EOL> isLocal = true <EOL> this . name = parameter . name <EOL> symbol = FirPropertySymbol ( CallableId ( name ) ) <EOL> annotations += parameter . annotations <EOL> } . also { <EOL> it . isCatchParameter = true <EOL> } <EOL> this . block = block <EOL> this . source = clauseSource <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseTry
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitTryExpression
 */


private fun convertCatchClause ( catchClause : LighterASTNode ) : Triple < ValueParameter ? , FirBlock , KtLightSourceElement > ?

{ <EOL> var valueParameter : ValueParameter ? = null <EOL> var blockNode : LighterASTNode ? = null <EOL> catchClause . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> VALUE_PARAMETER_LIST -> valueParameter = declarationBuilder . convertValueParameters ( it , FirAnonymousFunctionSymbol ( ) , ValueParameterDeclaration . CATCH ) <EOL> . firstOrNull ( ) ? : return null <EOL> BLOCK -> blockNode = it <EOL> } <EOL> } <EOL> return Triple ( valueParameter , declarationBuilder . convertBlock ( blockNode ) , catchClause . toFirSourceElement ( ) ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseTry
 */


private fun convertFinally ( finallyExpression : LighterASTNode ) : FirBlock

{ <EOL> var blockNode : LighterASTNode ? = null <EOL> finallyExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> BLOCK -> blockNode = it <EOL> } <EOL> } <EOL> return declarationBuilder . convertBlock ( blockNode ) <EOL> }


private fun convertIfExpression ( ifExpression : LighterASTNode ) : FirExpression

{ <EOL> return buildWhenExpression { <EOL> source = ifExpression . toFirSourceElement ( ) <EOL> with ( parseIfExpression ( ifExpression ) ) { <EOL> val trueBranch = convertLoopBody ( thenBlock ) <EOL> branches += buildWhenBranch { <EOL> source = firCondition ? . source <EOL> condition = firCondition ? : buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) <EOL> result = trueBranch <EOL> } <EOL> if ( elseBlock != null ) { <EOL> val elseBranch = convertLoopOrIfBody ( elseBlock ) <EOL> if ( elseBranch != null ) { <EOL> branches += buildWhenBranch { <EOL> source = elseBlock . toFirSourceElement ( ) <EOL> condition = buildElseIfTrueCondition ( ) <EOL> result = elseBranch <EOL> } <EOL> } <EOL> } <EOL> } <EOL> usedAsExpression = ifExpression . usedAsExpression <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseIf
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitIfExpression
 */


private fun convertLoopJump ( jump : LighterASTNode ) : FirExpression

{ <EOL> var isBreak = true <EOL> jump . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> CONTINUE_KEYWORD -> isBreak = false <EOL> } <EOL> } <EOL> val jumpBuilder = if ( isBreak ) FirBreakExpressionBuilder ( ) else FirContinueExpressionBuilder ( ) <EOL> val sourceElement = jump . toFirSourceElement ( ) <EOL> return jumpBuilder . apply { <EOL> source = sourceElement <EOL> } . bindLabel ( jump ) . build ( ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseJump
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitBreakExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitContinueExpression
 */


private fun convertReturn ( returnExpression : LighterASTNode ) : FirExpression

{ <EOL> var labelName : String ? = null <EOL> var firExpression : FirExpression ? = null <EOL> returnExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> LABEL_QUALIFIER -> labelName = it . getAsStringWithoutBacktick ( ) . replace ( "<STR_LIT:@>" , "<STR_LIT>" ) <EOL> else -> if ( it . isExpression ( ) ) firExpression = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> val calculatedFirExpression = firExpression ? : buildUnitExpression { <EOL> source = returnExpression . toFirSourceElement ( KtFakeSourceElementKind . ImplicitUnit . Return ) <EOL> } <EOL> return calculatedFirExpression . toReturn ( baseSource = returnExpression . toFirSourceElement ( ) , labelName = labelName , fromKtReturnExpression = true ) <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseReturn
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitReturnExpression
 */


private fun convertThrow ( throwExpression : LighterASTNode ) : FirExpression

{ <EOL> var firExpression : FirExpression ? = null <EOL> throwExpression . forEachChildren { <EOL> if ( it . isExpression ( ) ) firExpression = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> return buildThrowExpression { <EOL> source = throwExpression . toFirSourceElement ( ) <EOL> exception = firExpression ? : buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseThrow
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitThrowExpression
 */


private fun convertThisExpression ( thisExpression : LighterASTNode ) : FirQualifiedAccessExpression

{ <EOL> val label : String ? = thisExpression . getLabelName ( ) <EOL> return buildThisReceiverExpression { <EOL> val sourceElement = thisExpression . toFirSourceElement ( ) <EOL> source = sourceElement <EOL> calleeReference = buildExplicitThisReference { <EOL> labelName = label <EOL> source = sourceElement . fakeElement ( KtFakeSourceElementKind . ReferenceInAtomicQualifiedAccess ) <EOL> } <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseThisExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitThisExpression
 */


private fun convertSuperExpression ( superExpression : LighterASTNode ) : FirQualifiedAccessExpression

{ <EOL> val label : String ? = superExpression . getLabelName ( ) <EOL> var superTypeRef : FirTypeRef = implicitType <EOL> superExpression . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> TYPE_REFERENCE -> superTypeRef = declarationBuilder . convertType ( it ) <EOL> } <EOL> } <EOL> return buildPropertyAccessExpression { <EOL> val sourceElement = superExpression . toFirSourceElement ( ) <EOL> source = sourceElement <EOL> calleeReference = buildExplicitSuperReference { <EOL> labelName = label <EOL> this . superTypeRef = superTypeRef <EOL> source = sourceElement . fakeElement ( KtFakeSourceElementKind . ReferenceInAtomicQualifiedAccess ) <EOL> } <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseSuperExpression
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.visitSuperExpression
 */


fun convertValueArguments ( valueArguments : LighterASTNode ) : List < FirExpression >

{ <EOL> return valueArguments . forEachChildrenReturnList { node , container -> <EOL> when ( node . tokenType ) { <EOL> VALUE_ARGUMENT -> container += convertValueArgument ( node ) <EOL> LAMBDA_EXPRESSION , <EOL> LABELED_EXPRESSION , <EOL> ANNOTATED_EXPRESSION , <EOL> -> container += getAsFirExpression < FirAnonymousFunctionExpression > ( node ) . apply { <EOL> @ OptIn ( RawFirApi :: class ) <EOL> replaceIsTrailingLambda ( newIsTrailingLambda = true ) <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseValueArgumentList
 */


private fun convertValueArgument ( valueArgument : LighterASTNode ) : FirExpression

{ <EOL> var identifier : String ? = null <EOL> var isSpread = false <EOL> var firExpression : FirExpression ? = null <EOL> valueArgument . forEachChildren { <EOL> when ( it . tokenType ) { <EOL> VALUE_ARGUMENT_NAME -> identifier = it . asText <EOL> MUL -> isSpread = true <EOL> STRING_TEMPLATE -> firExpression = convertStringTemplate ( it ) <EOL> is KtConstantExpressionElementType -> firExpression = convertConstantExpression ( it ) <EOL> else -> if ( it . isExpression ( ) ) firExpression = getAsFirExpression ( it , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> val calculatedFirExpression = <EOL> firExpression ? : buildErrorExpression ( null , ConeSyntaxDiagnostic ( "<STR_LIT>" ) ) <EOL> return when { <EOL> identifier != null -> buildNamedArgumentExpression { <EOL> source = valueArgument . toFirSourceElement ( ) <EOL> expression = calculatedFirExpression <EOL> this . isSpread = isSpread <EOL> name = identifier . nameAsSafeName ( ) <EOL> } <EOL> isSpread -> buildSpreadArgumentExpression { <EOL> source = valueArgument . toFirSourceElement ( ) <EOL> expression = calculatedFirExpression <EOL> } <EOL> else -> calculatedFirExpression <EOL> } <EOL> }

/**
 * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseValueArgument
 * @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.toFirExpression(org.jetbrains.kotlin.psi.ValueArgument)
 */


fun excludeUnused ( headerName : String ? ) : Boolean

/**
 * Whether unused declarations from given header should be excluded.
 *
 * @param headerName header path relative to the appropriate include path element (e.g. `time.h` or `curl/curl.h`),
 * or `null` for builtin declarations.
 */


fun excludeAll ( headerId : HeaderId ) : Boolean

/**
 * Whether all declarations from this header should be excluded.
 *
 * Note: the declarations from such headers can be actually present in the internal representation,
 * but not included into the root collections.
 */


fun buildNativeIndex ( library : NativeLibrary , verbose : Boolean ) : IndexerResult

= buildNativeIndexImpl ( library , verbose )

/**
 * Retrieves the definitions from given C header file using given compiler arguments (e.g. defines).
 */


public fun ColumnSet < * > . colsOfKind ( kind : ColumnKind , vararg others : ColumnKind , filter : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= <EOL> columnsOfKindInternal ( kinds = headPlusArray ( kind , others ) . toSet ( ) , filter = filter )

/**
 * @include [CommonColsOfKindDocs]
 * @set [CommonColsOfKindDocs.ExampleArg]
 *
 * `df.`[select][DataFrame.select]` { `[cols][ColumnsSelectionDsl.cols]` { it.`[name][ColumnReference.name]`.`[startsWith][String.startsWith]`("my") }.`[colsOfKind][ColumnSet.colsOfKind]`(`[Value][ColumnKind.Value]`, `[Frame][ColumnKind.Frame]`) }`
 *
 * `// NOTE: This can be shortened to just:`
 *
 * `df.`[select][DataFrame.select]` { `[colsOfKind][ColumnsSelectionDsl.colsOfKind]`(`[Value][ColumnKind.Value]`, `[Frame][ColumnKind.Frame]`) { it.`[name][ColumnReference.name]`.`[startsWith][String.startsWith]`("my") } }`
 */


public fun ColumnsSelectionDsl < * > . colsOfKind ( kind : ColumnKind , vararg others : ColumnKind , filter : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= <EOL> asSingleColumn ( ) . columnsOfKindInternal ( kinds = headPlusArray ( kind , others ) . toSet ( ) , filter = filter )

/**
 * @include [CommonColsOfKindDocs]
 * @set [CommonColsOfKindDocs.ExampleArg]
 *
 * `df.`[select][DataFrame.select]` { `[colsOfKind][ColumnsSelectionDsl.colsOfKind]`(`[Value][ColumnKind.Value]`, `[Frame][ColumnKind.Frame]`) { it.`[name][ColumnReference.name]`.`[startsWith][String.startsWith]`("my") } }`
 */


public fun SingleColumn < DataRow < * > > . colsOfKind ( kind : ColumnKind , vararg others : ColumnKind , filter : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= <EOL> this . ensureIsColumnGroup ( ) . columnsOfKindInternal ( kinds = headPlusArray ( kind , others ) . toSet ( ) , filter = filter )

/**
 * @include [CommonColsOfKindDocs]
 * @set [CommonColsOfKindDocs.ExampleArg]
 *
 * `df.`[select][DataFrame.select]` { myColumnGroup.`[colsOfKind][SingleColumn.colsOfKind]`(`[Value][ColumnKind.Value]`, `[Frame][ColumnKind.Frame]`) }`
 */


public fun String . colsOfKind ( kind : ColumnKind , vararg others : ColumnKind , filter : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= <EOL> columnGroup ( this ) . colsOfKind ( kind , * others , filter = filter )

/**
 * @include [CommonColsOfKindDocs]
 * @set [CommonColsOfKindDocs.ExampleArg]
 *
 * `df.`[select][DataFrame.select]` { "myColumnGroup".`[colsOfKind][SingleColumn.colsOfKind]`(`[Value][ColumnKind.Value]`, `[Frame][ColumnKind.Frame]`) }`
 */


public fun KProperty < * > . colsOfKind ( kind : ColumnKind , vararg others : ColumnKind , filter : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

/**
 * @include [CommonColsOfKindDocs]
 * @set [CommonColsOfKindDocs.ExampleArg]
 *
 * `df.`[select][DataFrame.select]` { Type::myColumnGroup.`[colsOfKind][KProperty.colsOfKind]`(`[Value][ColumnKind.Value]`, `[Frame][ColumnKind.Frame]`) }`
 */


public fun ColumnPath . colsOfKind ( kind : ColumnKind , vararg others : ColumnKind , filter : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

/**
 * @include [CommonColsOfKindDocs]
 * @set [CommonColsOfKindDocs.ExampleArg]
 *
 * `df.`[select][DataFrame.select]` { "pathTo"["myColumnGroup"].`[colsOfKind][ColumnPath.colsOfKind]`(`[Value][ColumnKind.Value]`, `[Frame][ColumnKind.Frame]`) }`
 */


internal fun ColumnsResolver < * > . columnsOfKindInternal ( kinds : Set < ColumnKind > , filter : ColumnFilter < * > , ) : TransformableColumnSet < * >

= colsInternal { <EOL> it . kind ( ) in kinds && filter ( it ) <EOL> }

/**
 * Returns a TransformableColumnSet containing the columns of given kind(s) that satisfy the given filter.
 *
 * @param filter The filter function to apply on each column. Must accept a ColumnWithPath object and return a Boolean.
 * @return A [TransformableColumnSet] containing the columns of given kinds that satisfy the filter.
 */


fun Project . checkExpectedGradlePropertyValues ( )

{ <EOL> val expectSuffix = "<STR_LIT>" <EOL> val expectKeys = properties . keys . filter { it . endsWith ( expectSuffix ) } <EOL> val issues = expectKeys . mapNotNull { expectKey -> <EOL> val actualKey = expectKey . removeSuffix ( expectSuffix ) <EOL> val expectedValue = properties [ expectKey ] ? . toString ( ) ? : return@mapNotNull null <EOL> if ( ! properties . containsKey ( actualKey ) ) <EOL> return@mapNotNull MissingProperty ( actualKey , expectedValue ) <EOL> val actualValue = properties [ actualKey ] . toString ( ) <EOL> if ( expectedValue != actualValue ) <EOL> return@mapNotNull UnexpectedPropertyValue ( actualKey , expectedValue , actualValue ) <EOL> null <EOL> } . toSet ( ) <EOL> if ( issues . isEmpty ( ) ) { <EOL> return <EOL> } <EOL> val unexpectedPropertyValues = issues . filterIsInstance < UnexpectedPropertyValue > ( ) <EOL> val missingProperties = issues . filterIsInstance < MissingProperty > ( ) <EOL> throw IllegalArgumentException ( buildString { <EOL> if ( unexpectedPropertyValues . isNotEmpty ( ) ) { <EOL> appendLine ( "<STR_LIT>" ) <EOL> unexpectedPropertyValues . forEach { issue -> <EOL> appendLine ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> if ( missingProperties . isNotEmpty ( ) ) { <EOL> if ( unexpectedPropertyValues . isNotEmpty ( ) ) appendLine ( ) <EOL> appendLine ( "<STR_LIT>" ) <EOL> missingProperties . forEach { issue -> <EOL> appendLine ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } ) <EOL> }

/**
 * Mechanism to warn developers when a given Gradle property does not match the developer's expectation.
 *
 * There may be some Gradle properties, that are defined in the project and will change over time (e.g. defaultSnapshotVersion).
 * Some developers (and QA) will need to be very clear about the value of this property.
 *
 * In order to get notified about the value of the property changing, it is possible to define the same property in
 * ~/.gradle/gradle.properties with a given `.kotlin_build.expected_value` suffix to ensure the value.
 *
 * e.g. if a developer set's
 *
 * `defaultSnapshotVersion.kotlin_build.expected_value=1.6.255-SNAPSHOT` and the value gets bumped to `2.0.255-SNAPSHOT` after pulling from master,
 * the developer will notice this during project configuration phase.
 */


public fun extensionReceiverType ( type : ConeKotlinType )

{ <EOL> extensionReceiverType { type } <EOL> }

/**
 * Sets [type] as extension receiver type of constructed property
 */


public fun extensionReceiverType ( typeProvider : ( List < FirTypeParameter > ) -> ConeKotlinType )

{ <EOL> extensionReceiverTypeProvider = typeProvider <EOL> }

/**
 * Sets type, provided by [typeProvider], as extension receiver type of constructed property
 *
 * Use this overload when extension receiver type uses type parameters of constructed property
 */


public fun setter ( visibility : Visibility )

{ <EOL> setterVisibility = visibility <EOL> }

/**
 * Declares [visibility] of property setter if property marked as var
 * If this function is not called then setter will have same visibility
 * as property itself
 */


public fun FirExtension . createMemberProperty ( owner : FirClassSymbol < * > , key : GeneratedDeclarationKey , name : Name , returnType : ConeKotlinType , isVal : Boolean = true , hasBackingField : Boolean = true , config : PropertyBuildingContext . ( ) -> Unit = { } ) : FirProperty

{ <EOL> return createMemberProperty ( owner , key , name , { returnType } , isVal , hasBackingField , config ) <EOL> }

/**
 * Creates a member property for [owner] class with [returnType] return type
 */


public fun FirExtension . createMemberProperty ( owner : FirClassSymbol < * > , key : GeneratedDeclarationKey , name : Name , returnTypeProvider : ( List < FirTypeParameterRef > ) -> ConeKotlinType , isVal : Boolean = true , hasBackingField : Boolean = true , config : PropertyBuildingContext . ( ) -> Unit = { } ) : FirProperty

{ <EOL> val callableId = CallableId ( owner . classId , name ) <EOL> return PropertyBuildingContext ( session , key , owner , callableId , returnTypeProvider , isVal , hasBackingField ) . apply ( config ) . apply { <EOL> status { <EOL> isExpect = owner . isExpect <EOL> } <EOL> } . build ( ) <EOL> }

/**
 * Creates a member property for [owner] class with return type provided by [returnTypeProvider]
 * Use this overload when those types use type parameters of constructed property
 */


@ ExperimentalTopLevelDeclarationsGenerationApi <EOL> public fun FirExtension . createTopLevelProperty ( key : GeneratedDeclarationKey , callableId : CallableId , returnType : ConeKotlinType , isVal : Boolean = true , hasBackingField : Boolean = true , config : PropertyBuildingContext . ( ) -> Unit = { } ) : FirProperty

{ <EOL> return createTopLevelProperty ( key , callableId , { returnType } , isVal , hasBackingField , config ) <EOL> }

/**
 * Creates a top-level property class with [returnType] return type
 *
 * If you create top-level extension property don't forget to set [hasBackingField] to false,
 * since such properties never have backing fields
 */


@ ExperimentalTopLevelDeclarationsGenerationApi <EOL> public fun FirExtension . createTopLevelProperty ( key : GeneratedDeclarationKey , callableId : CallableId , returnTypeProvider : ( List < FirTypeParameterRef > ) -> ConeKotlinType , isVal : Boolean = true , hasBackingField : Boolean = true , config : PropertyBuildingContext . ( ) -> Unit = { } ) : FirProperty

{ <EOL> require ( callableId . classId == null ) <EOL> return PropertyBuildingContext ( session , key , owner = null , callableId , returnTypeProvider , isVal , hasBackingField ) . apply ( config ) . build ( ) <EOL> }

/**
 * Creates a top-level property with return type provided by [returnTypeProvider]
 *
 * If you create top-level extension property don't forget to set [hasBackingField] to false,
 * since such properties never have backing fields
 *
 * Use this overload when those types use type parameters of constructed property
 */


private fun createWebpackConfig ( forNpmDependencies : Boolean = false )

= KotlinWebpackConfig ( npmProjectDir = npmProjectDir , mode = mode , entry = if ( forNpmDependencies ) null else entry . get ( ) . asFile , output = output , outputPath = if ( forNpmDependencies ) null else outputDirectory . getOrNull ( ) ? . asFile , outputFileName = mainOutputFileName . get ( ) , configDirectory = configDirectory , rules = rules , devServer = devServerProperty . orNull , devtool = devtool , sourceMaps = sourceMaps , resolveFromModulesFirst = resolveFromModulesFirst , )

/**
 * [forNpmDependencies] is used to avoid querying [outputDirectory] before task execution.
 * Otherwise, Gradle will fail the build.
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun < T > Array < out T > . elementAt ( index : Int ) : T

{ <EOL> return get ( index ) <EOL> }

/**
 * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.
 *
 * @sample samples.collections.Collections.Elements.elementAt
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun ByteArray . elementAt ( index : Int ) : Byte

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun ShortArray . elementAt ( index : Int ) : Short

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun IntArray . elementAt ( index : Int ) : Int

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun LongArray . elementAt ( index : Int ) : Long

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun FloatArray . elementAt ( index : Int ) : Float

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun DoubleArray . elementAt ( index : Int ) : Double

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun BooleanArray . elementAt ( index : Int ) : Boolean

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun CharArray . elementAt ( index : Int ) : Char

{ <EOL> return get ( index ) <EOL> }


public actual fun < T > Array < out T > . asList ( ) : List < T >

{ <EOL> return object : AbstractList < T > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : T ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : T = this@asList [ index ] <EOL> override fun indexOf ( element : T ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : T ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }

/**
 * Returns a [List] that wraps the original array.
 */


public actual fun ByteArray . asList ( ) : List < Byte >

{ <EOL> return object : AbstractList < Byte > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Byte ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Byte = this@asList [ index ] <EOL> override fun indexOf ( element : Byte ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Byte ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun ShortArray . asList ( ) : List < Short >

{ <EOL> return object : AbstractList < Short > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Short ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Short = this@asList [ index ] <EOL> override fun indexOf ( element : Short ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Short ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun IntArray . asList ( ) : List < Int >

{ <EOL> return object : AbstractList < Int > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Int ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Int = this@asList [ index ] <EOL> override fun indexOf ( element : Int ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Int ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun LongArray . asList ( ) : List < Long >

{ <EOL> return object : AbstractList < Long > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Long ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Long = this@asList [ index ] <EOL> override fun indexOf ( element : Long ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Long ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun FloatArray . asList ( ) : List < Float >

{ <EOL> return object : AbstractList < Float > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Float ) : Boolean = this@asList . any { it . toBits ( ) == element . toBits ( ) } <EOL> override fun get ( index : Int ) : Float = this@asList [ index ] <EOL> override fun indexOf ( element : Float ) : Int = this@asList . indexOfFirst { it . toBits ( ) == element . toBits ( ) } <EOL> override fun lastIndexOf ( element : Float ) : Int = this@asList . indexOfLast { it . toBits ( ) == element . toBits ( ) } <EOL> } <EOL> }


public actual fun DoubleArray . asList ( ) : List < Double >

{ <EOL> return object : AbstractList < Double > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Double ) : Boolean = this@asList . any { it . toBits ( ) == element . toBits ( ) } <EOL> override fun get ( index : Int ) : Double = this@asList [ index ] <EOL> override fun indexOf ( element : Double ) : Int = this@asList . indexOfFirst { it . toBits ( ) == element . toBits ( ) } <EOL> override fun lastIndexOf ( element : Double ) : Int = this@asList . indexOfLast { it . toBits ( ) == element . toBits ( ) } <EOL> } <EOL> }


public actual fun BooleanArray . asList ( ) : List < Boolean >

{ <EOL> return object : AbstractList < Boolean > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Boolean ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Boolean = this@asList [ index ] <EOL> override fun indexOf ( element : Boolean ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Boolean ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun CharArray . asList ( ) : List < Char >

{ <EOL> return object : AbstractList < Char > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Char ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Char = this@asList [ index ] <EOL> override fun indexOf ( element : Char ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Char ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual infix fun < T > Array < out T > . contentDeepEquals ( other : Array < out T > ) : Boolean

{ <EOL> return this . contentDeepEquals ( other ) <EOL> }

/**
 * Checks if the two specified arrays are *deeply* equal to one another.
 *
 * Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal.
 * That is, if two corresponding elements are nested arrays, they are also compared deeply.
 * Elements of other types are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * If any of the arrays contain themselves at any nesting level, the behavior is undefined.
 *
 * @param other the array to compare deeply with this array.
 * @return `true` if the two arrays are deeply equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun < T > Array < out T > ? . contentDeepEquals ( other : Array < out T > ? ) : Boolean

{ <EOL> return contentDeepEqualsImpl ( other ) <EOL> }

/**
 * Checks if the two specified arrays are *deeply* equal to one another.
 *
 * Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal.
 * That is, if two corresponding elements are nested arrays, they are also compared deeply.
 * Elements of other types are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered deeply equal if both are `null`.
 *
 * If any of the arrays contain themselves at any nesting level, the behavior is undefined.
 *
 * @param other the array to compare deeply with this array.
 * @return `true` if the two arrays are deeply equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepEquals
 */


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual fun < T > Array < out T > . contentDeepHashCode ( ) : Int

{ <EOL> return this . contentDeepHashCode ( ) <EOL> }

/**
 * Returns a hash code based on the contents of this array as if it is [List].
 * Nested arrays are treated as lists too.
 *
 * If any of arrays contains itself on any nesting level the behavior is undefined.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentDeepHashCode ( ) : Int

{ <EOL> return contentDeepHashCodeImpl ( ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual fun < T > Array < out T > . contentDeepToString ( ) : String

{ <EOL> return this . contentDeepToString ( ) <EOL> }

/**
 * Returns a string representation of the contents of this array as if it is a [List].
 * Nested arrays are treated as lists too.
 *
 * If any of arrays contains itself on any nesting level that reference
 * is rendered as `"[...]"` to prevent recursion.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepToString
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentDeepToString ( ) : String

{ <EOL> return contentDeepToStringImpl ( ) <EOL> }


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun < T > Array < out T > . contentEquals ( other : Array < out T > ) : Boolean

{ <EOL> return this . contentEquals ( other ) <EOL> }

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * If the arrays contain nested arrays, use [contentDeepEquals] to recursively compare their elements.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.arrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun ByteArray . contentEquals ( other : ByteArray ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.intArrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun ShortArray . contentEquals ( other : ShortArray ) : Boolean


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun IntArray . contentEquals ( other : IntArray ) : Boolean


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun LongArray . contentEquals ( other : LongArray ) : Boolean


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun FloatArray . contentEquals ( other : FloatArray ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * This means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.doubleArrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun DoubleArray . contentEquals ( other : DoubleArray ) : Boolean


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun BooleanArray . contentEquals ( other : BooleanArray ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.booleanArrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun CharArray . contentEquals ( other : CharArray ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.charArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun < T > Array < out T > ? . contentEquals ( other : Array < out T > ? ) : Boolean

{ <EOL> if ( this === other ) return true <EOL> if ( this === null || other === null ) return false <EOL> if ( size != other . size ) return false <EOL> for ( i in indices ) { <EOL> if ( this [ i ] != other [ i ] ) return false <EOL> } <EOL> return true <EOL> }

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * If the arrays contain nested arrays, use [contentDeepEquals] to recursively compare their elements.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.arrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun ByteArray ? . contentEquals ( other : ByteArray ? ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.intArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun ShortArray ? . contentEquals ( other : ShortArray ? ) : Boolean


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun IntArray ? . contentEquals ( other : IntArray ? ) : Boolean


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun LongArray ? . contentEquals ( other : LongArray ? ) : Boolean


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun FloatArray ? . contentEquals ( other : FloatArray ? ) : Boolean

{ <EOL> if ( this === other ) return true <EOL> if ( this === null || other === null ) return false <EOL> if ( size != other . size ) return false <EOL> for ( i in indices ) { <EOL> if ( ! this [ i ] . equals ( other [ i ] ) ) return false <EOL> } <EOL> return true <EOL> }

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * This means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.doubleArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun DoubleArray ? . contentEquals ( other : DoubleArray ? ) : Boolean


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun BooleanArray ? . contentEquals ( other : BooleanArray ? ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.booleanArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun CharArray ? . contentEquals ( other : CharArray ? ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.charArrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun < T > Array < out T > . contentHashCode ( ) : Int

{ <EOL> return this . contentHashCode ( ) <EOL> }

/**
 * Returns a hash code based on the contents of this array as if it is [List].
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun ByteArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun ShortArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun IntArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun LongArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun FloatArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun DoubleArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun BooleanArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun CharArray . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentHashCode ( ) : Int

{ <EOL> if ( this === null ) return <NUM_LIT:0> <EOL> var result = <NUM_LIT:1> <EOL> for ( element in this ) <EOL> result = <NUM_LIT:31> * result + element . hashCode ( ) <EOL> return result <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ByteArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ShortArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun IntArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun LongArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun FloatArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun DoubleArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun BooleanArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun CharArray ? . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun < T > Array < out T > . contentToString ( ) : String

{ <EOL> return this . contentToString ( ) <EOL> }

/**
 * Returns a string representation of the contents of the specified array as if it is [List].
 *
 * @sample samples.collections.Arrays.ContentOperations.contentToString
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun ByteArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun ShortArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun IntArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun LongArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun FloatArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun DoubleArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun BooleanArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun CharArray . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentToString ( ) : String

{ <EOL> return this ? . joinToString ( "<STR_LIT:U+002CU+0020>" , "<STR_LIT:[>" , "<STR_LIT:]>" ) ? : "<STR_LIT:null>" <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ByteArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ShortArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun IntArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun LongArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun FloatArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun DoubleArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun BooleanArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun CharArray ? . contentToString ( ) : String