ShakeIf

Represents an 'if' statement in the Shake language. An 'if' statement is a conditional statement that executes a block of code based on the evaluation of a condition.

Since

0.1.0

Inheritors

Properties

Link copied to clipboard
abstract val body: ShakeCode

The block of code to be executed if the condition is true.

Link copied to clipboard
abstract val condition: ShakeValue

The condition that determines whether the 'if' block or the 'else' block (if present) should be executed. This is a value that should evaluate to a boolean.

Link copied to clipboard
abstract val elseBody: ShakeCode?

The block of code to be executed if the condition is false. This is optional and may be null if no 'else' block is present.

Functions

Link copied to clipboard
abstract fun toJson(): Map<String, Any?>

Converts this statement to a JSON representation. This can be useful for serialization, debugging, or analyzing the structure of the code.