1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 01:11:15 +02:00

add pos to errorinfo, remove from hints

This commit is contained in:
Ben Burdette 2020-05-08 18:18:28 -06:00
parent 1b801cec40
commit 55eb717148
13 changed files with 507 additions and 194 deletions

View file

@ -35,10 +35,15 @@ typedef enum {
} Verbosity;
struct ErrPos {
int line;
int column;
int line = 0;
int column = 0;
string file;
operator bool() const
{
return line != 0;
}
template <class P>
ErrPos& operator=(const P &pos)
{
@ -58,7 +63,7 @@ struct ErrPos {
struct NixCode {
ErrPos errPos;
std::optional<string> prevLineOfCode;
string errLineOfCode;
std::optional<string> errLineOfCode;
std::optional<string> nextLineOfCode;
};