Skip to content

Add iterable for loops #31

Description

@itsfuad

Goal

Add direct iterable for loops after existing conditional and infinite-loop foundations.

Delivered

  • Range iteration with exclusive bounds and deterministic common integral typing.
  • Fixed-array, dynamic-array, and slice-view iteration.
  • Value-only and index-plus-value binding forms.
  • Target-usize sequence cursors and exposed indexes.
  • Loop-lifetime shared sequence borrows with move, mutation, return, break, and continue safety.
  • Canonical CFG init/header/body/latch/exit topology with definite-entry evidence for provably non-empty ranges.
  • Structured HIR segments, MIR block-origin execution, exact cfg.SiteID cleanup, and LLVM lowering.
  • Malformed-header recovery and valid-only semantic iteration evidence.
  • Positive and negative source fixtures plus 386/amd64 backend validation.

Pull request

Deferred

User-defined iterator protocol and optional-based next contracts remain separate work in #123. Direct arrays and slices stay statically lowered; no dynamic iterator dispatch was added here.

Validation

  • Full uncached Go suite.
  • Fresh bundled compiler.
  • Full uncached x_test fixture suite.
  • Linux 386 and amd64 LLVM validation through target clang.
  • Diff and artifact checks.

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

    enhancementNew feature or requestlanguage-modelPeeper language model, ownership, pointer, optional, array/slice work

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions