diff options
author | Michal Krol <[email protected]> | 2009-11-17 09:06:53 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2009-11-17 09:06:53 +0100 |
commit | 547ac2869b1e1bbdbf8e51cd40d50e6ab0f4f9f1 (patch) | |
tree | bca42c7d6ce627cd04b841d43e73b153128b8454 /src/glsl | |
parent | eaa34c2deac093fc23e2beed9c5580e57289b1e2 (diff) |
glsl/pp: Fix macro formal argument parsing, more descriptive error msgs.
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/pp/sl_pp_define.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c index d18a7ee2895..e004c9f95b9 100644 --- a/src/glsl/pp/sl_pp_define.c +++ b/src/glsl/pp/sl_pp_define.c @@ -60,7 +60,7 @@ _parse_formal_args(struct sl_pp_context *context, return 0; } } else { - strcpy(context->error_msg, "expected either an identifier or `)'"); + strcpy(context->error_msg, "expected either macro formal argument or `)'"); return -1; } @@ -68,7 +68,7 @@ _parse_formal_args(struct sl_pp_context *context, for (;;) { if (*first < last && input[*first].token != SL_PP_IDENTIFIER) { - strcpy(context->error_msg, "expected an identifier"); + strcpy(context->error_msg, "expected macro formal argument"); return -1; } @@ -90,6 +90,7 @@ _parse_formal_args(struct sl_pp_context *context, if (*first < last) { if (input[*first].token == SL_PP_COMMA) { (*first)++; + skip_whitespace(input, first, last); } else if (input[*first].token == SL_PP_RPAREN) { (*first)++; return 0; @@ -124,7 +125,7 @@ sl_pp_process_define(struct sl_pp_context *context, first++; } if (macro_name == -1) { - strcpy(context->error_msg, "expected an identifier"); + strcpy(context->error_msg, "expected macro name"); return -1; } |