fix: bind Refs parser to one token #252

Merged
andres merged 6 commits from build/234-bind-refs-token into main 2026-08-24 18:15:11 +00:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit d712f0636f - Show all commits

View file

@ -213,7 +213,9 @@ refs_references() { # PR body on stdin -> local issue numbers named by Refs
token = substr(rest, RSTART, RLENGTH)
sub(/^.*refs[[:space:]:]+/, "", token)
print token
rest = substr(rest, RSTART + RLENGTH)
# Retain the token final byte so ^ cannot turn a concatenated
# alphanumeric suffix into a fresh keyword boundary (#234).
rest = substr(rest, RSTART + RLENGTH - 1)
}
}
' | issue_references \

View file

@ -117,6 +117,8 @@ check "parenthesized prose after a local Refs token is ignored" 0 "" \
test "$(refs_references <<<'Refs #175 (split from #150)')" = 175
check "every Refs occurrence on one line contributes its bound token" 0 "" \
test "$(refs_references <<<'Refs #8. Refs #9.')" = $'8\n9'
check "a concatenated Refs spelling is not a second keyword occurrence" 0 "" \
test "$(refs_references <<<'Refs #8Refs #9')" = 8
check "lowercase refs in unrelated prose declares nothing" 0 "" \
test -z "$(refs_references <<<'fix refs parsing from #200')"
check "Refs without a following token declares nothing" 0 "" \