mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
ra_syntax: remove code duplication and token reevaluation from ast::Literal::kind()
This commit is contained in:
parent
b982d60a4d
commit
3ec781d4f2
2 changed files with 23 additions and 33 deletions
|
@ -27,7 +27,7 @@ pub use syntax_kind::SyntaxKind;
|
|||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct ParseError(pub String);
|
||||
|
||||
/// `TokenSource` abstracts the source of the tokens parser operates one.
|
||||
/// `TokenSource` abstracts the source of the tokens parser operates on.
|
||||
///
|
||||
/// Hopefully this will allow us to treat text and token trees in the same way!
|
||||
pub trait TokenSource {
|
||||
|
@ -43,7 +43,7 @@ pub trait TokenSource {
|
|||
fn is_keyword(&self, kw: &str) -> bool;
|
||||
}
|
||||
|
||||
/// `TokenCursor` abstracts the cursor of `TokenSource` operates one.
|
||||
/// `Token` abstracts the cursor of `TokenSource` operates on.
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||
pub struct Token {
|
||||
/// What is the current token?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue