Skip to main content

try_match_single_line_comment

Function try_match_single_line_comment 

Source
pub fn try_match_single_line_comment(lexer: &Lexer) -> Option<(usize, TokenTy)>
Available on crate feature lexer only.
Expand description

Attempt to match a single line comment from the start of the Lexer::remaining fragment.

Returns None if there is no single line comment at the start of the remaining source. Otherwise returns the number of bytes in the comment (not including the line ending) and the kind of comment:

Generally I’m trying to follow the rust comment spec here.