Skip to main content

Module token_parser

Module token_parser 

Source
Expand description

Token parser combinators for CSS parsing.

This module provides a monadic parser combinator library for building CSS parsers, with a comprehensive set of parsing tools and combinators.

COMPREHENSIVE PARSING API

This implementation provides a complete parsing API with:

  • Return types: T | Error (using Result<T, CssParseError> in Rust)
  • Consistent method signatures
  • Helper classes: TokenZeroOrMoreParsers, TokenOneOrMoreParsers, etc.
  • Fluent APIs with .separated_by() methods
  • Static methods return specialized parser types

Modules§

tokens
Provides: TokenParser.tokens.Ident, TokenParser.tokens.Whitespace.optional, etc.

Structs§

MixedSequenceBuilder
Builder for mixed sequences that can handle optional parsers intelligently
SeparatedParser
A parser that represents a main parser separated by a separator parser This allows for fluent API like: parser.separatedBy(comma).oneOrMore()
SequenceParsers
SetOfParsers
TokenOneOrMoreParsers
TokenOptionalParser
TokenParser
TokenZeroOrMoreParsers
Tokens
Tokens API providing access to all basic token parsers

Enums§

Either

Functions§

peek_tokens
Peek at what the next few tokens would be without consuming them Enhanced debugging utility function

Type Aliases§

RunFn
A parser function that takes a TokenList and returns T or Error