From b72acfae00e0bcdeff1678f3e34878bdb61214ef Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 22 May 2024 09:45:33 +0200 Subject: [PATCH] Import EvalError. (#1392) --- pil-analyzer/src/condenser.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pil-analyzer/src/condenser.rs b/pil-analyzer/src/condenser.rs index 1f775e90c..68fe16ecd 100644 --- a/pil-analyzer/src/condenser.rs +++ b/pil-analyzer/src/condenser.rs @@ -25,7 +25,7 @@ use powdr_ast::{ use powdr_number::{DegreeType, FieldElement}; use crate::{ - evaluator::{self, Definitions, SymbolLookup, Value}, + evaluator::{self, Definitions, EvalError, SymbolLookup, Value}, statement_processor::Counters, }; @@ -325,7 +325,7 @@ impl<'a, T: FieldElement> SymbolLookup<'a, T> for Condenser<'a, T> { &mut self, name: &'a str, type_args: Option>, - ) -> Result>, evaluator::EvalError> { + ) -> Result>, EvalError> { // Cache already computed values. // Note that the cache is essential because otherwise // we re-evaluate simple values, which users would not expect. @@ -340,15 +340,12 @@ impl<'a, T: FieldElement> SymbolLookup<'a, T> for Condenser<'a, T> { Ok(value) } - fn lookup_public_reference( - &self, - name: &str, - ) -> Result>, evaluator::EvalError> { + fn lookup_public_reference(&self, name: &str) -> Result>, EvalError> { Definitions(self.symbols).lookup_public_reference(name) } - fn degree(&self) -> Result>, evaluator::EvalError> { - let degree = self.degree.ok_or(evaluator::EvalError::DataNotAvailable)?; + fn degree(&self) -> Result>, EvalError> { + let degree = self.degree.ok_or(EvalError::DataNotAvailable)?; Ok(Value::Integer(degree.into()).into()) } @@ -356,7 +353,7 @@ impl<'a, T: FieldElement> SymbolLookup<'a, T> for Condenser<'a, T> { &mut self, name: &str, source: SourceRef, - ) -> Result>, evaluator::EvalError> { + ) -> Result>, EvalError> { let name = self.find_unused_name(name); let symbol = Symbol { id: self.next_witness_id, @@ -383,7 +380,7 @@ impl<'a, T: FieldElement> SymbolLookup<'a, T> for Condenser<'a, T> { &mut self, constraints: Arc>, source: SourceRef, - ) -> Result<(), evaluator::EvalError> { + ) -> Result<(), EvalError> { match constraints.as_ref() { Value::Array(items) => { for item in items {