pub struct Cursor<'a> { /* private fields */ }Expand description
Peekable iterator over a char sequence.
Next characters can be peeked via first method,
and position can be shifted forward via bump method.
Implementations§
Source§impl<'a> Cursor<'a>
impl<'a> Cursor<'a>
pub fn new( input: &'a str, frontmatter_allowed: FrontmatterAllowed, ) -> Cursor<'a>
pub fn as_str(&self) -> &'a str
Source§impl Cursor<'_>
impl Cursor<'_>
Sourcepub fn advance_token(&mut self) -> Token
pub fn advance_token(&mut self) -> Token
Parses a token from the input string.
Sourcepub fn guarded_double_quoted_string(&mut self) -> Option<GuardedStr>
pub fn guarded_double_quoted_string(&mut self) -> Option<GuardedStr>
Attempt to lex for a guarded string literal.
Used by rustc_parse::lexer to lex for guarded strings
conditionally based on edition.
Note: this will not reset the Cursor when a
guarded string is not found. It is the caller’s
responsibility to do so.