Make most calls to determinePos() lazy

This commit is contained in:
Eelco Dolstra
2022-02-04 00:33:21 +01:00
parent 4c755c3b3f
commit bd383d1b6f
10 changed files with 46 additions and 24 deletions
+9 -1
View File
@@ -224,6 +224,9 @@ public:
result. Otherwise, this is a no-op. */
inline void forceValue(Value & v, const Pos & pos);
template <typename Callable>
inline void forceValue(Value & v, Callable getPos);
/* Force a value, then recursively force list elements and
attributes. */
void forceValueDeep(Value & v);
@@ -232,7 +235,12 @@ public:
NixInt forceInt(Value & v, const Pos & pos);
NixFloat forceFloat(Value & v, const Pos & pos);
bool forceBool(Value & v, const Pos & pos);
inline void forceAttrs(Value & v, const Pos & pos);
void forceAttrs(Value & v, const Pos & pos);
template <typename Callable>
inline void forceAttrs(Value & v, Callable getPos);
inline void forceList(Value & v, const Pos & pos);
void forceFunction(Value & v, const Pos & pos); // either lambda or primop
std::string_view forceString(Value & v, const Pos & pos = noPos);