SIGN IN SIGN UP

Parse compact Lark tilde repeat ranges (#378)

## Summary

Handle compact Lark tilde ranges such as `HI~0..2`.

The generic number lexeme accepts a trailing decimal point, so the
greedy lexer tokenizes the start of a compact repeat range as
`Number("0.")` followed by `Dot`. The parser then tries to parse `0.` as
an integer and fails.

Normalize that specific token sequence only when it follows `~`: trim
the number's trailing dot and turn the adjacent `Dot` into `DotDot`.
Standalone floating-point literals retain their existing behavior.

## Validation

- Reproduced the failure on current `main` before the fix.
- Added an end-to-end regression case for `HI~0..2`.
- `cargo +stable fmt --check`
- `cargo +stable test -p llguidance --test test_lark test_repeat -j 1`
- `cargo +stable test -p llguidance --test test_lark -j 1` — 39 passed
- `cargo +stable clippy -p llguidance --all-targets --all-features -- -D
warnings`
- `cargo +stable check --no-default-features -p llguidance`

The recommended workspace-wide Clippy command was also attempted. On
this host's stable Rust 1.93 it stops in the unchanged `json_stats`
package because `clippy::manual_checked_ops` is reported as an unknown
lint; the affected `llguidance` package passes Clippy independently.

Fixes #226

AI assistance: This change was implemented with OpenAI Codex and
independently reviewed and validated before submission.
S
Silu Panda committed
bae21e505859b9a338b7aeefaa8a64319ba41831
Parent: 8246ba8
Committed by GitHub <noreply@github.com> on 9/4/2026, 7:09:28 PM