libexpr: move lambdas to auxiliary storage

Change-Id: Ibe4885f17c0ba1634ed6dbca0a45f8bd4619d69b
This commit is contained in:
eldritch horrors
2025-09-28 00:02:20 +02:00
parent 6e242e8b9b
commit 002dfbb2e3
4 changed files with 30 additions and 26 deletions
+4 -4
View File
@@ -110,6 +110,7 @@ TEST_F(ValuePrintingTests, vApp)
TEST_F(ValuePrintingTests, vLambda)
{
EvalMemory mem;
Env env {
.up = nullptr,
.values = { }
@@ -120,8 +121,7 @@ TEST_F(ValuePrintingTests, vLambda)
ExprLambda eLambda(posIdx, std::make_unique<AttrsPattern>(), std::make_unique<ExprLiteral>(noPos, NewValueAs::integer, 0));
eLambda.pattern->name = createSymbol("a");
Value vLambda;
vLambda.mkLambda(&env, &eLambda);
Value vLambda{NewValueAs::lambda, mem, env, eLambda};
test(vLambda, "«lambda @ «none»:1:1»");
@@ -546,6 +546,7 @@ TEST_F(ValuePrintingTests, ansiColorsList)
TEST_F(ValuePrintingTests, ansiColorsLambda)
{
EvalMemory mem;
Env env {
.up = nullptr,
.values = { }
@@ -556,8 +557,7 @@ TEST_F(ValuePrintingTests, ansiColorsLambda)
ExprLambda eLambda(posIdx, std::make_unique<AttrsPattern>(), std::make_unique<ExprLiteral>(noPos, NewValueAs::integer, 0));
eLambda.pattern->name = createSymbol("a");
Value vLambda;
vLambda.mkLambda(&env, &eLambda);
Value vLambda{NewValueAs::lambda, mem, env, eLambda};
test(vLambda,
ANSI_BLUE "«lambda @ «none»:1:1»" ANSI_NORMAL,