mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
REFACTOR: build_assert -> eval_assert for consistency
This commit is contained in:
parent
24a4dc85c2
commit
d354d9e67d
@ -486,7 +486,7 @@ impl<'a> FileBuilder<'a> {
|
|||||||
fn eval_stmt(&mut self, stmt: &Statement) -> Result<Rc<Val>, Box<dyn Error>> {
|
fn eval_stmt(&mut self, stmt: &Statement) -> Result<Rc<Val>, Box<dyn Error>> {
|
||||||
let child_scope = self.scope.clone();
|
let child_scope = self.scope.clone();
|
||||||
match stmt {
|
match stmt {
|
||||||
&Statement::Assert(ref expr) => self.build_assert(&expr, &child_scope),
|
&Statement::Assert(ref expr) => self.eval_assert(&expr, &child_scope),
|
||||||
&Statement::Let(ref def) => self.eval_let(def),
|
&Statement::Let(ref def) => self.eval_let(def),
|
||||||
&Statement::Expression(ref expr) => self.eval_expr(expr, &child_scope),
|
&Statement::Expression(ref expr) => self.eval_expr(expr, &child_scope),
|
||||||
// Only one output can be used per file. Right now we enforce this by
|
// Only one output can be used per file. Right now we enforce this by
|
||||||
@ -1498,11 +1498,7 @@ impl<'a> FileBuilder<'a> {
|
|||||||
self.assert_collector.counter += 1;
|
self.assert_collector.counter += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_assert(
|
fn eval_assert(&mut self, expr: &Expression, scope: &Scope) -> Result<Rc<Val>, Box<dyn Error>> {
|
||||||
&mut self,
|
|
||||||
expr: &Expression,
|
|
||||||
scope: &Scope,
|
|
||||||
) -> Result<Rc<Val>, Box<dyn Error>> {
|
|
||||||
if !self.validate_mode {
|
if !self.validate_mode {
|
||||||
// we are not in validate_mode so build_asserts are noops.
|
// we are not in validate_mode so build_asserts are noops.
|
||||||
return Ok(Rc::new(Val::Empty));
|
return Ok(Rc::new(Val::Empty));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user