libexpr: move symbols into own struct

not all of these are even used by eval itself. notably sWith wasn't used
at all, sEpsilon was only used by the eval cache one layer up, and other
attributes are used in places even further away from eval itself. we can
keep this commingling for now, but eventually we should clean it up too.

Change-Id: I5684ac614361bf008e04472130c6c02082b4c2d7
This commit is contained in:
eldritch horrors
2024-11-27 02:09:08 +01:00
parent f017f9ddd3
commit 7af000ddff
20 changed files with 183 additions and 183 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ void emitTreeAttrs(
auto attrs = state.buildBindings(10);
state.mkStorePathString(tree.storePath, attrs.alloc(state.sOutPath));
state.mkStorePathString(tree.storePath, attrs.alloc(state.s.outPath));
// FIXME: support arbitrary input attributes.
@@ -122,7 +122,7 @@ static void fetchTree(
fetchers::Attrs attrs;
if (auto aType = args[0]->attrs->get(state.sType)) {
if (auto aType = args[0]->attrs->get(state.s.type)) {
if (type)
state.error<EvalError>(
"unexpected attribute 'type'"
@@ -136,7 +136,7 @@ static void fetchTree(
attrs.emplace("type", type.value());
for (auto & attr : *args[0]->attrs) {
if (attr.name == state.sType) continue;
if (attr.name == state.s.type) continue;
state.forceValue(*attr.value, attr.pos);
if (attr.value->type() == nPath || attr.value->type() == nString) {
auto s = state.coerceToString(attr.pos, *attr.value, context, "", false, false).toOwned();