Expand description
CSS tokenizer, implementing CSS Syntax Module Level 3 §3 (Tokenizing and Parsing CSS) and §4 (Tokenization).
This module only turns a &str into a stream of tokens. It has no
knowledge of the Media Queries grammar (feature names, and/or/
not, range syntax, …) — that belongs to the parser (phase 03).
Structs§
- Tokenizer
- A tokenizer over a preprocessed input stream, per spec §4.3.
Enums§
- Hash
Type - Type flag of a
Token::Hash(spec §4.3.1, the#branch). - Numeric
Type - Numeric type flag, as used by
Token::NumberandToken::Dimension(spec §4.3.12, “Consume a number”). - Token
- A single CSS token, per spec §4.3.1 (“Consume a token”) and the token types defined at the start of §4.3.
Functions§
- tokenize
- Tokenizes
inputinto aVec<Token>, ending with a singleToken::Eof. Convenience wrapper aroundTokenizerfor callers that don’t need streaming/lazy tokenization.