mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-30 15:41:12 +00:00
Proto for parsing a function body
This commit is contained in:
parent
f4864fd5ac
commit
4360d3b5be
1 changed files with 11 additions and 0 deletions
11
parser.c
11
parser.c
|
@ -134,6 +134,11 @@ ast_value *parser_parse_type(parser_t *parser, bool *isfunc)
|
||||||
return var;
|
return var;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool parser_parse_body(parser_t *parser)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool parser_do(parser_t *parser)
|
bool parser_do(parser_t *parser)
|
||||||
{
|
{
|
||||||
if (parser->tok == TOKEN_TYPENAME)
|
if (parser->tok == TOKEN_TYPENAME)
|
||||||
|
@ -233,6 +238,12 @@ bool parser_do(parser_t *parser)
|
||||||
func->builtin = -parser_token(parser)->constval.i;
|
func->builtin = -parser_token(parser)->constval.i;
|
||||||
} else if (parser->tok == '{') {
|
} else if (parser->tok == '{') {
|
||||||
/* function body */
|
/* function body */
|
||||||
|
bool ret;
|
||||||
|
ast_function *old = parser->function;
|
||||||
|
parser->function = func;
|
||||||
|
ret = parser_parse_body(parser);
|
||||||
|
parser->function = old;
|
||||||
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
parseerror(parser, "TODO, const assignment");
|
parseerror(parser, "TODO, const assignment");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue