Skip to main content

parse_one_compound_block

Function parse_one_compound_block 

Source
fn parse_one_compound_block(s: &str) -> (Option<CompoundSpec>, usize)
Expand description

Parse a single leading Name(p: Ptr, T: Ty, ...) { body } block from s. Returns the CompoundSpec (without doc) and the number of bytes consumed through the closing }.

The block is emitted by the pred! proc-macro as a single line of space-separated tokens, so parameter names and role annotations (Ptr, Ty, Expr, Ident) are split on : and , after trimming whitespace. The braces delimit the body, so nested ==/<= inside a ValidNum predicate cannot be confused with a definition separator.