/// Lower an AST expression as a port expression.
///
/// ```plain
/// port_expression ::= port_reference | "{" port_reference {"," port_reference} "}"
/// ```
Lower an AST expression as a port expression.
Lower an AST expression as a port expression .
fn lower_port_expr<'gcx>(
    cx: &impl Context<'gcx>,
    expr: &'gcx ast::Expr<'gcx>,
    parent: NodeId,
) -> Vec<PartialPortExpr> {
    match &expr.data {
        ast::ConcatExpr {
            repeat: None,
            exprs,
        } => exprs
            .iter()
            .flat_map(|expr| lower_port_ref(cx, expr, parent))
            .collect(),
        _ => lower_port_ref(cx, expr, parent).into_iter().collect(),
    }
}
fn lower_port_expr < ' gcx > ( cx : & impl Context < ' gcx > , expr : & ' gcx ast :: Expr < ' gcx > , parent : NodeId , ) -> Vec < PartialPortExpr > { match & expr . data { ast :: ConcatExpr { repeat : None , exprs , } => exprs . iter ( ) . flat_map ( | expr | lower_port_ref ( cx , expr , parent ) ) . collect ( ) , _ => lower_port_ref ( cx , expr , parent ) . into_iter ( ) . collect ( ) , } }
Lower an AST expression as a port expression.
Lower an AST expression as a port expression .
cx
&impl Context<'gcx>
expr
&'gcx ast::Expr<'gcx>
parent
NodeId