size_t parens = 0;
size_t i;
- while (true) {
+ while (ftepp->token != ')') {
mp.tokens = NULL;
while (parens || ftepp->token != ',') {
if (ftepp->token == '(')
if (!ftepp_macro_call_params(ftepp, ¶ms))
return false;
+ if (vec_size(params) != vec_size(macro->params)) {
+ ftepp_error(ftepp, "macro %s expects %u paramteters, %u provided", macro->name,
+ (unsigned int)vec_size(macro->params),
+ (unsigned int)vec_size(params));
+ retval = false;
+ goto cleanup;
+ }
+
+
ftepp_out(ftepp, "Parsed macro parameters", false);
goto cleanup;