mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-07 01:42:04 +00:00
[qfcc] Process array sub-expressions
This commit is contained in:
parent
943cf9659b
commit
128682624e
1 changed files with 17 additions and 0 deletions
|
@ -156,6 +156,22 @@ proc_field (const expr_t *expr)
|
|||
return e;
|
||||
}
|
||||
|
||||
static const expr_t *
|
||||
proc_array (const expr_t *expr)
|
||||
{
|
||||
auto base = expr_process (expr->array.base);
|
||||
auto index = expr_process (expr->array.index);
|
||||
if (is_error (base)) {
|
||||
return base;
|
||||
}
|
||||
if (is_error (index)) {
|
||||
return index;
|
||||
}
|
||||
auto e = new_array_expr (base, index);
|
||||
e->array.type = dereference_type (get_type (base));
|
||||
return e;
|
||||
}
|
||||
|
||||
static const expr_t *
|
||||
proc_label (const expr_t *expr)
|
||||
{
|
||||
|
@ -411,6 +427,7 @@ expr_process (const expr_t *expr)
|
|||
[ex_return] = proc_return,
|
||||
[ex_cond] = proc_cond,
|
||||
[ex_field] = proc_field,
|
||||
[ex_array] = proc_array,
|
||||
[ex_decl] = proc_decl,
|
||||
[ex_loop] = proc_loop,
|
||||
[ex_select] = proc_select,
|
||||
|
|
Loading…
Reference in a new issue