mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
Part of #1880 `Token` size is reduced from 32 to 16 bytes by changing the previous token value `Option<&'a str>` to a u32 index handle. It would be nice if this handle is eliminated entirely because the normal case for a string is always `&source_text[token.span.start.token.span.end]` Unfortunately, JavaScript allows escaped characters to appear in identifiers, strings and templates. These strings need to be unescaped for equality checks, i.e. `"\a" === "a"`. This leads us to adding a `escaped_strings[]` vec for storing these unescaped and allocated strings. Performance regression for adding this vec should be minimal because escaped strings are rare. Background Reading: * https://floooh.github.io/2018/06/17/handles-vs-pointers.html |
||
|---|---|---|
| .. | ||
| js | ||
| jsx | ||
| lexer | ||
| ts | ||
| context.rs | ||
| cursor.rs | ||
| diagnostics.rs | ||
| lib.rs | ||
| list.rs | ||
| state.rs | ||