/// Unpack a wave as expression.
///
/// This is useful for variable assignments to ensure that the right hand
/// side is not a signal waveform.
Unpack a wave as expression.
This is useful for variable assignments to ensure that the right hand
side is not a signal waveform.
Unpack a wave as expression . This is useful for variable assignments to ensure that the right hand side is not a signal waveform .
fn unpack_wave_as_expr(&self, ast: &'ast ast::Wave) -> Result<&'ast ast::Expr> {
        if let Some(ref v) = ast.elems {
            if v.len() == 1 && v[0].1.is_none() {
                return Ok(&v[0].0);
            }
        }
        self.emit(
            DiagBuilder2::error(format!(
                "`{}` is not a valid expression",
                ast.span.extract()
            ))
            .span(ast.span),
        );
        Err(())
    }
fn unpack_wave_as_expr ( & self , ast : & ' ast ast :: Wave ) -> Result < & ' ast ast :: Expr > { if let Some ( ref v ) = ast . elems { if v . len ( ) == 1 && v [ 0 ] . 1 . is_none ( ) { return Ok ( & v [ 0 ] . 0 ) ; } } self . emit ( DiagBuilder2 :: error ( format ! ( " " ast span extract ( ) ) ) . span ( ast . span ) , ) ; Err ( ( ) ) }
Unpack a wave as expression.
Unpack a wave as expression .
&self
ast
&'ast ast::Wave