Skip to content

org.jetbrains.kotlin.psi.utils

Types

OperatorTokens

Maps between Kotlin operator tokens and the operator-convention function names they desugar to (for example, + maps to plus), and groups the operator tokens by category (unary, binary, assignment, comparison, and so on).

Functions

hasFloatNumericLiteralSuffix

Checks whether the text representation of a number literal has a float number suffix.

hasIllegallyPositionedUnderscore

fun hasIllegallyPositionedUnderscore(text: String, isFloatingPoint: Boolean): Boolean

Checks whether the given text contains an underscore in an illegal position. Underscores are allowed only between digits, not at the beginning or end of the number or one of its parts.

hasLongNumericLiteralSuffix

Checks whether the text representation of a number literal has a long number suffix.

hasUnsignedLongNumericLiteralSuffix

Checks whether the text representation of a number literal has both a long and an unsigned number suffix.

hasUnsignedNumericLiteralSuffix

Checks whether the text representation of a number literal has an unsigned number suffix.

parseBooleanLiteral

Converts the given text, either true or false, to a boolean value.

parseNumericLiteral

fun parseNumericLiteral(text: String, isFloatingPointLiteral: Boolean): Number?

Parses the text representation of a number literal into a Number instance.

toConstantExpressionElementType

Converts the given ConstantValueKind to the corresponding com.intellij.psi.tree.IElementType.