Skip to content

Feature: add if/else conditional blocks #7

Description

@nholthaus

Problem

The scripting language supports counted loops, but it does not support conditional branching. This prevents scripts from expressing runtime decisions and forces control flow to remain linear.

Specification

Add support for conditional blocks in script files.

Acceptance criteria:

  • Scripts can begin a conditional block with an if statement.
  • Scripts can optionally provide an else branch.
  • Scripts can terminate the conditional with a matching end_if marker.
  • The condition can compare two operands using a small built-in comparison vocabulary.
  • Nested control-flow blocks remain parseable and unambiguous.
  • Invalid operators or unmatched blocks fail with a clear error message.

Motivation

This would enable scripts to branch based on runtime state instead of only executing fixed sequences of commands.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions