mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
make throw*Error member functions of EvalState
when we introduce position and symbol tables we'll need to do lookups to turn indices into those tables into actual positions/symbols. having the error functions as members of EvalState will avoid a lot of churn for adding lookups into the tables for each caller.
This commit is contained in:
parent
39df15fb8e
commit
34b72775cf
3 changed files with 82 additions and 41 deletions
|
@ -249,6 +249,45 @@ public:
|
|||
std::string_view forceString(Value & v, PathSet & context, const Pos & pos = noPos);
|
||||
std::string_view forceStringNoCtx(Value & v, const Pos & pos = noPos);
|
||||
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwEvalError(const Pos & pos, const char * s) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwTypeError(const Pos & pos, const char * s, const Value & v) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwEvalError(const char * s, const std::string & s2) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwEvalError(const Pos & pos, const Suggestions & suggestions, const char * s,
|
||||
const std::string & s2) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwEvalError(const Pos & pos, const char * s, const std::string & s2) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwEvalError(const char * s, const std::string & s2, const std::string & s3) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwEvalError(const Pos & pos, const char * s, const std::string & s2, const std::string & s3) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwEvalError(const Pos & p1, const char * s, const Symbol & sym, const Pos & p2) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwTypeError(const Pos & pos, const char * s) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwTypeError(const Pos & pos, const char * s, const ExprLambda & fun, const Symbol & s2) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwTypeError(const Pos & pos, const Suggestions & suggestions, const char * s,
|
||||
const ExprLambda & fun, const Symbol & s2) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwTypeError(const char * s, const Value & v) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwAssertionError(const Pos & pos, const char * s, const std::string & s1) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwUndefinedVarError(const Pos & pos, const char * s, const std::string & s1) const;
|
||||
[[gnu::noinline, gnu::noreturn]]
|
||||
void throwMissingArgumentError(const Pos & pos, const char * s, const std::string & s1) const;
|
||||
|
||||
[[gnu::noinline]]
|
||||
void addErrorTrace(Error & e, const char * s, const std::string & s2) const;
|
||||
[[gnu::noinline]]
|
||||
void addErrorTrace(Error & e, const Pos & pos, const char * s, const std::string & s2) const;
|
||||
|
||||
public:
|
||||
/* Return true iff the value `v' denotes a derivation (i.e. a
|
||||
set with attribute `type = "derivation"'). */
|
||||
bool isDerivation(Value & v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue