pub fn parse_package_inst<P: Parser>(
    p: &mut P,
    with_semicolon: bool,
) -> ReportedResult<ast::PkgInst> {
    let mut span = p.peek(0).span;
    require(p, Keyword(Kw::Package))?;
    let name = parse_ident(p, "package name")?;
    require(p, Keyword(Kw::Is))?;
    require(p, Keyword(Kw::New))?;
    let pkg = parse_name(p)?;
    let gm = try_map_aspect(p, Kw::Generic)?;
    if with_semicolon {
        require(p, Semicolon)?;
    }
    span.expand(p.last_span());
    Ok(ast::PkgInst {
        id: Default::default(),
        span: span,
        name: name,
        target: pkg,
        generics: gm,
    })
}
/// Parse a package instantiation declaration. See IEEE 1076-2008 section 4.9.
///
/// ```text
/// package_inst := "package" ident "is" "new" name [generic_map] ";"
/// ```
Parse a package instantiation declaration.
Parse a package instantiation declaration .
pub fn parse_package_inst<P: Parser>(
    p: &mut P,
    with_semicolon: bool,
) -> ReportedResult<ast::PkgInst> {
    let mut span = p.peek(0).span;
    require(p, Keyword(Kw::Package))?;
    let name = parse_ident(p, "package name")?;
    require(p, Keyword(Kw::Is))?;
    require(p, Keyword(Kw::New))?;
    let pkg = parse_name(p)?;
    let gm = try_map_aspect(p, Kw::Generic)?;
    if with_semicolon {
        require(p, Semicolon)?;
    }
    span.expand(p.last_span());
    Ok(ast::PkgInst {
        id: Default::default(),
        span: span,
        name: name,
        target: pkg,
        generics: gm,
    })
}
pub fn parse_package_inst < P : Parser > ( p : & mut P , with_semicolon : bool , ) -> ReportedResult < ast :: PkgInst > { let mut span = p . peek ( 0 ) . span ; require ( p , Keyword ( Kw :: Package ) ) ? ; let name = parse_ident ( p , " " ) ? ; require ( p , Keyword ( Kw :: Is ) ) ? ; require ( p , Keyword ( Kw :: New ) ) ? ; let pkg = parse_name ( p ) ? ; let gm = try_map_aspect ( p , Kw :: Generic ) ? ; if with_semicolon { require ( p , Semicolon ) ? ; } span . expand ( p . last_span ( ) ) ; Ok ( ast :: PkgInst { id : Default :: default ( ) , span : span , name : name , target : pkg , generics : gm , } ) }
Parse a package instantiation declaration.
Parse a package instantiation declaration .
p
&mut P
with_semicolon
bool
p
&mut P
with_semicolon
bool