[][src]Function ra_ap_syntax::lex_single_syntax_kind

pub fn lex_single_syntax_kind(
    text: &str
) -> Option<(SyntaxKind, Option<SyntaxError>)>

Returns SyntaxKind and Option<SyntaxError> of the first token encountered at the beginning of the string.

Returns None if the string contains zero or two or more tokens. The token is malformed if the returned error is not None.

Beware that unescape errors are not checked at tokenization time.