Skip to main content

Module parse

Module parse 

Source
Expand description

Shared winnow-based parsers for source code patterns.

StructsΒ§

Directive πŸ”’
A parsed #t(...) suppression directive with its scope, rules, and reason text.

EnumsΒ§

DirectiveResult πŸ”’
Outcome of parsing a candidate directive line: valid, missing reason, or malformed.
Scope πŸ”’
Scope of a tidy suppression directive.

ConstantsΒ§

DIRECTIVE_PREFIX πŸ”’

FunctionsΒ§

balanced_extract πŸ”’
Find prefix(...) in a line with balanced parentheses.
char_after_slashes πŸ”’
Parse the character immediately after the // prefix on a trimmed line.
comment_content πŸ”’
Strip any comment prefix (///, //!, //) from a trimmed line, None if not a comment.
directive πŸ”’
Parse a tidy suppression directive from a source line, None if it is not one.
doc_comment_content πŸ”’
Strip a doc comment prefix (/// or //!) from a trimmed line, None if not a doc comment.
find_comment_start πŸ”’
Return the portion of line starting from a // comment (may be inline).
find_keyword_suffix πŸ”’
Find keyword in haystack and return the substring following it, or None if not found.
find_url πŸ”’
Check whether a string contains an http(s) URL, returning the start position.
has_inline_comment πŸ”’
Return true if the line contains a // comment anywhere after code.
is_allow_attr πŸ”’
Return true if the line starts with #[allow( or #![allow(.
is_comment πŸ”’
Return true if a trimmed line starts with //.
matches πŸ”’
Check if a parser matches the start of input without consuming it.
parse_scope πŸ”’
prose_comment_content πŸ”’
Extract comment text after a // prefix, "" for bare //, None if not a // comment.
redundant_field_name πŸ”’
Extract the field name from a redundant field initializer violation message.
rewrite_directive_rules πŸ”’
Rewrite only a directive’s target list while preserving its surrounding syntax.
try_parse πŸ”’
Try to consume parser from input, advancing it on success.