Skip to main content

hpx_browser/css_parser/
mod.rs

1//! CSS Syntax Level 3 tokenizer and parser with CSS Nesting support.
2
3pub mod ast;
4pub mod error;
5pub mod parser;
6pub mod source;
7pub mod token;
8pub mod tokenizer;
9
10pub use ast::*;
11pub use error::ParseError;
12pub use parser::Parser;
13pub use source::SourceLocation;
14pub use token::{Token, TokenKind, resolve_escapes};
15pub use tokenizer::Tokenizer;
16
17/// Parse a complete CSS stylesheet.
18pub fn parse_stylesheet(input: &str) -> (Stylesheet<'_>, Vec<ParseError>) {
19    Parser::parse_stylesheet(input)
20}
21
22/// Parse a list of CSS declarations (e.g., from a `style` attribute).
23pub fn parse_declaration_list(input: &str) -> (Vec<Declaration<'_>>, Vec<ParseError>) {
24    Parser::parse_declaration_list(input)
25}