IfNode constructor

IfNode(
  1. Node<dynamic, LangVal<LangType>> condition,
  2. BlockNode thenBlock, [
  3. Node? elseBlock
])

Constructs an if statement with condition, then-block, and optional else-block.

Parameters:

  • condition: Expression that evaluates to the condition (0 = false, non-zero = true)
  • thenBlock: Block of statements to execute if condition is true
  • elseBlock: Optional block of statements to execute if condition is false

Implementation

IfNode(Node<dynamic, LangVal> condition, BlockNode thenBlock,
    [Node? elseBlock])
    : super(null, [condition, thenBlock, if (elseBlock != null) elseBlock]);