mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 06:10:56 +00:00
[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:
parent
b2301c8bad
commit
d2e134cc22
2 changed files with 7 additions and 5 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue