Expand description
Port of src/ast/arena.ts.
Arena memory manager: ast nodes and value tokens are integer ids, their data is stored column-wise (structure of
arrays) in Rust owned vectors, lists are doubly linked lists stored in the first_child / last_child /
first_token / last_token / next_sibling / previous_sibling columns and strings are interned.
The columns are interior mutable (Column): every method takes &self, like the typescript implementation
where the arena is a shared mutable object (visitors re-enter the arena while it is transformed).
Modules§
- Token
Field - position of the structured token fields in the children list
Structs§
- Arena
- Arena memory manager.
- Arena
Properties - properties of an arena, see
Arena::export_properties(Arena.toTransferableArenaObject()) - Arena
Transferables - column buffers of an arena, in the order of
ARENA_COLUMNS - AstArena
- Css ast arena: ast nodes and value tokens. Derefs to
Arena(typescriptextends). - Optimized
Selector - optimized selector (
OptimizedSelector) - RawSelector
- a split selector of the minification cache (
arena.raw) with its vendor prefixes, computed once. a mutable access clears the prefixes
Enums§
- StrOrId
- a string or an interned string id (
sel: string | numberarguments) - Token
Value - a token value: a string or a number (
val?: string | number | null)
Constants§
- ARENA_
COLUMNS - arena columns, in the order of the transferable buffers
- SKIP_
STATES - the nesting rules of these nodes are not expanded
Functions§
- is_
js_ whitespace - javascript
\s - is_
node_ object_ type - true for the node types whose plain object is a node (
isNodeObjectType()ofarena-node.ts) - is_
numeric_ token_ type - numeric token types: the value is stored in the
numeric_valuecolumn - is_
structured_ token_ type - token types whose fields are stored as list children (see
TokenField) - js_trim
String.prototype.trim()- structured_
fields - fields of a structured token type: the plain object key (
l,r,op,op1,op2,val), the field index and whether the field holds a single token. empty for the other token types
Type Aliases§
- RawSelector
Tokens - raw selector (
RawSelectorTokens) - Shared
Optimized Selector - optimized selector shared by reference, like the typescript objects (the minifier mutates it in place and a cloned rule shares the object of its source)
- Structured
Field - plain object key, field and single value flag of a structured token field