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

print LOC for stdin, string args

This commit is contained in:
Ben Burdette 2020-05-20 22:18:26 -06:00
parent 85ce455b85
commit 6a420d672c
6 changed files with 97 additions and 36 deletions

View file

@ -32,10 +32,18 @@ typedef enum {
lvlVomit
} Verbosity;
typedef enum {
foFile,
foStdin,
foString
} FileOrigin;
struct ErrPos {
int line = 0;
int column = 0;
string file;
FileOrigin origin;
operator bool() const
{
@ -45,6 +53,7 @@ struct ErrPos {
template <class P>
ErrPos& operator=(const P &pos)
{
origin = pos.origin;
line = pos.line;
column = pos.column;
file = pos.file;