aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-03-05 14:20:25 +0100
committerpennae <github@quasiparticle.net>2022-04-21 21:25:18 +0200
commitff0fd91ed23ae9d851bf27c4df3ec77f7028699b (patch)
treea9107f76daeacec74f9695678c9db429e789ec41 /src/libexpr/nixexpr.cc
parent90b5c0a1a67c31a3f2553fef110417e4ba1b635d (diff)
remove Symbol::empty
the only use of this function is to determine whether a lambda has a non-set formal, but this use is arguably better served by Symbol::set and using a non-Symbol instead of an empty symbol in the parser when no such formal is present.
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index a2def65a6..bf01935a9 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -144,9 +144,9 @@ void ExprLambda::show(std::ostream & str) const
str << "...";
}
str << " }";
- if (!arg.empty()) str << " @ ";
+ if (arg.set()) str << " @ ";
}
- if (!arg.empty()) str << arg;
+ if (arg.set()) str << arg;
str << ": " << *body << ")";
}
@@ -364,11 +364,11 @@ void ExprLambda::bindVars(const StaticEnv & env)
StaticEnv newEnv(
false, &env,
(hasFormals() ? formals->formals.size() : 0) +
- (arg.empty() ? 0 : 1));
+ (!arg.set() ? 0 : 1));
Displacement displ = 0;
- if (!arg.empty()) newEnv.vars.emplace_back(arg, displ++);
+ if (arg.set()) newEnv.vars.emplace_back(arg, displ++);
if (hasFormals()) {
for (auto & i : formals->formals)