Overhaul label sanitization logic

Besides code cleanup, this commit changes the sanitization logic to
avoid numeric digits altogether. Previously, they had been allowed at
the end of a label name, but this is susceptible to a ZZT parser bug:
`#foo` matches `:foo2` because ZZT allows a prefix match if the next
character is a digit.
This commit is contained in:
2025-07-19 15:22:27 -07:00
parent 85ba7b63c8
commit 84f35c8b44
4 changed files with 145 additions and 184 deletions
@@ -9,14 +9,14 @@ expression: board_to_text(board)
You have hundreds of gems.
#end
:lt_
#take gems 10 lt_0
#take gems 10 lt__
#give gems 10
You have tens of gems.
#end
:lt_0
#take gems 1 lt1
:lt__
#take gems 1 lt_a
#give gems 1
You have at least one gem.
#end
:lt1
:lt_a
You don't have any gems!