From 5b91c2af5ee78a1293177cc96922f24fdfbf8aa4 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 16 Nov 2012 21:37:34 +0100 Subject: [PATCH] Relax the preprocessor condition: # in the middle of a line also counts, but take care of builtin numbers since they use # as well --- ftepp.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ftepp.c b/ftepp.c index fe3b783..1ac8a4c 100644 --- a/ftepp.c +++ b/ftepp.c @@ -359,6 +359,11 @@ on_error: return false; } +static bool ftepp_macro_expand(ftepp_t *ftepp, ppmacro *macro, macroparam *params) +{ + return true; +} + static bool ftepp_macro_call(ftepp_t *ftepp, ppmacro *macro) { size_t o; @@ -394,9 +399,8 @@ static bool ftepp_macro_call(ftepp_t *ftepp, ppmacro *macro) goto cleanup; } - - ftepp_out(ftepp, "Parsed macro parameters", false); - goto cleanup; + if (!ftepp_macro_expand(ftepp, macro, params)) + retval = false; cleanup: for (o = 0; o < vec_size(params); ++o) @@ -719,6 +723,12 @@ static bool ftepp_hash(ftepp_t *ftepp) case TOKEN_EOF: ftepp_error(ftepp, "missing newline at end of file", ftepp_tokval(ftepp)); return false; + + /* Builtins! Don't forget the builtins! */ + case TOKEN_INTCONST: + case TOKEN_FLOATCONST: + ftepp_out(ftepp, "#", false); + return true; } if (!ftepp_skipspace(ftepp)) return false; @@ -739,9 +749,13 @@ static bool ftepp_preprocess(ftepp_t *ftepp) { if (ftepp->token >= TOKEN_EOF) break; - +#if 0 ftepp->newline = newline; newline = false; +#else + /* For the sake of FTE compatibility... FU, really */ + ftepp->newline = newline = true; +#endif switch (ftepp->token) { case TOKEN_KEYWORD: -- 2.39.2