/// Map multiple parenthesis elements to a term.
Map multiple parenthesis elements to a term.
Map multiple parenthesis elements to a term .
pub fn termify_paren_elems(&self, elems: &ast::ParenElems) -> Result<Spanned<Term<'a>>> {
        let is_aggregate = elems.value.iter().any(|e| !e.choices.value.is_empty());
        let term = if is_aggregate {
            Term::Aggregate(
                elems
                    .value
                    .iter()
                    .map(|e| {
                        Ok((
                            e.choices
                                .value
                                .iter()
                                .map(|c| self.termify_expr(c))
                                .collect::<Result<Vec<_>>>()?,
                            self.termify_expr(&e.expr)?,
                        ))
                    })
                    .collect::<Result<Vec<_>>>()?,
            )
        } else {
            Term::Paren(
                elems
                    .value
                    .iter()
                    .map(|e| self.termify_expr(&e.expr))
                    .collect::<Result<Vec<_>>>()?,
            )
        };
        Ok(self.fold(Spanned::new(term, elems.span)))
    }
pub fn termify_paren_elems ( & self , elems : & ast :: ParenElems ) -> Result < Spanned < Term < ' a > > > { let is_aggregate = elems . value . iter ( ) . any ( | e | ! e . choices . value . is_empty ( ) ) ; let term = if is_aggregate { Term :: Aggregate ( elems . value . iter ( ) . map ( | e | { Ok ( ( e . choices . value . iter ( ) . map ( | c | self . termify_expr ( c ) ) . collect :: < Result < Vec < _ > > > ( ) ? , self . termify_expr ( & e . expr ) ? , ) ) } ) . collect :: < Result < Vec < _ > > > ( ) ? , ) } else { Term :: Paren ( elems . value . iter ( ) . map ( | e | self . termify_expr ( & e . expr ) ) . collect :: < Result < Vec < _ > > > ( ) ? , ) } ; Ok ( self . fold ( Spanned :: new ( term , elems . span ) ) ) }
Map multiple parenthesis elements to a term.
Map multiple parenthesis elements to a term .
&self
elems
&ast::ParenElems