pub struct Lexer;
Expand description
The OBO format version 1.4 lexer.
Implementations§
source§impl OboLexer
impl OboLexer
sourcepub fn tokenize(rule: Rule, input: &str) -> Result<Pairs<'_, Rule>, Error<Rule>>
pub fn tokenize(rule: Rule, input: &str) -> Result<Pairs<'_, Rule>, Error<Rule>>
Tokenize an input string using the given production rule.
This is basically a specialized version of pest::Parser::parse
that only accepts Rule
, and does not need the Parser
trait to
be in scope.
sourcepub fn tokenize_all(
rule: Rule,
input: &str
) -> Result<Pairs<'_, Rule>, Error<Rule>>
pub fn tokenize_all( rule: Rule, input: &str ) -> Result<Pairs<'_, Rule>, Error<Rule>>
Tokenize the entirety of an input string.
Contrary to OboLexer::tokenize
, this method will return an error if
if the input is not parsed in its entirety.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for OboLexer
impl Send for OboLexer
impl Sync for OboLexer
impl Unpin for OboLexer
impl UnwindSafe for OboLexer
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