Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::detail::PssParser< Sink > Class Template Reference

Shared allocation-free grammar kernel; sink calls are synchronous and may throw. More...

#include <pss_parser.hpp>

Public Member Functions

constexpr PssParser (std::string_view source, Sink &sink, PssPolicy policy, std::size_t maxBytes=MAX_PSS_BYTES, std::size_t maxRules=MAX_STYLE_RULES)
constexpr std::expected< void, PssError > parse ()

Detailed Description

template<class Sink>
class portals::detail::PssParser< Sink >

Shared allocation-free grammar kernel; sink calls are synchronous and may throw.

Template Parameters
SinkSupplies rule/selector/declaration callbacks returning expected<void,PssError>. Runtime sinks may allocate; their wrapper catches allocation failure around the entire operation. No source view or callback is retained after parse() returns.

Constructor & Destructor Documentation

◆ PssParser()

template<class Sink>
portals::detail::PssParser< Sink >::PssParser ( std::string_view source,
Sink & sink,
PssPolicy policy,
std::size_t maxBytes = MAX_PSS_BYTES,
std::size_t maxRules = MAX_STYLE_RULES )
inlineconstexpr
Parameters
sourceBorrowed bytes retained only for this parser invocation.
sinkBorrowed synchronous destination; receives original source spans.
policyLegacy byte compatibility or strict UTF-8 admission.
maxBytesInput byte admission budget.
maxRulesSource-order rule admission budget.

Member Function Documentation

◆ parse()

template<class Sink>
std::expected< void, PssError > portals::detail::PssParser< Sink >::parse ( )
inlineconstexpr
Returns
Grammar/admission result; sink exceptions propagate to the owning runtime wrapper.

The documentation for this class was generated from the following file: