Struct rustc_lexer::cursor::Cursor [−][src]
Expand description
Peekable iterator over a char sequence.
Next characters can be peeked via nth_char
method,
and position can be shifted forward via bump
method.
Fields
initial_len: usize
chars: Chars<'a>
prev: char
Implementations
Returns the last eaten symbol (or '\0'
in release builds).
(For debug assertions only.)
Returns nth character relative to the current cursor position.
If requested position doesn’t exist, EOF_CHAR
is returned.
However, getting EOF_CHAR
doesn’t always mean actual end of file,
it should be checked with is_eof
method.
Peeks the next symbol from the input stream without consuming it.
Peeks the second symbol from the input stream without consuming it.
Returns amount of already consumed symbols.
Parses a token from the input string.
Eats double-quoted string and returns true if string is terminated.
pub(crate) fn raw_double_quoted_string(
&mut self,
prefix_len: usize
) -> (u16, Option<RawStrError>)
pub(crate) fn raw_double_quoted_string(
&mut self,
prefix_len: usize
) -> (u16, Option<RawStrError>)
Eats the double-quoted string and returns n_hashes
and an error if encountered.
pub(crate) fn raw_string_unvalidated(
&mut self,
prefix_len: usize
) -> (usize, Option<RawStrError>)
Eats the float exponent. Returns true if at least one digit was met, and returns false otherwise.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Cursor<'a>
impl<'a> UnwindSafe for Cursor<'a>
Blanket Implementations
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes