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Β§
- Directive
Result π - 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,Noneif not a comment. - directive π
- Parse a tidy suppression directive from a source line,
Noneif it is not one. - doc_
comment_ πcontent - Strip a doc comment prefix (
///or//!) from a trimmed line,Noneif not a doc comment. - find_
comment_ πstart - Return the portion of
linestarting from a//comment (may be inline). - find_
keyword_ πsuffix - Find
keywordinhaystackand return the substring following it, orNoneif not found. - find_
url π - Check whether a string contains an http(s) URL, returning the start position.
- has_
inline_ πcomment - Return
trueif the line contains a//comment anywhere after code. - is_
allow_ πattr - Return
trueif the line starts with#[allow(or#![allow(. - is_
comment π - Return
trueif a trimmed line starts with//. - matches π
- Check if a parser matches the start of
inputwithout consuming it. - parse_
scope π - prose_
comment_ πcontent - Extract comment text after a
//prefix,""for bare//,Noneif not a//comment. - redundant_
field_ πname - Extract the field name from a
redundant field initializerviolation message. - rewrite_
directive_ πrules - Rewrite only a directiveβs target list while preserving its surrounding syntax.
- try_
parse π - Try to consume
parserfrominput, advancing it on success.