1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 07:31:15 +02:00

Initial frames support

This commit is contained in:
Guillaume Maudoux 2022-10-17 03:05:02 +02:00
parent 3f9f6ae127
commit b945b844a9
5 changed files with 63 additions and 13 deletions

View file

@ -312,6 +312,19 @@ public:
std::string_view forceString(Value & v, PathSet & context, const PosIdx pos, std::string_view errorCtx);
std::string_view forceStringNoCtx(Value & v, const PosIdx pos, std::string_view errorCtx);
template <typename ErrorType>
[[gnu::noinline, gnu::noreturn]]
void throwFrameErrorWithTrace(
PosIdx pos, const char* format,
const std::string_view s1, const std::string_view s2,
const Symbol * sym1, const Symbol * sym2,
Value * val1, Value * val2,
PosIdx pos1,
const std::string_view s3,
const Suggestions * suggestions,
PosIdx tracePos, const std::string_view traceStr,
Env * env, Expr * expr);
template <typename ErrorType>
[[gnu::noinline, gnu::noreturn]]
void throwErrorWithTrace(
@ -340,7 +353,7 @@ public:
[[gnu::noinline]]
void addErrorTrace(Error & e, const char * s, const std::string & s2) const;
[[gnu::noinline]]
void addErrorTrace(Error & e, const PosIdx pos, const char * s, const std::string & s2) const;
void addErrorTrace(Error & e, const PosIdx pos, const char * s, const std::string & s2, bool frame = false) const;
public:
/* Return true iff the value `v' denotes a derivation (i.e. a