]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
add 'X has been declared here:' too the too-few/many-parameters warning/error
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 23 Aug 2012 18:48:51 +0000 (20:48 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 23 Aug 2012 18:48:51 +0000 (20:48 +0200)
parser.c

index 5b84ac29220f37b60851cab4724eaef5cfd459d1..d382dd1e15365d83d0b6ede568eafc0f57a7bb40 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1000,23 +1000,31 @@ static bool parser_close_call(parser_t *parser, shunt *sy)
             if (opts_standard == COMPILER_GMQCC)
             {
                 if (fval)
-                    parseerror(parser, "too %s parameters for call to %s: expected %i, got %i", fewmany,
-                               fval->name, (int)fun->expression.params_count, paramcount);
+                    parseerror(parser, "too %s parameters for call to %s: expected %i, got %i\n"
+                               " -> `%s` has been declared here: %s:%i",
+                               fewmany, fval->name, (int)fun->expression.params_count, (int)paramcount,
+                               fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
                 else
-                    parseerror(parser, "too %s parameters for function call: expected %i, got %i", fewmany,
-                               (int)fun->expression.params_count, paramcount);
+                    parseerror(parser, "too %s parameters for function call: expected %i, got %i\n"
+                               " -> `%s` has been declared here: %s:%i",
+                               fewmany, fval->name, (int)fun->expression.params_count, (int)paramcount,
+                               fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
                 return false;
             }
             else
             {
                 if (fval)
                     return !parsewarning(parser, WARN_TOO_FEW_PARAMETERS,
-                                         "too %s parameters for call to %s: expected %i, got %i", fewmany,
-                                         fval->name, (int)fun->expression.params_count, paramcount);
+                                         "too %s parameters for call to %s: expected %i, got %i\n"
+                                         " -> `%s` has been declared here: %s:%i",
+                                         fewmany, fval->name, (int)fun->expression.params_count, (int)paramcount,
+                                         fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
                 else
                     return !parsewarning(parser, WARN_TOO_FEW_PARAMETERS,
-                                         "too %s parameters for function call: expected %i, got %i", fewmany,
-                                         (int)fun->expression.params_count, paramcount);
+                                         "too %s parameters for function call: expected %i, got %i\n"
+                                         " -> `%s` has been declared here: %s:%i",
+                                         fewmany, fval->name, (int)fun->expression.params_count, (int)paramcount,
+                                         fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
             }
         }
     }