1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

comment cleanup

This commit is contained in:
Ben Burdette 2020-04-06 20:14:48 -06:00
parent ec449c8450
commit 55c96b64e4
2 changed files with 23 additions and 153 deletions

View file

@ -191,98 +191,6 @@ private:
}
};
/*
template <class T>
class AddPos : private T
{
public:
template <class P>
T& pos(const P &aPos)
{
GetEI().ensureNixCode().nixFile = aPos.file;
GetEI().ensureNixCode().ensureErrLine().lineNumber = aPos.line;
GetEI().ensureNixCode().ensureErrLine().columnRange = { .start = aPos.column, .len = 1 };
return *this;
}
protected:
ErrorInfo& GetEI()
{
return T::GetEI();
}
};
template <class T>
class AddLOC : private T
{
public:
T& linesOfCode(std::optional<string> prevloc, string loc, std::optional<string> nextloc)
{
GetEI().ensureNixCode().ensureErrLine().prevLineOfCode = prevloc;
GetEI().ensureNixCode().ensureErrLine().errLineOfCode = loc;
GetEI().ensureNixCode().ensureErrLine().nextLineOfCode = nextloc;
return *this;
}
protected:
ErrorInfo& GetEI()
{
return T::GetEI();
}
};
*/
/*
// the template layer for adding a hint.
template <class T>
class AddHint : private T
{
public:
T& hint(const hintformat &hf)
{
GetEI().hint = std::optional(hf.str());
return *this;
}
T& nohint()
{
GetEI().hint = std::nullopt;
return *this;
}
protected:
ErrorInfo& GetEI()
{
return T::GetEI();
}
};
*/
// --------------------------------------------------------
// error types
/*typedef AddName<
AddDescription<
AddHint<
EIError>>> ProgramError;
typedef AddName<
AddDescription<
AddHint<
EIWarning>>> ProgramWarning;
typedef AddName<
AddDescription<
AddPos<
AddLOC<
AddHint<
EIError>>>>> NixLangError;
typedef AddName<
AddDescription<
AddPos<
AddLOC<
AddHint<
EIWarning>>>>> NixLangWarning;
*/
// --------------------------------------------------------
// error printing