Commit 76626ce
Fix key drop after code-expansion in tapKeySeq (consumeWhite context pop)
consumeWhite()'s whitespace-skipping loop evaluated `*ctx->at <= 32` before
calling isEnd(). isEnd() may pop an exhausted parser context (such as the
sub-context pushed by tapKeySeq's expandCodes for hexCodeOf/decCodeOf/
altCodeOf/uCodeOf), which moves ctx->at to the parent's next token. Because
the dereference happened first and the loop body then ran ctx->at++, the first
character of that parent token was stepped over and dropped.
Concretely, `tapKeySeq x y hexCodeOf(!) x y` typed `x y 2 1 y` — the `x`
following the expansion was lost. Reordering the condition so isEnd() (and its
context pop) runs before the dereference keeps ctx->at on the restored token.
Verified on uhk-80-right: the TapKeySeq regression test now passes and the
full on-device test suite is green (52/52).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 27613d1 commit 76626ce
2 files changed
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
143 | | - | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
| |||
322 | 326 | | |
323 | 327 | | |
324 | 328 | | |
325 | | - | |
| 329 | + | |
326 | 330 | | |
327 | 331 | | |
328 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
6 | 4 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 5 | + | |
| 6 | + | |
14 | 7 | | |
15 | 8 | | |
16 | 9 | | |
| |||
0 commit comments