1 Subject: parse.y: macro cleanup
5 source/parse.y | 33 ++++++++++++++++++++++++++++-----
6 1 file changed, 28 insertions(+), 5 deletions(-)
8 diff --quilt old/source/parse.y new/source/parse.y
10 +++ new/source/parse.y
14 /* Macros to add error processing to AddOp and AddSym calls */
15 -#define ADD_OP(op) if (!AddOp(op, &ErrMsg)) return 1
16 -#define ADD_SYM(sym) if (!AddSym(sym, &ErrMsg)) return 1
17 -#define ADD_IMMED(val) if (!AddImmediate(val, &ErrMsg)) return 1
18 -#define ADD_BR_OFF(to) if (!AddBranchOffset(to, &ErrMsg)) return 1
19 -#define SET_BR_OFF(from, to) ((from)->value) = ((Inst *)(to)) - ((Inst *)(from))
22 + if (!AddOp(op, &ErrMsg)) { \
26 +#define ADD_SYM(sym) \
28 + if (!AddSym(sym, &ErrMsg)) { \
32 +#define ADD_IMMED(val) \
34 + if (!AddImmediate(val, &ErrMsg)) { \
38 +#define ADD_BR_OFF(to) \
40 + if (!AddBranchOffset(to, &ErrMsg)) { \
44 +#define SET_BR_OFF(from, to) \
46 + ((from)->value) = ((Inst *)(to)) - ((Inst *)(from)); \
49 /* Max. length for a string constant (... there shouldn't be a maximum) */
50 #define MAX_STRING_CONST_LEN 5000