/// Parse an optional label, which basically is just an identifier followed by
/// a colon. This is interesting for statement parsing. See IEEE 1076-2008
/// section 10.
Parse an optional label, which basically is just an identifier followed by
a colon. This is interesting for statement parsing.
Parse an optional label which basically is just an identifier followed by a colon . This is interesting for statement parsing .
pub fn try_label<P: Parser>(p: &mut P) -> Option<Spanned<Name>> {
    if let (
        Spanned {
            value: Ident(n),
            span,
        },
        Colon,
    ) = (p.peek(0), p.peek(1).value)
    {
        p.bump();
        p.bump();
        Some(Spanned::new(n, span))
    } else {
        None
    }
}
pub fn try_label < P : Parser > ( p : & mut P ) -> Option < Spanned < Name > > { if let ( Spanned { value : Ident ( n ) , span , } , Colon , ) = ( p . peek ( 0 ) , p . peek ( 1 ) . value ) { p . bump ( ) ; p . bump ( ) ; Some ( Spanned :: new ( n , span ) ) } else { None } }
Parse an optional label, which basically is just an identifier followed by
a colon.
Parse an optional label which basically is just an identifier followed by a colon .
p
&mut P