|
| struct | ast |
| | A parsed pattern: the node pool plus side tables. More...
|
| |
| struct | ast_node |
| | One AST node. Active fields depend on kind (noted per field). More...
|
| |
| struct | basic_capture_pool |
| | Copy-on-write pool of capture blocks (OPT D1) — the one capture-slot mechanism for both storages. More...
|
| |
| struct | basic_pike_state |
| | Reusable VM scratch state. More...
|
| |
| struct | basic_thread_list |
| | One priority-ordered list of NFA threads (leftmost-greedy semantics). More...
|
| |
| struct | byte_program |
| | A byte-level program derived from a Pike program for the DFA passes: every klass_cp construct is expanded into UTF-8 byte-range split/klass chains, so the whole thing is byte-transition-only and a forward DFA can represent it. The Pike program itself is untouched (byte-identity); this is a private recognition view the DFAs own. eligible is false when an op no DFA can represent (a position assertion or a lookaround) is present — the caller then keeps the Pike VM. More...
|
| |
| struct | char_class |
| | A set of byte values (0–255) as a 256-bit bitmap. More...
|
| |
| struct | class_def |
| | A parsed character class: its ASCII bitmap plus any non-ASCII code-point ranges. Bundling the two (rather than parallel side tables) makes them impossible to desynchronize. More...
|
| |
| struct | code_range |
| | An inclusive code-point range [lo, hi]. Shared by character classes (ast.hpp) and the generated Unicode property / fold tables; lives here so those low-level headers need not pull in the parser. More...
|
| |
| class | compiler |
| | Compiles an ast into a dynamic_program (NFA bytecode). More...
|
| |
| struct | cp_class |
| | A match-time code-point class for the klass_cp opcode: an ASCII bitmap for code points < 0x80 plus a slice of sorted non-ASCII ranges (indexing the program's flat cp_ranges buffer). It is the already-effective set (any \W/[^…] negation is materialised at compile time). Unlike the byte-NFA klass, the ranges are kept and binary-searched at match time — O(log ranges) per position, independent of the range count. More...
|
| |
| struct | decoded_codepoint |
| | The result of a strict UTF-8 decode: the code point, its byte length, and validity. More...
|
| |
| struct | dfa_byte_classes |
| | Computes byte-equivalence classes: two bytes are equivalent iff they satisfy the same consuming predicates (every klass test and every byte literal). Reduces the alphabet so the DFA is built over classes, not 256. More...
|
| |
| struct | dfa_instr |
| | A flattened NFA instruction (global PCs, global class index). More...
|
| |
| struct | dfa_nfa |
| | The union NFA over all the patterns, flattened into one address space. More...
|
| |
| struct | dfa_tables |
| | The baked DFA tables produced by dfa_build. More...
|
| |
| struct | digit_escape_result |
| | Result of decode_digit_escape(). More...
|
| |
| struct | dynamic_program |
| | Owning, heap-allocated program: the storage backing real::regex. More...
|
| |
| struct | dynamic_storage |
| | Storage policy backing real::regex: heap, sized once at run time. More...
|
| |
| struct | eps_entry |
| | One frame on the epsilon-closure DFS stack (OPT D1): a program counter to explore, plus the capture block the branch carries. The block travels with the branch — a split shares it and a save copies it on write — so there is no slot-restore entry and no shared working array. More...
|
| |
| struct | fold_entry |
| | A code point and the other members of its case-fold orbit (up to 3; orbits <= 4). More...
|
| |
| struct | gc_alias_entry |
| | A loose-normalized (lowercase, no _/-/space) General_Category name and its property. More...
|
| |
| struct | inner_literal |
| | The best required inner literal of a pattern (the memmem candidate). len == 0 means the pattern declined: an alternation, an optional (?/*/{0,n}), a lookaround or an anchor at the level walked, or simply no literal run — anything that would make a required literal unsound. More...
|
| |
| struct | instr |
| | One NFA instruction. Field meaning depends on op. More...
|
| |
| struct | lazy_byte_alphabet |
| | Byte-class alphabet over a Pike program: bytes that satisfy exactly the same byte/klass predicates share a class, so the DFA transitions over classes instead of 256 raw bytes. The same reduction real::dfa uses, computed here from the Pike program's own ops. More...
|
| |
| class | lazy_dfa |
| | A lazy priority-preserving forward DFA over a Pike program (the kFirstMatch forward pass). More...
|
| |
| struct | lookaround_scratch |
| | Reusable, isolated scratch for one level of lookaround evaluation (dynamic only). More...
|
| |
| struct | lookaround_sub |
| | A bounded lookaround sub-program, referenced by assert_lookaround's arg16. More...
|
| |
| struct | named_group |
| | A named capture group. More...
|
| |
| class | onepass |
| | Builds and holds the one-pass classification (and table, when eligible) of a byte-program. More...
|
| |
| struct | onepass_edge |
| | One outgoing edge of a one-pass node, for a byte-class: the next node and the capture slots that take the current position as the byte is consumed. Two epsilon paths reaching the same class with a different edge is the one-pass conflict — the pattern is then rejected. More...
|
| |
| struct | onepass_node |
| | A one-pass node: one edge per byte-class, plus whether the run may end here and with what captures. Nodes are the points the automaton can be in between byte reads. More...
|
| |
| class | parser |
| | Recursive-descent parser: a pattern string in, an ast out. More...
|
| |
| struct | pattern_hints |
| | Search-acceleration hints extracted from a compiled program. More...
|
| |
| struct | pc_set_cache |
| | A tiny open-chaining hash set of interned PC-set state ids, keyed by their pc-set. Replaces a std::unordered_map so the DFAs stay literal types (a constexpr real::regex embeds one in its scratch state); all-std::vector storage is constexpr-constructible in C++20. Maps a candidate pc-set to its existing state id, or not_found, comparing against the owner's pcs. More...
|
| |
| struct | pike_state |
| | VM scratch state for the dynamic storage mode, plus the lookaround sub-scratch. More...
|
| |
| class | pike_vm |
| | The Pike VM, generic over the scratch-state container policy. More...
|
| |
| struct | program_view |
| |
| struct | regex_immutables |
| | The per-regex immutable cache the router shares across every find_iter on a regex: the byte- program (klass_cp expanded to the deterministic trie) and, when the pattern is one-pass, the extractor table. Built exactly once, under once, so a const regex used from many threads (the binding shares the compiled object across GIL-released calls) builds it race-free. The mutable DFA transition caches stay per-iterator — they warm per scan and would need a lock here. More...
|
| |
| class | reverse_dfa |
| | The start-finder companion to lazy_dfa. Given a match end, it finds the leftmost start (the design guide §7.6 contract). It runs the inverted program — the forward program's edges transposed, its consuming bytes kept — as a cached DFA over the text scanned right-to-left from the end, recording an accept each time it reaches the original start (reverse-kLongest: the furthest-back accept is the start). It needs no priority ordering — its states are plain unordered (sorted) PC sets and its rule is longest — so it is simpler than the forward pass. Dynamic only. More...
|
| |
| struct | script_alias_entry |
| | A loose-normalized (lowercase, no _/-/space) Script name and its value. More...
|
| |
| struct | script_range |
| | One code-point range and the Script it belongs to (the table partitions the code space). More...
|
| |
| class | small_vec |
| | Small-buffer-optimized vector for the dynamic hot paths. More...
|
| |
| struct | static_storage |
| | Storage policy backing real::static_regex: compile-time, stateless. More...
|
| |
| class | static_vec |
| | Fixed-capacity vector backed by an inline array (no heap). More...
|
| |
| struct | utf8_byte_range |
| | One byte-range step [lo, hi] of a UTF-8 sequence produced by the code-point-range algorithm. More...
|
| |
| struct | utf8_byte_seq |
| | A canonical UTF-8 byte-range sequence (1–4 steps) covering part of a code-point range. More...
|
| |
| struct | utf8_trie |
| | A minimal deterministic UTF-8 trie for a code-point class. root == -1 means the class is empty. More...
|
| |
| struct | utf8_trie_node |
| | One node of a minimal deterministic UTF-8 trie for a code-point class. Its transitions are byte ranges that are pairwise disjoint, so at most one edge matches any byte — that determinism is what makes the byte-program one-pass-friendly. child >= 0 is a node id; child == -1 is accept (a code point ends here — the run continues at the construct's successor). More...
|
| |
|
| enum class | opcode : std::uint8_t {
byte
, klass
, klass_cp
, split
,
jump
, save
, assert_position
, match
,
assert_lookaround
} |
| | NFA instruction opcodes executed by the Pike VM. More...
|
| |
| enum class | assert_kind : std::uint8_t {
text_start
, text_end
, text_end_or_final_newline
, line_start
,
line_end
, word_boundary
, not_word_boundary
, word_start
,
word_end
} |
| | Kind of zero-width assertion carried in assert_position's arg8. More...
|
| |
| enum class | look_dir : std::uint8_t { ahead
, behind
} |
| | Direction of a lookaround sub-pattern. More...
|
| |
| enum class | run_mode : std::uint8_t { prefix
, full
, search
} |
| | How a VM run is anchored. More...
|
| |
| enum class | node_kind : std::uint8_t {
empty
, byte
, klass
, any
,
concat
, repeat
, alternation
, group
,
anchor
, lookaround
} |
| | Kind of an AST node; selects which fields of real::detail::ast_node are meaningful. More...
|
| |
| enum class | anchor_kind : std::uint8_t {
caret
, dollar
, text_start
, text_end
,
word_boundary
, not_word_boundary
, word_start
, word_end
} |
| | The specific zero-width assertion of an anchor node (see node_kind::anchor). More...
|
| |
| enum class | digit_escape_kind : std::uint8_t { octal
, group_ref
, octal_overflow
} |
| | What a \<digit> escape decoded to (see decode_digit_escape()). More...
|
| |
| enum class | gc_property : std::uint8_t {
Lu
, Ll
, Lt
, Lm
,
Lo
, Mn
, Mc
, Me
,
Nd
, Nl
, No
, Pc
,
Pd
, Ps
, Pe
, Pi
,
Pf
, Po
, Sm
, Sc
,
Sk
, So
, Zs
, Zl
,
Zp
, Cc
, Cf
, Co
,
Cn
, L
, M
, N
,
P
, S
, Z
, C
,
count
} |
| | A Unicode General_Category property: the 29 assignable categories then the 7 groups. More...
|
| |
| enum class | script : std::uint8_t {
Unknown
, Adlam
, Ahom
, Anatolian_Hieroglyphs
,
Arabic
, Armenian
, Avestan
, Balinese
,
Bamum
, Bassa_Vah
, Batak
, Bengali
,
Bhaiksuki
, Bopomofo
, Brahmi
, Braille
,
Buginese
, Buhid
, Canadian_Aboriginal
, Carian
,
Caucasian_Albanian
, Chakma
, Cham
, Cherokee
,
Chorasmian
, Common
, Coptic
, Cuneiform
,
Cypriot
, Cypro_Minoan
, Cyrillic
, Deseret
,
Devanagari
, Dives_Akuru
, Dogra
, Duployan
,
Egyptian_Hieroglyphs
, Elbasan
, Elymaic
, Ethiopic
,
Garay
, Georgian
, Glagolitic
, Gothic
,
Grantha
, Greek
, Gujarati
, Gunjala_Gondi
,
Gurmukhi
, Gurung_Khema
, Han
, Hangul
,
Hanifi_Rohingya
, Hanunoo
, Hatran
, Hebrew
,
Hiragana
, Imperial_Aramaic
, Inherited
, Inscriptional_Pahlavi
,
Inscriptional_Parthian
, Javanese
, Kaithi
, Kannada
,
Katakana
, Kawi
, Kayah_Li
, Kharoshthi
,
Khitan_Small_Script
, Khmer
, Khojki
, Khudawadi
,
Kirat_Rai
, Lao
, Latin
, Lepcha
,
Limbu
, Linear_A
, Linear_B
, Lisu
,
Lycian
, Lydian
, Mahajani
, Makasar
,
Malayalam
, Mandaic
, Manichaean
, Marchen
,
Masaram_Gondi
, Medefaidrin
, Meetei_Mayek
, Mende_Kikakui
,
Meroitic_Cursive
, Meroitic_Hieroglyphs
, Miao
, Modi
,
Mongolian
, Mro
, Multani
, Myanmar
,
Nabataean
, Nag_Mundari
, Nandinagari
, New_Tai_Lue
,
Newa
, Nko
, Nushu
, Nyiakeng_Puachue_Hmong
,
Ogham
, Ol_Chiki
, Ol_Onal
, Old_Hungarian
,
Old_Italic
, Old_North_Arabian
, Old_Permic
, Old_Persian
,
Old_Sogdian
, Old_South_Arabian
, Old_Turkic
, Old_Uyghur
,
Oriya
, Osage
, Osmanya
, Pahawh_Hmong
,
Palmyrene
, Pau_Cin_Hau
, Phags_Pa
, Phoenician
,
Psalter_Pahlavi
, Rejang
, Runic
, Samaritan
,
Saurashtra
, Sharada
, Shavian
, Siddham
,
SignWriting
, Sinhala
, Sogdian
, Sora_Sompeng
,
Soyombo
, Sundanese
, Sunuwar
, Syloti_Nagri
,
Syriac
, Tagalog
, Tagbanwa
, Tai_Le
,
Tai_Tham
, Tai_Viet
, Takri
, Tamil
,
Tangsa
, Tangut
, Telugu
, Thaana
,
Thai
, Tibetan
, Tifinagh
, Tirhuta
,
Todhri
, Toto
, Tulu_Tigalari
, Ugaritic
,
Vai
, Vithkuqi
, Wancho
, Warang_Citi
,
Yezidi
, Yi
, Zanabazar_Square
, count
} |
| | A Unicode Script value; Unknown (0) is every code point no script assigns. More...
|
| |
|
| bool & | lazy_dfa_route_disabled () |
| | Test seam: force the matcher off the lazy-DFA route onto the pure Pike VM, so a differential can assert that routed and unrouted searches give identical results within one binary. Not for production use — the routing is transparent by contract, and this only exists to prove it.
|
| |
| bool & | inner_literal_route_disabled () |
| | Test seam: force the matcher off the inner-literal search route (IL.2) onto the core search, so a differential can assert routed and unrouted searches agree. Not for production use — the route is transparent by contract (its reverse bound never advances mid-search, so it cannot miss a leftmost match), and this only exists to prove it.
|
| |
| bool & | inner_literal_guard_disabled () |
| | Test seam: force the inner-literal small-haystack guard off, so the route fires on any size. In production the guard keeps the route off a haystack too small for its per-iterator reverse cache to amortize (it would else be slower than the core). The correctness suites (the exhaustive compat run, the routed==core differential) use tiny inputs, so they set this to exercise the route itself rather than the core it would otherwise fall back to. Not for production use.
|
| |
| utf8_trie | build_utf8_trie (const cp_class &cc, std::span< const code_range > cp_ranges) |
| | Builds the minimal deterministic trie recognising a code-point class's UTF-8 byte sequences.
|
| |
| std::size_t | utf8_trie_emit_size (const utf8_trie &trie) |
| | The instruction count emit_utf8_trie writes: an empty class is one dead klass; otherwise each node is a split-guarded chain of k byte ranges (3k - 1 instructions).
|
| |
| void | emit_utf8_trie (byte_program &bp, const utf8_trie &trie, std::int32_t after) |
| | Emits trie into bp as a deterministic split/klass/jump fragment; accept edges jump to after (the construct's successor). The root is emitted first, so the fragment's entry is its base pc. Disjoint ranges mean at most one branch matches any byte.
|
| |
| byte_program | build_byte_program (const program_view &prog, bool keep_assertions=false) |
| | Builds the byte-level DFA program for prog (see byte_program). A klass_cp at P (a four- instruction construct: the op plus three utf8_cont continuation slots) is replaced by the deterministic UTF-8 trie recognising its code-point class (build_utf8_trie), converging on the mapped P+4; every other op is copied with its branch targets remapped. Two passes: the first builds each trie and sizes it to form the old→new pc map, the second emits.
|
| |
| constexpr lazy_byte_alphabet | compute_lazy_alphabet (std::span< const instr > code, std::span< const char_class > classes) |
| | Partition 0..255 by the program's consuming predicates (every klass test, every byte literal). Bytes with an identical signature collapse to one class.
|
| |
| constexpr std::size_t | encode_utf8_bytes (std::uint32_t cp, std::uint8_t(&out)[4]) |
| | Encodes cp to its UTF-8 bytes in out, returning the length (1–4).
|
| |
| constexpr void | utf8_push_range (std::uint32_t start, std::uint32_t end, std::vector< utf8_byte_seq > &out) |
| | Splits [start, end] (same UTF-8 length after the length-boundary split) into contiguous byte-range sequences (RE2 / rust regex-syntax Utf8Sequences). Every produced sequence is canonical by construction — no overlong forms, no surrogates — which is exactly the security property qE needs. Appends to out.
|
| |
| constexpr std::vector< utf8_byte_seq > | utf8_range_sequences (std::uint32_t lo, std::uint32_t hi) |
| | Canonical UTF-8 byte-range sequences for the code-point range [lo, hi], excluding the surrogate block [U+D800, U+DFFF] (so a negated class never matches a surrogate encoding).
|
| |
| constexpr void | fold_ascii_case (char_class &klass) |
| | Closes klass under ASCII case folding.
|
| |
| constexpr bool | is_ascii_word_byte (std::uint8_t byte) |
| | Reports whether byte is an ASCII "word" byte ([0-9A-Za-z_]).
|
| |
| constexpr char_class | digit_set () |
| | The ASCII digit set behind \d (Python re.ASCII semantics).
|
| |
| constexpr char_class | word_set () |
| | The ASCII word set behind \w.
|
| |
| constexpr char_class | space_set () |
| | The ASCII whitespace set behind \s.
|
| |
| constexpr char_class | utf8_cont_set () |
| | The UTF-8 continuation-byte set 10xxxxxx.
|
| |
| constexpr char_class | utf8_lead2_set () |
| | The lead-byte set of a 2-byte UTF-8 sequence.
|
| |
| constexpr char_class | utf8_lead3_set () |
| | The lead-byte set of a 3-byte UTF-8 sequence.
|
| |
| constexpr char_class | utf8_lead4_set () |
| | The lead-byte set of a 4-byte UTF-8 sequence.
|
| |
| dfa_nfa | dfa_flatten (std::span< const program_view > programs) |
| | Flattens programs into one union NFA, auditing DFA-ability.
|
| |
| void | dfa_set_bit (dfa_set &s, std::size_t i) |
| |
| bool | dfa_test_bit (const dfa_set &s, std::size_t i) |
| |
| dfa_set | dfa_closure (const dfa_nfa &nfa, const std::vector< std::uint32_t > &seeds, bool at_start) |
| | The epsilon-closure of seeds (a PC list), as a canonical PC bitset. at_start follows a text_start assertion (true only at offset 0).
|
| |
| dfa_set | dfa_move (const dfa_nfa &nfa, const dfa_set &set, std::uint8_t rep) |
| | The move on the byte rep: ε-closure of the successors of every PC in set that consumes rep.
|
| |
| std::int64_t | dfa_accept_of (const dfa_nfa &nfa, const dfa_set &set) |
| | The accepting rule of a state set: the SMALLEST rule index among its match PCs (the order tie-break), or -1 if none accept.
|
| |
| dfa_byte_classes | dfa_compute_classes (const dfa_nfa &nfa) |
| |
| dfa_tables | dfa_build (std::span< const program_view > programs, std::size_t state_cap=max_dfa_states) |
| | Subset construction over byte-classes, then Moore minimization (initial partition by accept tag, so distinct rule tags never merge).
|
| |
| constexpr bool | word_before (std::string_view text, std::size_t pos, bool ascii_word) |
| | Word-ness of the code point ending at pos — the left side of a boundary. False at the text start or on a malformed sequence; ASCII / bytes / re.A (ascii_word) stay byte-level.
|
| |
| constexpr bool | word_after (std::string_view text, std::size_t pos, bool ascii_word) |
| | Word-ness of the code point starting at pos — the right side of a boundary. False at the text end or on a malformed sequence; ASCII / bytes / re.A stay byte-level.
|
| |
| constexpr bool | assertion_holds (assert_kind kind, std::string_view text, std::size_t pos, bool ascii_word) |
| | Evaluates a zero-width assertion at pos in text.
|
| |
| constexpr bool | is_fixed_alternation (std::span< const instr > code) |
| | Tests whether the whole program is an alternation of straight-line branches (e.g. the|fox|dog).
|
| |
| constexpr void | extract_anchoring (std::span< const instr > code, pattern_hints &hints) |
| | Records start anchoring: the first non-save instruction tells whether every match must begin at position 0 (\A/^ non-multiline) or at a line start.
|
| |
| constexpr void | extract_prefix (std::span< const instr > code, pattern_hints &hints) |
| | Collects the required literal prefix and the exact-literal fast-path length.
|
| |
| constexpr void | compute_first_bytes (std::span< const instr > code, std::span< const char_class > classes, std::span< const cp_class > cp_classes, pattern_hints &hints) |
| | Computes the possible first-byte set by a DFS over the epsilon closure of pc 0.
|
| |
| constexpr void | detect_fast_shapes (std::span< const instr > code, std::span< const char_class > classes, std::int32_t cp_mark_ascii, std::int32_t cp_mark_offset, pattern_hints &hints) |
| | Detects the whole-pattern fast-path shapes and sets their hint flags: class+, fixed-shape straight runs, a single codepoint class (./negated, optional +), and an alternation of straight-line branches.
|
| |
| constexpr std::uint16_t | byte_frequency (std::uint8_t b) |
| | Approximate static frequency of a byte in mixed English + source text (occurrences per 10000; higher = more common). No text is ever scanned — this only ranks candidate prefilter bytes against one another. Punctuation like - @ . is far rarer than any letter, digit or space, which is the whole point: a required rare byte makes a far more selective memchr target than a common first-byte class.
|
| |
| constexpr void | extract_rare_byte (std::span< const instr > code, pattern_hints &hints) |
| | Finds a required literal byte at a FIXED offset that is statically far rarer than the pattern's first-byte set, and records it (pattern_hints::rare_byte / rare_offset) so the search can memchr that one byte instead of scanning a common first-byte class per byte.
|
| |
| constexpr pattern_hints | analyze_program (std::span< const instr > code, std::span< const char_class > classes, std::span< const cp_class > cp_classes, std::int32_t cp_mark_ascii, std::int32_t cp_mark_offset) |
| | Walks a compiled program once to derive its search hints.
|
| |
| constexpr std::size_t | find_byte (std::string_view text, std::size_t pos, char byte) |
| | Index of byte in text[pos..), or real::npos.
|
| |
| constexpr std::size_t | find_literal (std::string_view text, std::size_t pos, std::string_view literal) |
| | Index of the first occurrence of literal in text[pos..), or real::npos.
|
| |
| constexpr std::size_t | find_prefix (std::string_view text, std::size_t pos, std::string_view prefix) |
| | First position >= pos where prefix occurs in text, or npos.
|
| |
| constexpr std::size_t | find_bytes_cascade (std::string_view text, std::size_t pos, const char *set, std::uint8_t n) |
| | Index of the first byte in text[pos..) that belongs to a small (2..4) first-byte set.
|
| |
| constexpr std::size_t | first_high_byte (std::string_view text, std::size_t pos, std::size_t end) |
| | Index of the first byte >= 0x80 in text[pos, end), or end if the range is pure ASCII.
|
| |
| constexpr std::vector< code_range > | coalesce_ranges (std::vector< code_range > ranges) |
| | Sorts ranges and merges overlapping / adjacent ones into a minimal, sorted set (the same set of code points, the fewest ranges). Used to keep folded / property classes compact.
|
| |
| constexpr std::vector< code_range > | complement_code_ranges (std::vector< code_range > ranges) |
| | Complements a set of code-point ranges within [0x80, 0x10FFFF] (used by negated classes and by an in-class \W/\D/\S). Input may be unsorted/overlapping; the gaps come sorted.
|
| |
| constexpr digit_escape_result | decode_digit_escape (std::string_view text, std::size_t first) |
| | Decodes a \<digit> escape per CPython's exact rule (shared by the pattern parser and the replacement-template parser, so the two never drift).
|
| |
| constexpr ast | parse (std::string_view pattern, flags initial_flags=flags::none) |
| | Parses pattern into an ast (convenience over parser).
|
| |
| constexpr bool | is_any_non_ascii (const std::vector< code_range > &ranges) |
| | Whether ranges is exactly the whole non-ASCII space [U+0080, U+10FFFF] — the "any non-ASCII code point" shape emitted by the compact compiler::emit_codepoint_class.
|
| |
| constexpr class_def | unicode_casefold (const class_def &in) |
| | Expands a character class to its Unicode simple case-fold closure (text-mode icase).
|
| |
| constexpr dynamic_program | compile (const ast &tree, flags compile_flags) |
| | Compiles tree to an NFA program (convenience over compiler).
|
| |
| constexpr inner_literal | extract_inner_literal (const ast &tree) |
| | Extract the best required inner literal from a pattern's AST (a pure function on the node pool). Returns an empty inner_literal when the pattern declines. Inert: nothing routes on it yet.
|
| |
| ast | build_prefix_ast (const ast &tree, std::int32_t count) |
| | Build the prefix sub-AST: the first count top-level concat children (count >= 1). Copies the tree and truncates the root concat's child chain after the count-th child — the later children become unreferenced and are simply never reached when it is compiled.
|
| |
| std::size_t | prefix_reverse_start (const ast &tree, std::int32_t count, flags compile_flags, std::string_view text, std::size_t h, std::size_t min_start) |
| | The match start for a literal candidate at h: reverse-match the prefix (the first count top-level children) ending at h, bounded below by min_start. count == 0 means the literal is at the head, so the reverse is the identity (the match starts at the candidate). Returns npos when the prefix cannot reach a start (an orphan candidate). Runtime only — the reverse DFA is not constexpr; a static_regex would keep the inner-literal path dynamic.
|
| |
| constexpr std::size_t | 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).
|
| |
| constexpr bool | is_gc_cp (gc_property prop, char32_t cp) |
| | Whether cp is in the General_Category property prop (== the UCD).
|
| |
| constexpr gc_property | resolve_gc (std::string_view loose) |
| | Resolve a loose-normalized General_Category name to its property, or count if unknown.
|
| |
| constexpr bool | cp_in_ranges (std::span< const code_range > ranges, char32_t cp) |
| | Binary-searches a sorted, non-overlapping range table for cp. Returns a bool (not a pointer into the table) so it stays constant-evaluable on every compiler.
|
| |
| constexpr bool | is_word_cp (char32_t cp) |
| | Whether cp is a Unicode word / digit / whitespace code point (== re \w/\d/\s).
|
| |
| constexpr bool | is_digit_cp (char32_t cp) |
| |
| constexpr bool | is_space_cp (char32_t cp) |
| |
| constexpr script | script_of (char32_t cp) |
| | The Script of cp (binary search; Unknown when no range covers it).
|
| |
| constexpr bool | is_script_cp (script sc, char32_t cp) |
| | Whether cp belongs to Script sc (== the UCD).
|
| |
| constexpr script | resolve_script (std::string_view loose) |
| | Resolve a loose-normalized Script name to its value, or count if unknown.
|
| |
| constexpr decoded_codepoint | decode_codepoint_strict (std::string_view text, std::size_t pos) |
| | Strictly decodes and validates the UTF-8 sequence at text[pos].
|
| |
| constexpr std::size_t | codepoint_advance (std::string_view text, std::size_t pos) |
| | Number of bytes from pos to the next code-point boundary, for advancing past an empty match during iteration.
|
| |
|
| constexpr std::size_t | max_program_size {262144} |
| | Maximum number of NFA instructions in a compiled program.
|
| |
| constexpr std::int32_t | max_repeat_count {1000} |
| | Per-quantifier bounded-repeat cap, enforced at parse time.
|
| |
| constexpr std::int32_t | max_group_count {32766} |
| | Maximum capture groups; bounds slot_count = 2 * (groups + 1).
|
| |
| constexpr std::int32_t | max_nesting_depth {200} |
| | Maximum parser recursion depth; prevents stack overflow on deep nesting.
|
| |
| constexpr std::int32_t | max_lookaround_length {255} |
| | Maximum bytes a bounded lookaround sub-pattern may consume (its L_max). Bounds the per-position lookaround evaluation, preserving linear time.
|
| |
| constexpr std::size_t | max_dfa_states {65536} |
| | Maximum DFA states (opt-in real::dfa). Subset construction is 2^NFA in the worst case; this caps it so a pathological pattern throws real::dfa_error instead of exhausting memory. Generous: real lexer DFAs use far fewer.
|
| |
| constexpr std::uint32_t | dfa_no_rule {std::numeric_limits<std::uint32_t>::max()} |
| |
| constexpr std::size_t | inner_literal_max {16} |
| | The most bytes an inner literal keeps (a longer memmem target is diminishing returns and storage).
|
| |
| constexpr const char * | unicode_fold_unidata_version {"16.0.0"} |
| | The Unicode data version these orbits were generated from (16.0.0).
|
| |
| constexpr fold_entry | unicode_fold_table [] |
| | Fold orbits, sorted by fold_entry::cp for binary search.
|
| |
| constexpr std::size_t | unicode_fold_table_size {2940} |
| | Number of entries in unicode_fold_table.
|
| |
| constexpr const char * | unicode_property_unidata_version {"16.0.0"} |
| | The Unicode data version these tables were generated from (16.0.0).
|
| |
| constexpr code_range | gc_Lu_ranges [] |
| | \p{Lu} — 651 ranges, 1858 code points.
|
| |
| constexpr code_range | gc_Ll_ranges [] |
| | \p{Ll} — 662 ranges, 2258 code points.
|
| |
| constexpr code_range | gc_Lt_ranges [] |
| | \p{Lt} — 10 ranges, 31 code points.
|
| |
| constexpr code_range | gc_Lm_ranges [] |
| | \p{Lm} — 75 ranges, 404 code points.
|
| |
| constexpr code_range | gc_Lo_ranges [] |
| | \p{Lo} — 528 ranges, 136477 code points.
|
| |
| constexpr code_range | gc_Mn_ranges [] |
| | \p{Mn} — 357 ranges, 2020 code points.
|
| |
| constexpr code_range | gc_Mc_ranges [] |
| | \p{Mc} — 190 ranges, 468 code points.
|
| |
| constexpr code_range | gc_Me_ranges [] |
| | \p{Me} — 5 ranges, 13 code points.
|
| |
| constexpr code_range | gc_Nd_ranges [] |
| | \p{Nd} — 71 ranges, 760 code points.
|
| |
| constexpr code_range | gc_Nl_ranges [] |
| | \p{Nl} — 12 ranges, 236 code points.
|
| |
| constexpr code_range | gc_No_ranges [] |
| | \p{No} — 72 ranges, 915 code points.
|
| |
| constexpr code_range | gc_Pc_ranges [] |
| | \p{Pc} — 6 ranges, 10 code points.
|
| |
| constexpr code_range | gc_Pd_ranges [] |
| | \p{Pd} — 20 ranges, 27 code points.
|
| |
| constexpr code_range | gc_Ps_ranges [] |
| | \p{Ps} — 79 ranges, 79 code points.
|
| |
| constexpr code_range | gc_Pe_ranges [] |
| | \p{Pe} — 76 ranges, 77 code points.
|
| |
| constexpr code_range | gc_Pi_ranges [] |
| | \p{Pi} — 11 ranges, 12 code points.
|
| |
| constexpr code_range | gc_Pf_ranges [] |
| | \p{Pf} — 10 ranges, 10 code points.
|
| |
| constexpr code_range | gc_Po_ranges [] |
| | \p{Po} — 193 ranges, 640 code points.
|
| |
| constexpr code_range | gc_Sm_ranges [] |
| | \p{Sm} — 65 ranges, 950 code points.
|
| |
| constexpr code_range | gc_Sc_ranges [] |
| | \p{Sc} — 21 ranges, 63 code points.
|
| |
| constexpr code_range | gc_Sk_ranges [] |
| | \p{Sk} — 31 ranges, 125 code points.
|
| |
| constexpr code_range | gc_So_ranges [] |
| | \p{So} — 187 ranges, 7376 code points.
|
| |
| constexpr code_range | gc_Zs_ranges [] |
| | \p{Zs} — 7 ranges, 17 code points.
|
| |
| constexpr code_range | gc_Zl_ranges [] |
| | \p{Zl} — 1 ranges, 1 code points.
|
| |
| constexpr code_range | gc_Zp_ranges [] |
| | \p{Zp} — 1 ranges, 1 code points.
|
| |
| constexpr code_range | gc_Cc_ranges [] |
| | \p{Cc} — 2 ranges, 65 code points.
|
| |
| constexpr code_range | gc_Cf_ranges [] |
| | \p{Cf} — 21 ranges, 170 code points.
|
| |
| constexpr code_range | gc_Co_ranges [] |
| | \p{Co} — 3 ranges, 137468 code points.
|
| |
| constexpr code_range | gc_Cn_ranges [] |
| | \p{Cn} — 731 ranges, 819533 code points.
|
| |
| constexpr code_range | gc_L_ranges [] |
| | \p{L} — 677 ranges, 141028 code points.
|
| |
| constexpr code_range | gc_M_ranges [] |
| | \p{M} — 321 ranges, 2501 code points.
|
| |
| constexpr code_range | gc_N_ranges [] |
| | \p{N} — 144 ranges, 1911 code points.
|
| |
| constexpr code_range | gc_P_ranges [] |
| | \p{P} — 198 ranges, 855 code points.
|
| |
| constexpr code_range | gc_S_ranges [] |
| | \p{S} — 236 ranges, 8514 code points.
|
| |
| constexpr code_range | gc_Z_ranges [] |
| | \p{Z} — 8 ranges, 19 code points.
|
| |
| constexpr code_range | gc_C_ranges [] |
| | \p{C} — 737 ranges, 957236 code points.
|
| |
| constexpr std::span< const code_range > | gc_property_ranges [] |
| | Range table indexed by gc_property (parallel to the enum order).
|
| |
| constexpr gc_alias_entry | gc_aliases [] |
| | Short codes (Lu) and long names (Uppercase_Letter), loose-keyed; for the \p{...} parser.
|
| |
| constexpr const char * | unicode_props_unidata_version {"16.0.0"} |
| | The Unicode data version these tables were generated from (16.0.0).
|
| |
| constexpr code_range | word_ranges [] |
| | Code-point ranges matched by \w (771 ranges, 142940 code points).
|
| |
| constexpr std::size_t | word_ranges_size {771} |
| |
| constexpr code_range | digit_ranges [] |
| | Code-point ranges matched by \d (71 ranges, 760 code points).
|
| |
| constexpr std::size_t | digit_ranges_size {71} |
| |
| constexpr code_range | space_ranges [] |
| | Code-point ranges matched by \s (10 ranges, 29 code points).
|
| |
| constexpr std::size_t | space_ranges_size {10} |
| |
| constexpr const char * | unicode_script_unidata_version {"16.0.0"} |
| | The Unicode data version these tables were generated from (16.0.0).
|
| |
| constexpr script_range | script_ranges [] |
| | Script partition — 979 ranges, sorted and disjoint.
|
| |
| constexpr script_alias_entry | script_aliases [] |
| | Script names, loose-keyed; for the \p{sc=...} parser.
|
| |