aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-01-28 05:13:18 +0000
committerVeetaha <[email protected]>2020-02-03 22:00:55 +0000
commitb1764d85fced5f3bc1db82063fca9369f9e1740b (patch)
tree0f722e395a03184b37f58b23d1f587cb9eeedef4 /crates/ra_syntax
parent9e7eaa959f9dc368a55f1a80b35651b78b3d0883 (diff)
ra_syntax: fixed a typo in doc comment
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/parsing/lexer.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs
index 55755be18..d1315e604 100644
--- a/crates/ra_syntax/src/parsing/lexer.rs
+++ b/crates/ra_syntax/src/parsing/lexer.rs
@@ -69,7 +69,7 @@ pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option<SyntaxEr
69 .map(|(token, error)| (token.kind, error)) 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/// returns `None` if any tokenization error occured. 73/// returns `None` if any tokenization error occured.
74/// 74///
75/// Beware that unescape errors are not checked at tokenization time. 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 .map(|(token, _error)| token.kind) 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/// Returns `None` if the string contains zero tokens or if the token was parsed 85/// Returns `None` if the string contains zero tokens or if the token was parsed
85/// with an error. 86/// with an error.
87/// The token is malformed if the returned error is not `None`.
86/// 88///
87/// Beware that unescape errors are not checked at tokenization time. 89/// Beware that unescape errors are not checked at tokenization time.
88fn first_token(text: &str) -> Option<(Token, Option<SyntaxError>)> { 90fn first_token(text: &str) -> Option<(Token, Option<SyntaxError>)> {