2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-26 18:52:23 +00:00

Add unicode symbols parser (#213)

* Add symb parser to handle unicode symbols

* Add documentation for symb

* Add tests for symb

* Fix typo in the documentation

---------

Contributed by: Antoine Fontaine <antoinefontaine@posteo.net>
This commit is contained in:
necessarily-equal
2025-02-21 06:51:17 +01:00
committed by GitHub
parent 0a34acc42a
commit b253d9ca53
9 changed files with 1203 additions and 1 deletions

View File

@@ -245,6 +245,13 @@ namespace boost { namespace parser { namespace detail {
std::ostream & os,
int components = 0);
template<typename Context>
void print_parser(
Context const & context,
char_set_parser<symb_chars> const & parser,
std::ostream & os,
int components = 0);
template<typename Context>
void print_parser(
Context const & context,

View File

@@ -636,6 +636,16 @@ namespace boost { namespace parser { namespace detail {
os << "punct";
}
template<typename Context>
void print_parser(
Context const & context,
char_set_parser<symb_chars> const & parser,
std::ostream & os,
int components)
{
os << "symb";
}
template<typename Context>
void print_parser(
Context const & context,

File diff suppressed because it is too large Load Diff

View File

@@ -7811,12 +7811,18 @@ namespace boost { namespace parser {
control;
/** The punctuation character parser. Matches the full set of Unicode
punctuation clases (specifically, "Pc", "Pd", "Pe", "Pf", "Pi", "Ps",
punctuation classes (specifically, "Pc", "Pd", "Pe", "Pf", "Pi", "Ps",
and "Po"). */
inline BOOST_PARSER_ALGO_CONSTEXPR
parser_interface<char_set_parser<detail::punct_chars>>
punct;
/** The symbol character parser. Matches the full set of Unicode
symbol classes (specifically, "Sc", "Sk", "Sm", and "So"). */
inline BOOST_PARSER_ALGO_CONSTEXPR
parser_interface<char_set_parser<detail::symb_chars>>
symb;
/** The lower case character parser. Matches the full set of Unicode
lower case code points (class "Ll"). */
inline BOOST_PARSER_ALGO_CONSTEXPR

View File

@@ -143,6 +143,8 @@ namespace boost { namespace parser {
struct punct_chars
{};
struct symb_chars
{};
struct lower_case_chars
{};
struct upper_case_chars