mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
internal: move all the lexing to the parser crate
This commit is contained in:
parent
78926027e3
commit
a022ad68c9
16 changed files with 159 additions and 467 deletions
|
@ -28,7 +28,7 @@ use hir::{AsAssocItem, FieldSource, HasSource, InFile, ModuleSource, Semantics};
|
|||
use stdx::never;
|
||||
use syntax::{
|
||||
ast::{self, HasName},
|
||||
lex_single_syntax_kind, AstNode, SyntaxKind, TextRange, T,
|
||||
AstNode, SyntaxKind, TextRange, T,
|
||||
};
|
||||
use text_edit::{TextEdit, TextEditBuilder};
|
||||
|
||||
|
@ -490,7 +490,7 @@ pub enum IdentifierKind {
|
|||
|
||||
impl IdentifierKind {
|
||||
pub fn classify(new_name: &str) -> Result<IdentifierKind> {
|
||||
match lex_single_syntax_kind(new_name) {
|
||||
match parser::LexedStr::single_token(new_name) {
|
||||
Some(res) => match res {
|
||||
(SyntaxKind::IDENT, _) => Ok(IdentifierKind::Ident),
|
||||
(T![_], _) => Ok(IdentifierKind::Underscore),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue