Commit 904eaf0
committed
fix: serialise Any Range/String payloads as any_char_class
Ruby's Node::Item::Any compiles differently depending on the payload:
Array → alternation `(?:a|b|c)`, String → char class `[abc]`, Range →
char class `[a-z]`. The IR serialiser was treating all three the same
(Array form), which expanded Ranges via String#succ into nonsense
like "zzz" and missed most of the BMP. Maps that used
`any("\\u0061".."\\uFFFF")` for post-rule upcase failed because the
expanded list didn't include extended-Latin characters like ā.
Emit {kind: "any_char_class", range: [first, last]} for Range payloads
and {kind: "any_char_class", chars: [...]} for String payloads. The
interscript-ts runtime handles both forms via the AnyCharClassItem
variant introduced in the parallel-mode parity work.
Companion PR: interscript/interscript-ts#51 parent d98ee14 commit 904eaf0
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
| |||
0 commit comments