git.delta.rocks / jrsonnet / refs/commits / eeb6fd058496

difftreelog

fix lazy object comprehension

Yaroslav Bolyukin2023-12-14parent: #e7b9349.patch.diff
in: master

2 files changed

modifiedcmds/jrsonnet/Cargo.tomldiffbeforeafterboth
--- a/cmds/jrsonnet/Cargo.toml
+++ b/cmds/jrsonnet/Cargo.toml
@@ -15,6 +15,7 @@
     "exp-object-iteration",
     "exp-bigint",
     "exp-apply",
+    "exp-regex",
 ]
 # Use mimalloc as allocator
 mimalloc = ["mimallocator"]
modifiedcrates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth
596 ArrComp(expr, comp_specs) => {596 ArrComp(expr, comp_specs) => {
597 let mut out = Vec::new();597 let mut out = Vec::new();
598 evaluate_comp(ctx, comp_specs, &mut |ctx| {598 evaluate_comp(ctx, comp_specs, &mut |ctx| {
599 #[derive(Trace)]
600 struct EvaluateThunk {
601 ctx: Context,
602 expr: LocExpr,
603 }
604 impl ThunkValue for EvaluateThunk {
605 type Output = Val;
606 fn get(self: Box<Self>) -> Result<Val> {
607 evaluate(self.ctx, &self.expr)
608 }
609 }
599 out.push(evaluate(ctx, expr)?);610 out.push(Thunk::new(EvaluateThunk {
611 ctx,
612 expr: expr.clone(),
613 }));
600 Ok(())614 Ok(())
601 })?;615 })?;
602 Val::Arr(ArrValue::eager(out))616 Val::Arr(ArrValue::lazy(out))
603 }617 }
604 Obj(body) => Val::Obj(evaluate_object(ctx, body)?),618 Obj(body) => Val::Obj(evaluate_object(ctx, body)?),
605 ObjExtend(a, b) => evaluate_add_op(619 ObjExtend(a, b) => evaluate_add_op(