mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
libexpr: Split out MakeBinOpMembers from MakeBinOp
This commit is contained in:
parent
73d3ab05b6
commit
e282175f48
1 changed files with 33 additions and 30 deletions
|
|
@ -574,9 +574,7 @@ struct ExprOpNot : Expr
|
||||||
COMMON_METHODS
|
COMMON_METHODS
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MakeBinOp(name, s) \
|
#define MakeBinOpMembers(name, s) \
|
||||||
struct name : Expr \
|
|
||||||
{ \
|
|
||||||
PosIdx pos; \
|
PosIdx pos; \
|
||||||
Expr *e1, *e2; \
|
Expr *e1, *e2; \
|
||||||
name(Expr * e1, Expr * e2) \
|
name(Expr * e1, Expr * e2) \
|
||||||
|
|
@ -603,9 +601,14 @@ struct ExprOpNot : Expr
|
||||||
PosIdx getPos() const override \
|
PosIdx getPos() const override \
|
||||||
{ \
|
{ \
|
||||||
return pos; \
|
return pos; \
|
||||||
} \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MakeBinOp(name, s) \
|
||||||
|
struct name : Expr \
|
||||||
|
{ \
|
||||||
|
MakeBinOpMembers(name, s) \
|
||||||
|
};
|
||||||
|
|
||||||
MakeBinOp(ExprOpEq, "==");
|
MakeBinOp(ExprOpEq, "==");
|
||||||
MakeBinOp(ExprOpNEq, "!=");
|
MakeBinOp(ExprOpNEq, "!=");
|
||||||
MakeBinOp(ExprOpAnd, "&&");
|
MakeBinOp(ExprOpAnd, "&&");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue