Repository navigation
fix(yq): an explicit !!int 08 keeps its integer across the reindex bridge - #6936
Conversation
…idge (#6927) The bridge wrote the integer 8 of `!!int 08` and the float 8.0 of a plain `08` under the same spelling token, and its reader reads the text 08 as the float. The integer now crosses under its own token (leading 5, the spelling token's is 6) and decodes back to the integer literal. The #6899 pin test and the limitations entry for the residual are removed. Fixes #6927
CoverageTotal: 92.98% ⚪ 0 pp vs Comparing No per-file coverage changes vs 🔇 0 ignored region(s), 682 tolerated region(s)
642 more not shown: the full report is in the Touched files absent from every coverage report (3)
These files may contain no executable code or may have been omitted from the coverage run. Patch coveragePatch: 96.61% (57/59 new lines covered)
Uncovered new lines (2)
|
CoverageTotal: 93.03% ⚪ 0 pp vs Comparing No per-file coverage changes vs 🔇 0 ignored region(s), 681 tolerated region(s)
641 more not shown: the full report is in the Touched files absent from every coverage report (3)
These files may contain no executable code or may have been omitted from the coverage run. Patch coveragePatch: 96.61% (57/59 new lines covered)
Uncovered new lines (2)
|
Summary
8.0of a plain08and the integer8of an explicit!!int 08. The reindex bridge wrote both under the same spelling token, and its reader (rightly, since yq: a zero-padded decimal with an 8 or 9 (08,0018,-09) is a !!float in yq, a !!int here #6866) reads the text08as the float, sok: !!int 08printed{"k":8.0}under.zz = 1,.k = .k,with_entries(.)and intojson.5; the spelling token's is6), decoded back to the integer literal.bridge_spelling()returns the text for either, so every other reader of the spelling (length,as_f64,number_literal) is unchanged.an_explicit_int_08_becomes_a_float_across_the_bridge_until_6927) and the limitations entry for the residual are removed; its four rows plus four more join the passing rows intests/yq_cli/i6899.rs.Fixes #6927
Test plan
cargo test --features cli,simd,regex,serde(full suite, 79 binaries ok)scripts/pre-push.sh --fullk: !!int 08captured from yq v4.53.3, all agree (.zz = 1,.k = .k,with_entries(.),tojson,tag,tostring,length,+ 1)str::parse