Skip to main content

Module comments

Module comments 

Source
Available on crate feature lexer only.
Expand description

Implementation of comment token lexing.

Comments are produced as tokens (rather than being discarded) so that the syntax tree produced by the parser is lossless. The parser skips over them.

Constants§

MULTI_LINE_COMMENT_END
The pattern that ends any multi-line comments (including doc comments).
MULTI_LINE_COMMENT_START
The pattern that starts any multi-line comments (including doc comments).
SINGLE_LINE_COMMENT_PREFIX
The pattern that begins any single line comments (including doc comments).

Functions§

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