/// Evaluate to an ir value.
Evaluate to an ir value.
Evaluate to an ir value .
pub(crate) fn eval_value(&mut self, ir: &ir::Ir, used: Used) -> Result<IrValue, IrError> {
        match self.eval(ir, used) {
            Ok(ir_value) => Ok(ir_value),
            Err(outcome) => match outcome {
                IrEvalOutcome::Error(error) => Err(error),
                IrEvalOutcome::NotConst(span) => Err(IrError::new(span, IrErrorKind::NotConst)),
                IrEvalOutcome::Break(span, _) => {
                    Err(IrError::new(span, IrErrorKind::BreakOutsideOfLoop))
                }
            },
        }
    }
pub ( crate ) fn eval_value ( & mut self , ir : & ir :: Ir , used : Used ) -> Result < IrValue , IrError > { match self . eval ( ir , used ) { Ok ( ir_value ) => Ok ( ir_value ) , Err ( outcome ) => match outcome { IrEvalOutcome :: Error ( error ) => Err ( error ) , IrEvalOutcome :: NotConst ( span ) => Err ( IrError :: new ( span , IrErrorKind :: NotConst ) ) , IrEvalOutcome :: Break ( span , _ ) => { Err ( IrError :: new ( span , IrErrorKind :: BreakOutsideOfLoop ) ) } } , } }
Evaluate to an ir value.
Evaluate to an ir value .
&mut self
ir
&ir::Ir
used
Used