pub struct Syntax { /* private fields */ }
Expand description
Onig Syntax Wrapper
Each syntax dfines a flavour of regex syntax. This type allows
interaction with the built-in syntaxes through the static accessor
functions (Syntax::emacs()
, Syntax::default()
etc.) and the
creation of custom syntaxes.
For a demonstration of creating a custom syntax see
examples/syntax.rs
in the main onig crate.
Implementations§
Source§impl Syntax
impl Syntax
Sourcepub fn posix_basic() -> &'static Syntax
pub fn posix_basic() -> &'static Syntax
POSIX Basic RE syntax
Sourcepub fn posix_extended() -> &'static Syntax
pub fn posix_extended() -> &'static Syntax
POSIX Extended RE syntax
Sourcepub fn operators(&self) -> SyntaxOperator
pub fn operators(&self) -> SyntaxOperator
Retrieve the operators for this syntax
Sourcepub fn set_operators(&mut self, operators: SyntaxOperator)
pub fn set_operators(&mut self, operators: SyntaxOperator)
Replace the operators for this syntax
Sourcepub fn enable_operators(&mut self, operators: SyntaxOperator)
pub fn enable_operators(&mut self, operators: SyntaxOperator)
Enable Operators for this Syntax
Updates the operators for this syntax to enable the chosen ones.
Sourcepub fn disable_operators(&mut self, operators: SyntaxOperator)
pub fn disable_operators(&mut self, operators: SyntaxOperator)
Disable Operators for this Syntax
Updates the operators for this syntax to remove the specified operators.
Sourcepub fn behavior(&self) -> SyntaxBehavior
pub fn behavior(&self) -> SyntaxBehavior
Retrieves the syntax behaviours
Sourcepub fn set_behavior(&mut self, behavior: SyntaxBehavior)
pub fn set_behavior(&mut self, behavior: SyntaxBehavior)
Overwrite the syntax behaviour for this syntax.
Sourcepub fn enable_behavior(&mut self, behavior: SyntaxBehavior)
pub fn enable_behavior(&mut self, behavior: SyntaxBehavior)
Enable a given behaviour for this syntax
Sourcepub fn disable_behavior(&mut self, behavior: SyntaxBehavior)
pub fn disable_behavior(&mut self, behavior: SyntaxBehavior)
Disable a given behaviour for this syntax
Sourcepub fn options(&self) -> RegexOptions
pub fn options(&self) -> RegexOptions
Retireve the syntax options for this syntax
Sourcepub fn set_options(&mut self, options: RegexOptions)
pub fn set_options(&mut self, options: RegexOptions)
Replace the syntax options for this syntax
Sourcepub fn set_meta_char(&mut self, what: MetaCharType, meta: MetaChar)
pub fn set_meta_char(&mut self, what: MetaCharType, meta: MetaChar)
Set a given meta character’s state
Arguments:
what
: The meta character to updatemeta
: The value to set the meta character to