mirror of
https://github.com/NixOS/nix
synced 2025-06-29 14:53:16 +02:00
Introduce AbstractPos
This commit is contained in:
parent
a04ca0a522
commit
9e9170a92e
21 changed files with 158 additions and 182 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue