From 085c1dfa088680bcd6893650916a5fc0bf06dec9 Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Sat, 22 Aug 2026 15:29:31 -0700 Subject: [PATCH] Mark the backwards-range divergence with a ponytail: prefix This repo's convention is that deliberate divergences from the reference are found with `grep ponytail:`. The implicit-step gate in applyRange is one -- the reference warns for [5:1:0] and [0:-1:5] too, and we deliberately do not -- but it was only discoverable by reading the function. Comment-only. No version bump: nothing in the built artifact changes. Co-Authored-By: Claude Opus 5 (1M context) --- src/expr_eval.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/expr_eval.cpp b/src/expr_eval.cpp index e8b7bb5..db46a63 100644 --- a/src/expr_eval.cpp +++ b/src/expr_eval.cpp @@ -309,12 +309,14 @@ Value Evaluator::applyRange(const Value& startV, const Value& endV, const Value& // here, at construction, because that is where the reference reports it: // `r = [5:0];` warns even if nothing ever iterates r. // - // Only an IMPLICIT step is checked. Writing the step out is taken as - // deliberate, so [5:1:0] and [0:-1:5] stay silent -- a deliberate - // divergence from the reference, which warns for those too. An implicit - // step is always exactly 1, so the reference's other wording ("begin is - // smaller than the end, but step is negative") cannot arise here and no - // longer exists in this port. + // ponytail: only an IMPLICIT step is checked -- a deliberate divergence + // from the reference, which warns for [5:1:0] and [0:-1:5] as well. + // Writing the step out is taken as a statement of intent; the warning is + // for the author who wrote [5:0] meaning [5:-1:0] and got a silent empty + // loop. An implicit step is always exactly 1, so the reference's other + // wording ("begin is smaller than the end, but step is negative") cannot + // arise here and no longer exists in this port -- if it is ever needed + // again, this gate has been widened back to explicit steps. // // The epsilon matches the one the iteration path used before this check // moved here, so a range built from float arithmetic that lands a hair