Modified MakeBinOp to no longer produce its name using concatenation and "##".
Doing so prevents emacs tags from working, as well as makes the code extremely confusing for a newbie. In the prior state, if someone wants to find the definition of "ExprApp" for example, a grep through the code reveals nothing. Since the definition could be hiding in numerous ".h" files, it's really difficult to find. This personally took me several hours to figure out.
This commit is contained in:
parent
16551f54c9
commit
383afab9ad
1 changed files with 11 additions and 11 deletions
|
@ -283,12 +283,12 @@ struct ExprOpNot : Expr
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MakeBinOp(name, s) \
|
#define MakeBinOp(name, s) \
|
||||||
struct Expr##name : Expr \
|
struct name : Expr \
|
||||||
{ \
|
{ \
|
||||||
Pos pos; \
|
Pos pos; \
|
||||||
Expr * e1, * e2; \
|
Expr * e1, * e2; \
|
||||||
Expr##name(Expr * e1, Expr * e2) : e1(e1), e2(e2) { }; \
|
name(Expr * e1, Expr * e2) : e1(e1), e2(e2) { }; \
|
||||||
Expr##name(const Pos & pos, Expr * e1, Expr * e2) : pos(pos), e1(e1), e2(e2) { }; \
|
name(const Pos & pos, Expr * e1, Expr * e2) : pos(pos), e1(e1), e2(e2) { }; \
|
||||||
void show(std::ostream & str) \
|
void show(std::ostream & str) \
|
||||||
{ \
|
{ \
|
||||||
str << "(" << *e1 << " " s " " << *e2 << ")"; \
|
str << "(" << *e1 << " " s " " << *e2 << ")"; \
|
||||||
|
@ -300,14 +300,14 @@ struct ExprOpNot : Expr
|
||||||
void eval(EvalState & state, Env & env, Value & v); \
|
void eval(EvalState & state, Env & env, Value & v); \
|
||||||
};
|
};
|
||||||
|
|
||||||
MakeBinOp(App, "")
|
MakeBinOp(ExprApp, "")
|
||||||
MakeBinOp(OpEq, "==")
|
MakeBinOp(ExprOpEq, "==")
|
||||||
MakeBinOp(OpNEq, "!=")
|
MakeBinOp(ExprOpNEq, "!=")
|
||||||
MakeBinOp(OpAnd, "&&")
|
MakeBinOp(ExprOpAnd, "&&")
|
||||||
MakeBinOp(OpOr, "||")
|
MakeBinOp(ExprOpOr, "||")
|
||||||
MakeBinOp(OpImpl, "->")
|
MakeBinOp(ExprOpImpl, "->")
|
||||||
MakeBinOp(OpUpdate, "//")
|
MakeBinOp(ExprOpUpdate, "//")
|
||||||
MakeBinOp(OpConcatLists, "++")
|
MakeBinOp(ExprOpConcatLists, "++")
|
||||||
|
|
||||||
struct ExprConcatStrings : Expr
|
struct ExprConcatStrings : Expr
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue