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:
Bruno BELANYI 2020-10-30 19:55:19 +01:00
parent 3b51111ff5
commit 793a6c6f6f
1 changed files with 6 additions and 3 deletions

View File

@ -17,9 +17,12 @@ static const struct {
const enum { ASSOC_LEFT, ASSOC_RIGHT, ASSOC_NONE } assoc;
const enum { OP_INFIX, OP_PREFIX, OP_POSTFIX } fix;
} ops[] = {
# define BINOP(Op, Kind, Prio, Assoc, Fix) { #Op, Kind, Prio, Assoc, Fix },
# define PREOP(Op, Kind, Prio, Assoc, Fix) { #Op, Kind, Prio, Assoc, Fix },
# define POSTOP(Op, Kind, Prio, Assoc, Fix) { #Op, Kind, Prio, Assoc, Fix },
# define BINOP(Op, Kind, Prio, Assoc, Fix) \
[Kind] = { #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"
};