1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
use Debug;
use crateCtor;
use crateHandler;
use crateContext;
use crateMatch;
use crateError;
use crateRegex;
use crateSpan;
use impl_not_for_regex;
///
/// A zero-width regex combinator that always succeeds without consuming any input.
///
/// [`EmptyRegex`] is a fundamental building block that matches the empty string at any position
/// in the input stream. It always succeeds (never fails) and consumes zero elements, making it
/// ideal for building optional patterns, zero-width assertions, and serving as a neutral element
/// in parser composition. Unlike position-constrained anchors (e.g., [`AnchorEnd`](crate::regex::AnchorEnd)), [`EmptyRegex`]
/// succeeds at every position regardless of context.
///
/// # Regex
///
/// - **Always succeeds** at any position in the input stream
/// - **Zero-width match**: Returns span with length 0 at current position
/// - **No consumption**: Parser position remains unchanged after match
/// - **No failure cases**: Never returns an error (not even at input end)
///
/// # Ctor
///
/// Uses identical matching logic as regex mode, then constructs a value from the result.
///
/// # Example
/// ```
/// # use neure::prelude::*;
/// #
/// # fn main() -> Result<(), Box<dyn core::error::Error>> {
/// let parser = regex::empty();
/// let mut ctx = BytesCtx::new(b"rust is so awesome!");
///
/// assert_eq!(ctx.try_mat(&parser)?, Span::new(0, 0));
/// # Ok(())
/// # }
/// ```
;
impl_not_for_regex!;
///
/// A zero-width regex combinator that always succeeds without consuming any input.
///
/// # Example
///
/// ```
/// # use neure::prelude::*;
/// #
/// # fn main() -> Result<(), Box<dyn core::error::Error>> {
/// let empty = regex::empty();
/// let mut ctx = CharsCtx::new("aabbccgg");
///
/// assert_eq!(ctx.try_mat(&empty)?, Span::new(0, 0));
///
/// # Ok(())
/// # }
/// ```
pub const