pub fn add_target(
        &self,
        ast: &'ast Spanned<ast::AssignTarget>,
    ) -> Result<Spanned<hir::Target>> {
        let ctx = TermContext::new(self.ctx, self.scope);
        Ok(Spanned::new(
            match ast.value {
                ast::AssignTarget::Name(ref name) => {
                    let term = ctx.termify_compound_name(name)?;
                    hir::Target::Name(ctx.term_to_expr(term)?)
                }
                ast::AssignTarget::Aggregate(ref agg) => {
                    let term = ctx.termify_paren_elems(agg)?;
                    hir::Target::Aggregate(ctx.term_to_aggregate(term)?.value)
                }
            },
            ast.span,
        ))
    }
/// Add a target variable.
///
/// This is an target for a variable assignment.
Add a target variable.
This is an target for a variable assignment.
Add a target variable . This is an target for a variable assignment .
pub fn add_target(
        &self,
        ast: &'ast Spanned<ast::AssignTarget>,
    ) -> Result<Spanned<hir::Target>> {
        let ctx = TermContext::new(self.ctx, self.scope);
        Ok(Spanned::new(
            match ast.value {
                ast::AssignTarget::Name(ref name) => {
                    let term = ctx.termify_compound_name(name)?;
                    hir::Target::Name(ctx.term_to_expr(term)?)
                }
                ast::AssignTarget::Aggregate(ref agg) => {
                    let term = ctx.termify_paren_elems(agg)?;
                    hir::Target::Aggregate(ctx.term_to_aggregate(term)?.value)
                }
            },
            ast.span,
        ))
    }
pub fn add_target ( & self , ast : & ' ast Spanned < ast :: AssignTarget > , ) -> Result < Spanned < hir :: Target > > { let ctx = TermContext :: new ( self . ctx , self . scope ) ; Ok ( Spanned :: new ( match ast . value { ast :: AssignTarget :: Name ( ref name ) => { let term = ctx . termify_compound_name ( name ) ? ; hir :: Target :: Name ( ctx . term_to_expr ( term ) ? ) } ast :: AssignTarget :: Aggregate ( ref agg ) => { let term = ctx . termify_paren_elems ( agg ) ? ; hir :: Target :: Aggregate ( ctx . term_to_aggregate ( term ) ? . value ) } } , ast . span , ) ) }
Add a target variable.
Add a target variable .
&self
ast
&'ast Spanned<ast::AssignTarget>
&self
ast
&'ast Spanned<ast::AssignTarget>