Skip to main content

Module flex_parser

Module flex_parser 

Source
Expand description

Flexible Parser System for Advanced CSS Parsing

This module provides enhanced parser combinators that overcome the limitations of the current TokenParser system:

  1. Heterogeneous Sequences: Parse sequences with mixed types
  2. Context-Aware Parsing: Switch behavior based on parsing context
  3. Backtracking Support: Try multiple parsing strategies
  4. Dynamic Type Handling: Flexible value mixing

Key features:

  • FlexParser for mixed-type parsing
  • Advanced combinators (try_all, mixed_sequence, context_parser)
  • Enhanced error handling with suggestions
  • Performance optimizations

Modules§

smart_tokens
Smart token parsers with automatic value extraction

Structs§

FlexCombinators
Enhanced combinators for flexible parsing

Enums§

ParseContext
Parse context for context-aware parsing

Traits§

TokenListExt

Functions§

parse_hsl
parse_rgb
Convenience functions for common parsing patterns

Type Aliases§

FlexParser
Parser that can return any CSS value type - enables flexible parsing