Commit b2c3926
authored
fix: parsing local version with digit followed by non-digits (#3032)
When parsing the local identifier segment of `<digit><letter>` the
parser would
give an error saying the letter was unexpected.
What was happening was `accept_digits()` consumed up to the first
non-digit, and
considered this success, which prevented calling `accept_alnum()` to
finish
the parsing.
To fix, only call `accept_alnum()`, then post-process the value to
normalize
an all-digit segment.
I'm guessing `accept_digits()` stopping at the first non-digit is WAI
because
it expects to parse e.g. "3.14b", where the caller handles subsequent
characters.
Along the way, some minor doc improvements to the parser code.
Fixes #30301 parent 998e22e commit b2c3926
2 files changed
+46
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
64 | 79 | | |
65 | 80 | | |
66 | 81 | | |
| |||
79 | 94 | | |
80 | 95 | | |
81 | 96 | | |
82 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
83 | 105 | | |
84 | 106 | | |
85 | 107 | | |
| |||
167 | 189 | | |
168 | 190 | | |
169 | 191 | | |
170 | | - | |
| 192 | + | |
171 | 193 | | |
172 | 194 | | |
173 | 195 | | |
| |||
275 | 297 | | |
276 | 298 | | |
277 | 299 | | |
278 | | - | |
| 300 | + | |
279 | 301 | | |
280 | 302 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
285 | 314 | | |
286 | 315 | | |
287 | 316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
0 commit comments