Fix: properly between always behaved as plain between#1704
Conversation
visitBetweenExpression checked ctx.getChild(0).text == "properly" but child 0 is always the expression (per grammar rule `expression 'properly'? 'between' expressionTerm 'and' expressionTerm`). The keyword is at child index 1 when present. This meant isProper was always false, so `properly between` emitted GreaterOrEqual/LessOrEqual instead of Greater/Less. Fix: change getChild(0) to getChild(1). Add regression test ProperlyBetweenTest verifying: - `between` emits And(GreaterOrEqual, LessOrEqual) - `properly between` emits And(Greater, Less) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Related IssuesThe following open issues may be related to this PR:
|
|
Formatting check succeeded! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1704 +/- ##
=========================================
Coverage 61.97% 61.97%
Complexity 3940 3940
=========================================
Files 210 210
Lines 20366 20366
Branches 3879 3879
=========================================
Hits 12621 12621
Misses 6138 6138
Partials 1607 1607 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
c-schuler
left a comment
There was a problem hiding this comment.
Nice! The only suggestion I have is to include a test for the interval path, but not a blocker for approval.
Something like:
define TestIntervalProperlyBetween: Interval[1, 5] properly between Interval[0, 3] and Interval[4, 10]
The properly-between fix (PR #1704) was merged to main, so the legacy translator now correctly emits Greater/Less for `properly between`. Update the new pipeline to match instead of replicating the old bug. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The properly-between fix (PR #1704) was merged to main, so the legacy translator now correctly emits Greater/Less for `properly between`. Update the new pipeline to match instead of replicating the old bug. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


Summary
visitBetweenExpressioncheckedctx.getChild(0).text == "properly"but child 0 is always the expression per the grammar ruleexpression 'properly'? 'between' expressionTerm 'and' expressionTerm. The keyword is at child index 1 when present, soisProperwas always false.properly betweenemittedAnd(GreaterOrEqual, LessOrEqual)instead ofAnd(Greater, Less)— identical to plainbetween.getChild(0)→getChild(1)inCql2ElmVisitor.kt:1403.Test plan
ProperlyBetweenTestregression test verifying:betweenemitsAnd(GreaterOrEqual, LessOrEqual)properly betweenemitsAnd(Greater, Less)🤖 Generated with Claude Code