Skip to content

[Core] Add if/else conditional execution #13

@jbatte47

Description

@jbatte47

Problem

Without conditionals, Sigil cannot express branching computation and cannot progress toward a general computational core.

This issue adds first-class conditional execution.

Scope

Deliverables

  • Grammar productions for if/else.
  • AST node(s) and runtime evaluation logic.
  • Tests for true branch, false branch, and nested conditions.

Acceptance Criteria

  • Conditional blocks execute correct branch based on expression result.
  • Existing scripts continue to parse/execute.
  • Parser conflicts are not reintroduced.

Validation Checklist

  • Add parser fixtures for indentation and inline/blocked forms (if supported).
  • Add runtime branch tests with deterministic outputs.
  • Run full examples suite.

Non-goals

  • Looping constructs.
  • Advanced pattern matching.
  • Module/import redesign.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions