File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
crates/ra_syntax/src/parsing Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option<SyntaxEr
69
69
. map ( |( token, error) | ( token. kind , error) )
70
70
}
71
71
72
- /// The same as `single_syntax_kind ()` but returns only `SyntaxKind` and
72
+ /// The same as `lex_single_syntax_kind ()` but returns only `SyntaxKind` and
73
73
/// returns `None` if any tokenization error occured.
74
74
///
75
75
/// Beware that unescape errors are not checked at tokenization time.
@@ -79,10 +79,12 @@ pub fn lex_single_valid_syntax_kind(text: &str) -> Option<SyntaxKind> {
79
79
. map ( |( token, _error) | token. kind )
80
80
}
81
81
82
- /// Returns the first encountered token at the beginning of the string.
82
+ /// Returns `SyntaxKind` and `Option<SyntaxError>` of the first token
83
+ /// encountered at the beginning of the string.
83
84
///
84
85
/// Returns `None` if the string contains zero tokens or if the token was parsed
85
86
/// with an error.
87
+ /// The token is malformed if the returned error is not `None`.
86
88
///
87
89
/// Beware that unescape errors are not checked at tokenization time.
88
90
fn first_token ( text : & str ) -> Option < ( Token , Option < SyntaxError > ) > {
You can’t perform that action at this time.
0 commit comments