evalexpr: parse: reorder operator table
This change, by not breaking anything, shows that the order of the table *probably* does not matter to the parsing code. This also enables a future refactoring to only use the parts of the tables that are *actually* needed, such as isolating the prefix, infix, or postfix operators when using the table to check a subset of them
This commit is contained in:
parent
3b51111ff5
commit
793a6c6f6f
|
@ -17,9 +17,12 @@ static const struct {
|
||||||
const enum { ASSOC_LEFT, ASSOC_RIGHT, ASSOC_NONE } assoc;
|
const enum { ASSOC_LEFT, ASSOC_RIGHT, ASSOC_NONE } assoc;
|
||||||
const enum { OP_INFIX, OP_PREFIX, OP_POSTFIX } fix;
|
const enum { OP_INFIX, OP_PREFIX, OP_POSTFIX } fix;
|
||||||
} ops[] = {
|
} ops[] = {
|
||||||
# define BINOP(Op, Kind, Prio, Assoc, Fix) { #Op, Kind, Prio, Assoc, Fix },
|
# define BINOP(Op, Kind, Prio, Assoc, Fix) \
|
||||||
# define PREOP(Op, Kind, Prio, Assoc, Fix) { #Op, Kind, Prio, Assoc, Fix },
|
[Kind] = { #Op, Kind, Prio, Assoc, Fix },
|
||||||
# define POSTOP(Op, Kind, Prio, Assoc, Fix) { #Op, Kind, Prio, Assoc, Fix },
|
# define PREOP(Op, Kind, Prio, Assoc, Fix) \
|
||||||
|
[Kind] = { #Op, Kind, Prio, Assoc, Fix },
|
||||||
|
# define POSTOP(Op, Kind, Prio, Assoc, Fix) \
|
||||||
|
[Kind] = { #Op, Kind, Prio, Assoc, Fix },
|
||||||
#include "operators.inc"
|
#include "operators.inc"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue