mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:35 +00:00
Mention that Cursor
is based on rustc's implementation. (#12109)
This commit is contained in:
parent
d1079680bb
commit
f765d19402
2 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,8 @@ use ruff_text_size::{TextLen, TextSize};
|
||||||
pub(crate) const EOF_CHAR: char = '\0';
|
pub(crate) const EOF_CHAR: char = '\0';
|
||||||
|
|
||||||
/// A cursor represents a pointer in the source code.
|
/// A cursor represents a pointer in the source code.
|
||||||
|
///
|
||||||
|
/// Based on [`rustc`'s `Cursor`](https://github.com/rust-lang/rust/blob/d1b7355d3d7b4ead564dbecb1d240fcc74fff21b/compiler/rustc_lexer/src/cursor.rs)
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub(super) struct Cursor<'src> {
|
pub(super) struct Cursor<'src> {
|
||||||
/// An iterator over the [`char`]'s of the source code.
|
/// An iterator over the [`char`]'s of the source code.
|
||||||
|
|
|
@ -5,6 +5,8 @@ use ruff_text_size::{TextLen, TextSize};
|
||||||
pub const EOF_CHAR: char = '\0';
|
pub const EOF_CHAR: char = '\0';
|
||||||
|
|
||||||
/// A [`Cursor`] over a string.
|
/// A [`Cursor`] over a string.
|
||||||
|
///
|
||||||
|
/// Based on [`rustc`'s `Cursor`](https://github.com/rust-lang/rust/blob/d1b7355d3d7b4ead564dbecb1d240fcc74fff21b/compiler/rustc_lexer/src/cursor.rs)
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Cursor<'a> {
|
pub struct Cursor<'a> {
|
||||||
chars: Chars<'a>,
|
chars: Chars<'a>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue