Skip to main content

Module scanner

Module scanner 

Source
Expand description

Shared code scanner for skipping string literals, char literals, and comments.

EnumsΒ§

LexState πŸ”’

ConstantsΒ§

RAW_DELIMITER_BYTES πŸ”’

FunctionsΒ§

char_positions πŸ”’
Return the byte offsets of every occurrence of target in line, skipping string and char literals.
code_only πŸ”’
Return a copy of line with string literals, char literals, and trailing // comments stripped out.
directive_source_lines πŸ”’
Hide directive-shaped text that is not a standalone source comment.
line_comment_starts πŸ”’
Return the byte column where each source line’s real // comment starts.
raw_string_close πŸ”’
raw_string_open πŸ”’
skip_char_literal πŸ”’
Skip a character literal, assuming the opening ' is already consumed.
skip_raw_string πŸ”’
Skip past a raw string literal with hashes closing #, opening " already consumed.
skip_string πŸ”’
Skip past a "..." string literal, assuming the opening " is already consumed.
try_skip_raw_string πŸ”’
Consume a raw string prefix and body after an r, true if one was consumed.