mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
* "Nix expression" -> "store expression".
* More refactoring.
This commit is contained in:
parent
9f0f020929
commit
ce92d1bf14
20 changed files with 121 additions and 119 deletions
|
@ -91,3 +91,16 @@ ATMatcher & operator >> (ATMatcher & pos, ATermList & out)
|
|||
out = (ATermList) t;
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
Error badTerm(const format & f, ATerm t)
|
||||
{
|
||||
char * s = ATwriteToString(t);
|
||||
if (!s) throw Error("cannot print term");
|
||||
if (strlen(s) > 1000) {
|
||||
int len;
|
||||
s = ATwriteToSharedString(t, &len);
|
||||
if (!s) throw Error("cannot print term");
|
||||
}
|
||||
return Error(format("%1%, in `%2%'") % f.str() % (string) s);
|
||||
}
|
||||
|
|
|
@ -74,4 +74,9 @@ ATMatcher & operator >> (ATMatcher & pos, const string & s);
|
|||
ATMatcher & operator >> (ATMatcher & pos, ATermList & out);
|
||||
|
||||
|
||||
/* Throw an exception with an error message containing the given
|
||||
aterm. */
|
||||
Error badTerm(const format & f, ATerm t);
|
||||
|
||||
|
||||
#endif /* !__ATERM_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue