mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-07 01:15:33 +00:00
Fixes #7005. If a developer used single digit values in stores, unquoted (which is not really the usual approach, but should work just fine for non-zero values), the KMW compiler would emit invalid single-digit hexadecimal escapes for them, e.g. `"\x1"` instead of `"\x01"`. Sample code: ``` store(option) 1 if(option = 1) + 'a' > 'one' if(option = 2) + 'a' > 'two' + '1' > set(option = 1) + '2' > set(option = 2) ``` It is not immediately obvious from this code, but the value `1` is actually a character with value `'\x01'` or `U+0001`! The more usual approach will not encounter this problem: ``` store(option) '1' if(option = '1') + 'a' > 'one' if(option = '2') + 'a' > 'two' + '1' > set(option = '1') + '2' > set(option = '2') ``` Note that the following is a compile error (due to internal use of null terminated strings). ``` store(option) 0 ``` |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||