parserino.css.tokenizer

CSS tokenizer (CSS Syntax Level 3), limited to what selectors need. It works at runtime and at compile time.

Types 3

enumTokenType : ubyte

Token types, as in CSS Syntax (Cdo is `<!--`, Cdc is `-->`)

Eof
Ident
Functiona name followed by a left parenthesis: `text` is the name
AtKeyword
Hash`text` is the name after '#'
String
BadString
Delim`delim` is the character
Number
Percentage
Dimensionnumber + `text` (the unit)
Whitespace
Cdo
Cdc
Colon
Semicolon
Comma
LeftSquare
RightSquare
LeftParen
RightParen
LeftCurly
RightCurly
structToken

A token

Fields
dchar delim
const(char)[] text
double number
bool isInteger
bool hasSign
structTokenizer

The tokens of a string, one at a time (front, popFront)

Fields
bool failedOut of memory while unescaping
Methods
const(Token) front() ref @nogc nothrow pure @safe returnCurrent token (not consumed)
void popFront() @nogc nothrow pure @safeConsume the current token
const(Token) frontSkipSpace() ref @nogc nothrow pure @safe returnCurrent token, skipping one whitespace token
Constructors
this(const(char)[] input, Arena * arena)Tokenize `input`: the texts of the tokens are slices of `input`, or in `arena` when unescaped