Crate tele_parser

Source
Expand description

A simpler and faster CSS parser.

§Usages

use tele_tokenizer::Tokenizer;
use tele_parser::Parser;

// Create a tokenizer
let mut tokenizer: Tokenizer = r".foo { color: red; }".into();
// Tokenize based on the given raw string,
let tokens = tokenizer.tokenize().unwrap();
// Create a parser from a sequence of tokens
let parser = Parser::from(tokens);
// parsing it
let ast = parser.parse();

Structs§

AtRuleNode
Represents a at-rule
DeclarationNode
Represents a CSS declaration
DimensionNode
FunctionNode
IdentNode
Represents an identifier as the value of a CSS declaration
Loc
Represents the location information of the token in the source file
NumberNode
OperatorNode
Parser
Represents the CSS parser.
PercentageNode
RawNode
RuleSetNode
Represents a ruleset
StringNode
Represents a string as the value of a CSS declaration
StyleSheetNode
Represents a stylesheet
URLNode

Enums§

StatementNode
A statement is either a ruleset or an at-rule
Value

Type Aliases§

AstType
The root node of an AST
ParserResult