return true;
}
+static void ftepp_out(ftepp_t *ftepp, const char *str)
+{
+ if (!vec_size(ftepp->conditions) ||
+ vec_last(ftepp->conditions).on)
+ {
+ printf("%s", str);
+ }
+}
+
static bool ftepp_preprocess(ftepp_t *ftepp)
{
bool newline = true;
switch (ftepp->token) {
case '#':
if (!ftepp->newline) {
- printf("%s", ftepp_tokval(ftepp));
+ ftepp_out(ftepp, ftepp_tokval(ftepp));
ftepp_next(ftepp);
break;
}
break;
case TOKEN_EOL:
newline = true;
- printf("\n");
+ ftepp_out(ftepp, "\n");
ftepp_next(ftepp);
break;
default:
- printf("%s", ftepp_tokval(ftepp));
+ ftepp_out(ftepp, ftepp_tokval(ftepp));
ftepp_next(ftepp);
break;
}