/// Parse a generate for statement. See IEEE 1076-2008 section 11.8.
///
/// ```text
/// generate_for_stmt := "for" ident "in" expr "generate" generate_body "end" "generate" [ident] ";"
/// ```
Parse a generate for statement.
Parse a generate for statement .
pub fn parse_for_generate_stmt<P: Parser>(
    p: &mut P,
    label: Option<Spanned<Name>>,
) -> ReportedResult<ast::StmtData> {
    require(p, Keyword(Kw::For))?;
    let param = parse_ident(p, "loop parameter name")?;
    require(p, Keyword(Kw::In))?;
    let range = parse_expr(p)?;
    require(p, Keyword(Kw::Generate))?;
    let body = parse_generate_body(p, label, Keyword(Kw::End))?;
    require(p, Keyword(Kw::End))?;
    require(p, Keyword(Kw::Generate))?;
    parse_optional_matching_ident(p, label, "generate statement", "section 11.8");
    require(p, Semicolon)?;
    Ok(ast::ForGenStmt {
        param: param.into(),
        range: range,
        body: body,
    })
}
pub fn parse_for_generate_stmt < P : Parser > ( p : & mut P , label : Option < Spanned < Name > > , ) -> ReportedResult < ast :: StmtData > { require ( p , Keyword ( Kw :: For ) ) ? ; let param = parse_ident ( p , " " ) ? ; require ( p , Keyword ( Kw :: In ) ) ? ; let range = parse_expr ( p ) ? ; require ( p , Keyword ( Kw :: Generate ) ) ? ; let body = parse_generate_body ( p , label , Keyword ( Kw :: End ) ) ? ; require ( p , Keyword ( Kw :: End ) ) ? ; require ( p , Keyword ( Kw :: Generate ) ) ? ; parse_optional_matching_ident ( p , label , " " , " " ) ; require ( p , Semicolon ) ? ; Ok ( ast :: ForGenStmt { param : param . into ( ) , range : range , body : body , } ) }
Parse a generate for statement.
Parse a generate for statement .
p
&mut P
label
Option<Spanned<Name>>