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.
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:
ifstatement.elsebranch.end_ifmarker.Motivation
This would enable scripts to branch based on runtime state instead of only executing fixed sequences of commands.