Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::parser::AnbMicrosyntaxParser Class Reference

Parse a CSS value, per https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values. More...

#include "donner/css/parser/AnbMicrosyntaxParser.h"

Classes

struct  Result
 Result of parsing the An+B microsyntax. More...
 

Static Public Member Functions

static ParseResult< ResultParse (std::span< const ComponentValue > components)
 Parse the CSS An+B microsyntax, per https://www.w3.org/TR/css-syntax-3/#anb-microsyntax.
 

Detailed Description

Parse a CSS value, per https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values.

This is used when parsing CSS-like attributes within XML/HTML, such as SVG presentation attributes.

Member Function Documentation

◆ Parse()

ParseResult< AnbMicrosyntaxParser::Result > donner::css::parser::AnbMicrosyntaxParser::Parse ( std::span< const ComponentValue > components)
static

Parse the CSS An+B microsyntax, per https://www.w3.org/TR/css-syntax-3/#anb-microsyntax.

For example:

  • "5" would return (0, 5)
  • "odd" would return (1, 2)
  • "even" would return (2, 2)
  • "3n+1" would return (3, 1)
Parameters
componentsList of component values to parse.
Returns
Parsed value as a list of component values.

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