[qfcc] Support multiple parameters for attributes

I have no idea why I threw away all but the *last* parameter (especially
considering nothing used parameters until now).
This commit is contained in:
Bill Currie 2023-08-25 22:02:44 +09:00
parent b2301c8bad
commit d2e134cc22
2 changed files with 7 additions and 5 deletions

View file

@ -34,7 +34,7 @@
typedef struct attribute_s {
struct attribute_s *next;
const char *name;
struct ex_value_s *value;
struct expr_s *params;
} attribute_t;
struct expr_s;

View file

@ -42,14 +42,16 @@ ALLOC_STATE (attribute_t, attributes);
attribute_t *new_attribute(const char *name, expr_t *value)
{
if (value && value->type != ex_value) {
for (auto v = value; v; v = v->next) {
if (v->type != ex_value) {
error (value, "not a literal constant");
return 0;
}
}
attribute_t *attr;
ALLOC (16384, attribute_t, attributes, attr);
attr->name = save_string (name);
attr->value = value ? value->e.value : 0;
attr->params = value ? reverse_expr_list (value) : 0;
return attr;
}