pub fn try_primary_name<P: Parser>(p: &mut P) -> Option<ast::PrimaryName> {
    let Spanned { value: tkn, span } = p.peek(0);
    let kind = match tkn {
        Ident(n) => ast::PrimaryNameKind::Ident(n),
        Lit(Literal::Char(c)) => ast::PrimaryNameKind::Char(c),
        Lit(Literal::String(s)) => ast::PrimaryNameKind::String(s),
        _ => return None,
    };
    p.bump();
    return Some(ast::PrimaryName {
        id: Default::default(),
        span: span,
        kind: kind,
    });
}
/// Try to parse a primary name. IEEE 1076-2008 section 8.
///
/// ```text
/// primary_name := ident | char_lit | string_lit
/// ```
Try to parse a primary name.
Try to parse a primary name .
pub fn try_primary_name<P: Parser>(p: &mut P) -> Option<ast::PrimaryName> {
    let Spanned { value: tkn, span } = p.peek(0);
    let kind = match tkn {
        Ident(n) => ast::PrimaryNameKind::Ident(n),
        Lit(Literal::Char(c)) => ast::PrimaryNameKind::Char(c),
        Lit(Literal::String(s)) => ast::PrimaryNameKind::String(s),
        _ => return None,
    };
    p.bump();
    return Some(ast::PrimaryName {
        id: Default::default(),
        span: span,
        kind: kind,
    });
}
pub fn try_primary_name < P : Parser > ( p : & mut P ) -> Option < ast :: PrimaryName > { let Spanned { value : tkn , span } = p . peek ( 0 ) ; let kind = match tkn { Ident ( n ) => ast :: PrimaryNameKind :: Ident ( n ) , Lit ( Literal :: Char ( c ) ) => ast :: PrimaryNameKind :: Char ( c ) , Lit ( Literal :: String ( s ) ) => ast :: PrimaryNameKind :: String ( s ) , _ => return None , } ; p . bump ( ) ; return Some ( ast :: PrimaryName { id : Default :: default ( ) , span : span , kind : kind , } ) ; }
Try to parse a primary name.
Try to parse a primary name .
p
&mut P
p
&mut P