pub struct Expr(/* private fields */);Expand description
A parsed pomsky expression, which might contain more sub-expressions.
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn parse(
input: &str,
) -> (Option<Self>, impl Iterator<Item = Diagnostic> + '_)
pub fn parse( input: &str, ) -> (Option<Self>, impl Iterator<Item = Diagnostic> + '_)
Parse a Expr without generating code.
The parsed Expr can be displayed with Debug if the dbg feature is
enabled.
Sourcepub fn compile(
&self,
input: &str,
options: CompileOptions,
) -> (Option<String>, Vec<Diagnostic>)
pub fn compile( &self, input: &str, options: CompileOptions, ) -> (Option<String>, Vec<Diagnostic>)
Compile a Expr that has been parsed, to a regex
Sourcepub fn extract_tests(self) -> Vec<Test>
pub fn extract_tests(self) -> Vec<Test>
Extracts top-level all unit tests from the Pomsky expression
Sourcepub fn extract_tests_ref(&self) -> Vec<&Test>
pub fn extract_tests_ref(&self) -> Vec<&Test>
Extracts top-level all unit tests from the Pomsky expression
Sourcepub fn parse_and_compile(
input: &str,
options: CompileOptions,
) -> (Option<String>, Vec<Diagnostic>, Vec<Test>)
pub fn parse_and_compile( input: &str, options: CompileOptions, ) -> (Option<String>, Vec<Diagnostic>, Vec<Test>)
Parse a string to a Expr and compile it to a regex.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more