pub struct Lex<'a> {
pub searches: u32,
/* private fields */
}Expand description
A monotonically advancing scan of one byte buffer.
Once a */ search fails, no later comment opener can have a closer, so
remembering that result keeps malformed-input scanning linear.
Fields§
§searches: u32*/ searches performed. At most one can fail.
Implementations§
Source§impl<'a> Lex<'a>
impl<'a> Lex<'a>
pub fn new(bytes: &'a [u8]) -> Self
Sourcepub fn skip_lexical_at(&mut self, i: usize) -> Option<usize>
pub fn skip_lexical_at(&mut self, i: usize) -> Option<usize>
If a string literal or comment starts at bytes[i], return the index
just past it. Doubled apostrophes remain inside the literal.
Sourcepub fn skip_trivia(&mut self, i: usize) -> usize
pub fn skip_trivia(&mut self, i: usize) -> usize
Advance past whitespace and closed comments.
Auto Trait Implementations§
impl<'a> Freeze for Lex<'a>
impl<'a> RefUnwindSafe for Lex<'a>
impl<'a> Send for Lex<'a>
impl<'a> Sync for Lex<'a>
impl<'a> Unpin for Lex<'a>
impl<'a> UnwindSafe for Lex<'a>
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