WhenExpression

data class WhenExpression(val whenKeyword: Node.Keyword.When, val subject: Node.Expression.WhenExpression.WhenSubject?, val branches: List<Node.Expression.WhenExpression.WhenBranch>, val supplement: NodeSupplement = NodeSupplement()) : Node.Expression

AST node that represents a when expression. The node corresponds to KtWhenExpression.

Constructors

Link copied to clipboard
constructor(whenKeyword: Node.Keyword.When, subject: Node.Expression.WhenExpression.WhenSubject?, branches: List<Node.Expression.WhenExpression.WhenBranch>, supplement: NodeSupplement = NodeSupplement())

Types

Link copied to clipboard

AST node that represents a when branch with conditions.

Link copied to clipboard
data class ElseWhenBranch(val arrow: Node.Keyword.Arrow, val body: Node.Expression, val supplement: NodeSupplement = NodeSupplement()) : Node.Expression.WhenExpression.WhenBranch

AST node that represents a when branch with else keyword.

Link copied to clipboard
data class ExpressionWhenCondition(val expression: Node.Expression, val supplement: NodeSupplement = NodeSupplement()) : Node.Expression.WhenExpression.WhenCondition

AST node that represents a when condition using expression. The node corresponds to KtWhenConditionWithExpression.

Link copied to clipboard

AST node that represents a when condition using range. The node corresponds to KtWhenConditionInRange.

Link copied to clipboard

AST node that represents a when condition using type. The node corresponds to KtWhenConditionIsPattern.

Link copied to clipboard
interface WhenBranch : Node

Common interface for when branches. The node corresponds to KtWhenEntry.

Link copied to clipboard
interface WhenCondition : Node

Common interface for when conditions. The node corresponds to KtWhenCondition.

Link copied to clipboard

Common interface for when condition operators.

Link copied to clipboard

Common interface for when condition range operators.

Link copied to clipboard

Common interface for when condition type operators.

Link copied to clipboard
data class WhenSubject(val lPar: Node.Keyword.LPar, val annotationSets: List<Node.Modifier.AnnotationSet>, val variable: Node.Variable?, val expression: Node.Expression, val rPar: Node.Keyword.RPar, val supplement: NodeSupplement = NodeSupplement()) : Node, Node.WithAnnotationSets

AST node that represents a subject of when expression. The node corresponds to a part of KtWhenExpression.

Properties

Link copied to clipboard
Link copied to clipboard

subject of when expression if exists, otherwise null.

Link copied to clipboard
open override val supplement: NodeSupplement

Supplemental data for the node.

Link copied to clipboard

keyword of when expression.