REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
unicode_fold.hpp File Reference

Unicode simple case-folding orbits for text-mode flags::icase. More...

#include "real/version.hpp"
#include <cstddef>
#include <cstdint>
Include dependency graph for unicode_fold.hpp:

Go to the source code of this file.

Classes

struct  real::detail::fold_entry
 A code point and the other members of its case-fold orbit (up to 3; orbits <= 4). More...
 

Namespaces

namespace  real
 
namespace  real::detail
 

Functions

constexpr std::size_t real::detail::find_fold_index (std::uint32_t cp)
 Binary-searches unicode_fold_table for cp; returns its index, or unicode_fold_table_size if cp is not cased. An index (not a pointer into the table) keeps this usable in a constant expression on every compiler — g++ rejects a &table[i] != nullptr comparison inside a static_regex. Shared by the parser (is a literal cased?) and the compiler (its fold partners).
 

Variables

constexpr const char * real::detail::unicode_fold_unidata_version {"16.0.0"}
 The Unicode data version these orbits were generated from (16.0.0).
 
constexpr fold_entry real::detail::unicode_fold_table []
 Fold orbits, sorted by fold_entry::cp for binary search.
 
constexpr std::size_t real::detail::unicode_fold_table_size {2940}
 Number of entries in unicode_fold_table.
 

Detailed Description

Unicode simple case-folding orbits for text-mode flags::icase.

GENERATED by tools/gen_unicode_fold.py – DO NOT EDIT BY HAND.

Each entry maps a code point to the other members of its case-fold orbit (the set that matches it under IGNORECASE). Built from, and exhaustively validated against, CPython's own case-insensitive matching, so REAL's text-mode icase is identical to re.IGNORECASE by construction. Unicode data version: 16.0.0 (asserted at compile time).

Definition in file unicode_fold.hpp.