Skip to content

Commit 58e01d8

Browse files
author
Veetaha
committed
ra_syntax: rename first_token() -> lex_first_token()
1 parent b1764d8 commit 58e01d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/ra_syntax/src/parsing/lexer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn tokenize(text: &str) -> (Vec<Token>, Vec<SyntaxError>) {
6464
///
6565
/// Beware that unescape errors are not checked at tokenization time.
6666
pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option<SyntaxError>)> {
67-
first_token(text)
67+
lex_first_token(text)
6868
.filter(|(token, _)| token.len.to_usize() == text.len())
6969
.map(|(token, error)| (token.kind, error))
7070
}
@@ -74,7 +74,7 @@ pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option<SyntaxEr
7474
///
7575
/// Beware that unescape errors are not checked at tokenization time.
7676
pub fn lex_single_valid_syntax_kind(text: &str) -> Option<SyntaxKind> {
77-
first_token(text)
77+
lex_first_token(text)
7878
.filter(|(token, error)| !error.is_some() && token.len.to_usize() == text.len())
7979
.map(|(token, _error)| token.kind)
8080
}
@@ -87,7 +87,7 @@ pub fn lex_single_valid_syntax_kind(text: &str) -> Option<SyntaxKind> {
8787
/// The token is malformed if the returned error is not `None`.
8888
///
8989
/// Beware that unescape errors are not checked at tokenization time.
90-
fn first_token(text: &str) -> Option<(Token, Option<SyntaxError>)> {
90+
fn lex_first_token(text: &str) -> Option<(Token, Option<SyntaxError>)> {
9191
// non-empty string is a precondtion of `rustc_lexer::first_token()`.
9292
if text.is_empty() {
9393
return None;

0 commit comments

Comments
 (0)