parsi/fn/expect.hpp

namespace parsi

Functions

inline auto expect(std::string expected) noexcept -> fn::ExpectString

Creates a parser that expects the stream to start with the given string.

constexpr auto expect(char expected) noexcept -> fn::ExpectChar

Creates a parser that expects the stream to start with the given character.

constexpr auto expect_not(char expected) noexcept -> fn::ExpectChar

Creates a parser that expects the stream to start with the given character.

constexpr auto expect(Charset expected) noexcept -> fn::ExpectCharset

Creates a parser that expects the stream to start with a character the is in the given charset.

constexpr auto expect_not(Charset expected) noexcept -> fn::ExpectCharset

Creates a parser that expects the stream to start with a character the is in the given charset.

namespace fn
struct ExpectChar
#include <expect.hpp>

A parser that expects the stream to start with the given character.

Public Functions

inline constexpr auto operator()(Stream stream) const noexcept -> Result

Public Members

char expected
bool negate = false
struct ExpectCharset
#include <expect.hpp>

A parser that expects the stream to start with a character that is in the given charset.

Public Functions

inline constexpr auto operator()(Stream stream) const noexcept -> Result

Public Members

Charset charset
struct ExpectString
#include <expect.hpp>

A parser that expects the stream to start with the given string.

Public Functions

inline auto operator()(Stream stream) const noexcept -> Result

Public Members

std::string expected