token-resolver v1.0.1 released!
1.0.1 - 2026-02-22
- TAG: v1.0.1
- COVERAGE: 98.13% – 263/268 lines in 10 files
- BRANCH COVERAGE: 91.18% – 62/68 branches in 10 files
- 96.77% documented
Added
Config#segment_patternoption — a parslet character class constraining which characters are valid inside token segments (default:"[A-Za-z0-9_]"). This prevents false positive token matches against Ruby block parameters ({ |x| expr }), shell variable expansion (${VAR:+val}), and other syntax that structurally resembles tokens but contains spaces or punctuation in the “segments”.Resolve#resolvenow validates replacement keys against the config’ssegment_patternand raisesArgumentErrorif a key contains characters that the grammar would never parse.
Fixed
- False positive token matches — the grammar previously used
any(match any character) for segment content, which allowed spaces, operators, and punctuation inside token segments. This caused Ruby block syntax like{ |fp| File.exist?(fp) }and shell expansion like${CLASSPATH:+:$CLASSPATH}to be incorrectly parsed as tokens. With multi-separator configs (["|", ":"]), the second|was reconstructed as:duringon_missing: :keeproundtripping, silently corrupting source files. The grammar now usesmatch(segment_pattern)instead ofany, limiting segments to word characters by default.
Many paths lead to being a sponsor or a backer of this project. Are you on such a path?