Skip to main content

parse_guarded_generic

Function parse_guarded_generic 

Source
fn parse_guarded_generic<'a>(
    line: &'a str,
    following: Lines<'a>,
) -> Option<&'a str>
Expand description

Recognize the generic guards emitted by r_class_formatter and the S4/S7 inherent/trait generators. This is a scan of generated forms, not an R parser: the guard must start at column zero and its first statement must create a generic. Never scan arbitrary indented assignments inside function bodies. Documentation markers cannot stand in for this: noexport / @noRd classes and trait implementations still declare generics without generic-doc markers.