mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
handle parameters in parser_find_local
This commit is contained in:
parent
a99972d7dd
commit
b70fd7e238
1 changed files with 6 additions and 0 deletions
6
parser.c
6
parser.c
|
@ -90,11 +90,17 @@ ast_value* parser_find_global(parser_t *parser, const char *name)
|
|||
ast_value* parser_find_local(parser_t *parser, const char *name, size_t upto)
|
||||
{
|
||||
size_t i;
|
||||
ast_value *fun;
|
||||
for (i = parser->locals_count; i > upto;) {
|
||||
--i;
|
||||
if (!strcmp(parser->locals[i]->name, name))
|
||||
return parser->locals[i];
|
||||
}
|
||||
fun = parser->function->vtype;
|
||||
for (i = 0; i < fun->params_count; ++i) {
|
||||
if (!strcmp(fun->params[i]->name, name))
|
||||
return fun->params[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue