Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
ComponentValueStream.h File Reference

Pull-based cursor over a sequence of donner::css::ComponentValue. More...

#include <cstddef>
#include <optional>
#include <span>
#include "donner/base/FileOffset.h"
#include "donner/css/ComponentValue.h"
#include "donner/css/Token.h"
Include dependency graph for ComponentValueStream.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::css
 Donner CSS library, a standalone composable CSS parser.
namespace  donner::css::parser
 Parsers for various CSS data types, such as the top-level StylesheetParser and SelectorParser, as well as internal details such as ColorParser.

Detailed Description

Pull-based cursor over a sequence of donner::css::ComponentValue.

See docs/design_docs/0019-css_token_stream.md for the design rationale. The short version: CSS subparsers (currently donner::css::parser::SelectorParser, planned for others) walk a pre-materialized list of ComponentValues with a one-way cursor, peeking ahead by small constant offsets and never rewinding. ComponentValueStream lifts that cursor into a named, testable abstraction so the parser code reads as "peek, check, advance" rather than as raw span arithmetic.