Expand description
Port of src/parser/parse.ts.
doParse() / doParseSync(): see parse_main.rs. this module holds the statement parsers (parseNode(),
parseAtRule()), the token parsers (parseString(), parseTokens()) and their helpers.
Re-exports§
pub use super::parse_main::*;
Structs§
- Parse
Result Stats ParseResultStats
Functions§
- allocate_
token - allocate the current tokenizer token in the arena
- allocate_
whitespace - allocate a whitespace token
- arena_
capacity - initial arena capacity: one node for every 4 bytes of css
- create_
at_ rule_ node - allocate an at-rule node from an at-rule token
- create_
comment_ node - allocate a comment node from a comment token
- drop_
invalid_ nodes - detach the invalid nodes. the unknown nodes are kept in lenient mode
- get_
key_ name - transform the case of a key name (
getKeyName()) - is_
bad_ token - bad comment, cdo, url or string token
- is_
definition_ block - true if the node is an at-rule whose block is kept when it is empty:
@apply,@mixin,@function - is_
statement_ end - true if the token ends a statement or a block: the whitespace that precedes it is not significant
- parse_
at_ rule - parse an at-rule
- parse_
declarations - parse a string as declaration nodes (detached). a new arena is created when none is given
- parse_
node - parse a statement: an at-rule, a rule or a declaration
- parse_
rule_ content - parse a string as the content of a style rule (detached nodes, the comments are dropped)
- parse_
string - parse a css string into tokens (
parseString(arena, src)with{ parseColor: true }) - parse_
string_ with - parse a css string into tokens.
options:srcandparseColor;Noneisnull(the colors are parsed) - parse_
tokens - parse the function, parentheses and attribute tokens of a token list (in place).
Noneoptions:{ parseColor: true } - recycle_
statement_ tokens - recycle the tokens of a statement that were not attached to the tree
- render_
tokens - render tokens (
renderTokens())