minor: dead code

This commit is contained in:
Aleksey Kladov 2021-12-12 20:41:04 +03:00
parent 7f28b49759
commit 958f20ff84
2 changed files with 1 additions and 13 deletions

View file

@ -48,7 +48,7 @@ use text_edit::Indel;
pub use crate::{
ast::{AstNode, AstToken},
parsing::lexer::{lex_single_syntax_kind, lex_single_valid_syntax_kind, tokenize, Token},
parsing::lexer::{lex_single_syntax_kind, tokenize, Token},
ptr::{AstPtr, SyntaxNodePtr},
syntax_error::SyntaxError,
syntax_node::{

View file

@ -75,18 +75,6 @@ pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option<SyntaxEr
Some((first_token.kind, err))
}
/// The same as `lex_single_syntax_kind()` but returns only `SyntaxKind` and
/// returns `None` if any tokenization error occurred.
///
/// Beware that unescape errors are not checked at tokenization time.
pub fn lex_single_valid_syntax_kind(text: &str) -> Option<SyntaxKind> {
let (single_token, err) = lex_single_syntax_kind(text)?;
if err.is_some() {
return None;
}
Some(single_token)
}
/// Returns `SyntaxKind` and `Option<SyntaxError>` of the first token
/// encountered at the beginning of the string.
///