← Back to issue list

`for` grammar: support `else on` and `else for`

View original Github issue

Metadata

Project
craft-grammar
Number
#125
Type
issue
State
open
Author
lengau
Labels
Type: Enhancement Status: Triaged
Created
Updated
Closed

Current evaluation

Enhancement to support `else on` and `else for` statements in the `for` grammar, extending the existing `else` clause. Triaged by maintainer and tracked in Jira (CRAFT-4744); not yet implemented in the processor.

Suggested action: keep open

Reason: Triaged enhancement (Status: Triaged label, authored by maintainer lengau) with an internal Jira ticket CRAFT-4744, indicating active tracking. The requested `else on`/`else for` syntax is not yet implemented — `_processor.py` only defines `_ELSE_CLAUSE_PATTERN` (bare `else`) and `_ELSE_FAIL_PATTERN`, and `_handle_else` only attaches to `on`/`try` — so it remains a valid open feature, not stale-irrelevant.

Impact: 42 Quick Win: 18.9 Staleness: 60 Complexity: 55 Confidence: 78 Support Request: 5

Issue body

We should support `else on` and `else for` statements in `for` grammar. Example usage: ```yaml build-packages: - for raspi: - on arm64: - gcc - else: - gcc-aarch64-linux-gnu - else for pc: - on amd64: - gcc - else: - gcc-x86-64-linux-gnu ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 42
Quick Win: 18.9
Staleness: 60
Complexity: 55
Confidence: 78
Support Request: 5
keep open Enhancement to support `else on` and `else for` statements in the `for` grammar, extending the existing `else` clause. Triaged by maintainer and tracked in Jira (CRAFT-4744); not yet implemented in the processor.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 40
Confidence: 80
Support Request: 0
keep open Enhancement to add else on and else for syntax to the for grammar for conditional package building. Triaged and synced to internal Jira, but inactive for over a year with no implementation progress.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 40
Confidence: 80
Support Request: 5
keep open Enhancement to add else on and else for syntax to the for grammar for conditional package building. Currently triaged and awaiting implementation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 40
Confidence: 65
Support Request: 10
keep open Enhance the for grammar to support else on and else for conditional statements. Triaged and linked to internal ticket CRAFT-4744. Awaiting implementation or assignment.

Update history

No update history recorded yet.

Related work

  • Related To: craft-grammar#134 (confidence 70%)

    Prior issue for basic `else` in the for grammar; closed and the base `else` clause was implemented in PR #137. This issue extends that to `else on`/`else for`, so it is related but not a duplicate.

Related issues

Issue Project State Summary Similarity
#134 `for` grammar: support `else` statement craft-grammar closed Closed without implementation. No resolution or merge details were provided. The enhancement to add an else statement to the for grammar appears abandoned after initial triage and Jira synchronization.
82%
#137 feat(for-grammar): add an 'else' clause craft-grammar merged Merged. Adds an else clause to the for grammar, matching to grammar behavior without recursive processing. Approved by two reviewers, passed CI checks, and resolves #134 and CRAFT-4768.
76%