Permalink
Browse files

Wrap the "if (ctx->handling) return;" check in a macro for readability

  • Loading branch information...
bsdphk committed Jan 9, 2019
1 parent 3e15c14 commit 64e2ba27932aefcd5ab4754bf11c28563fe5e7f4
Showing with 4 additions and 2 deletions.
  1. +2 −0 lib/libvcc/vcc_compile.c
  2. +2 −2 lib/libvcc/vcc_parse.c
@@ -579,6 +579,8 @@ vcc_CompileSource(struct vcc *tl, struct source *sp)
Fh(tl, 0, "/* ---===### VCC generated .h code ###===---*/\n");
Fc(tl, 0, "\n/* ---===### VCC generated .c code ###===---*/\n");

Fc(tl, 0, "\n#define END_ if (*ctx->handling) return\n");

vcc_Parse_Init(tl);

vcc_Expr_Init(tl);
@@ -149,7 +149,7 @@ vcc_Compound(struct vcc *tl)
Fb(tl, 1, "{\n");
tl->indent += INDENT;
C(tl, ";");
Fb(tl, 1, "if (*ctx->handling) return;\n");
Fb(tl, 1, "END_;\n");
while (1) {
ERRCHK(tl);
t = tl->t;
@@ -206,7 +206,7 @@ vcc_Compound(struct vcc *tl)
vcc_ErrWhere(tl, tl->t);
return;
}
Fb(tl, 1, "if (*ctx->handling) return;\n");
Fb(tl, 1, "END_;\n");
}
}

0 comments on commit 64e2ba2

Please sign in to comment.