pub fn try_generic_clause<P: Parser>(
    p: &mut P,
) -> ReportedResult<Option<Spanned<Vec<ast::IntfDecl>>>> {
    if p.peek(0).value == Keyword(Kw::Generic) && p.peek(1).value != Keyword(Kw::Map) {
        p.bump();
        let mut span = p.last_span();
        let i = flanked(p, Paren, |p| {
            Ok(separated_nonempty(
                p,
                Semicolon,
                CloseDelim(Paren),
                "generic interface declaration",
                |p| parse_intf_decl(p, Some(ast::IntfObjKind::Const)),
            )?)
        })?;
        require(p, Semicolon)?;
        span.expand(p.last_span());
        Ok(Some(Spanned::new(i, span)))
    } else {
        Ok(None)
    }
}
/// Try to parse a generic clause. See IEEE 1076-2008 section 6.5.6.2.
///
/// ```text
/// generic_clause := "generic" "clause" "(" {intf_decl}";"+ ")" ";"
/// ```
Try to parse a generic clause.
Try to parse a generic clause .
pub fn try_generic_clause<P: Parser>(
    p: &mut P,
) -> ReportedResult<Option<Spanned<Vec<ast::IntfDecl>>>> {
    if p.peek(0).value == Keyword(Kw::Generic) && p.peek(1).value != Keyword(Kw::Map) {
        p.bump();
        let mut span = p.last_span();
        let i = flanked(p, Paren, |p| {
            Ok(separated_nonempty(
                p,
                Semicolon,
                CloseDelim(Paren),
                "generic interface declaration",
                |p| parse_intf_decl(p, Some(ast::IntfObjKind::Const)),
            )?)
        })?;
        require(p, Semicolon)?;
        span.expand(p.last_span());
        Ok(Some(Spanned::new(i, span)))
    } else {
        Ok(None)
    }
}
pub fn try_generic_clause < P : Parser > ( p : & mut P , ) -> ReportedResult < Option < Spanned < Vec < ast :: IntfDecl > > > > { if p . peek ( 0 ) . value == Keyword ( Kw :: Generic ) && p . peek ( 1 ) . value != Keyword ( Kw :: Map ) { p . bump ( ) ; let mut span = p . last_span ( ) ; let i = flanked ( p , Paren , | p | { Ok ( separated_nonempty ( p , Semicolon , CloseDelim ( Paren ) , " " , | p | parse_intf_decl ( p , Some ( ast :: IntfObjKind :: Const ) ) , ) ? ) } ) ? ; require ( p , Semicolon ) ? ; span . expand ( p . last_span ( ) ) ; Ok ( Some ( Spanned :: new ( i , span ) ) ) } else { Ok ( None ) } }
Try to parse a generic clause.
Try to parse a generic clause .
p
&mut P
p
&mut P