1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 14:53:16 +02:00

Introduce AbstractPos

This commit is contained in:
Eelco Dolstra 2022-07-05 15:58:04 +02:00
parent a04ca0a522
commit 9e9170a92e
21 changed files with 158 additions and 182 deletions

View file

@ -21,8 +21,14 @@ MakeError(TypeError, EvalError);
MakeError(UndefinedVarError, Error);
MakeError(MissingArgumentError, EvalError);
/* Position objects. */
// FIXME: change this into a variant?
typedef enum {
foFile,
foStdin,
foString
} FileOrigin;
/* Position objects. */
struct Pos
{
std::string file;
@ -31,6 +37,8 @@ struct Pos
uint32_t column;
explicit operator bool() const { return line > 0; }
operator std::shared_ptr<AbstractPos>() const;
};
class PosIdx {