mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 21:21:14 +00:00
[qfcc] Allow single-constant attribute values
I don't remember why I though requiring a parameter list was a good idea, but it makes working with attributes harder than it needs to be.
This commit is contained in:
parent
1117d31b30
commit
186a781121
1 changed files with 4 additions and 2 deletions
|
@ -43,11 +43,13 @@ ALLOC_STATE (attribute_t, attributes);
|
||||||
attribute_t *
|
attribute_t *
|
||||||
new_attribute(const char *name, const expr_t *params)
|
new_attribute(const char *name, const expr_t *params)
|
||||||
{
|
{
|
||||||
if (params && params->type != ex_list) {
|
if (params
|
||||||
|
&& params->type != ex_list
|
||||||
|
&& params->type != ex_value) {
|
||||||
internal_error (params, "attribute params not a list");
|
internal_error (params, "attribute params not a list");
|
||||||
}
|
}
|
||||||
bool err = false;
|
bool err = false;
|
||||||
if (params) {
|
if (params && params->type == ex_list) {
|
||||||
for (auto p = params->list.head; p; p = p->next) {
|
for (auto p = params->list.head; p; p = p->next) {
|
||||||
auto e = p->expr;
|
auto e = p->expr;
|
||||||
if (e->type == ex_expr) {
|
if (e->type == ex_expr) {
|
||||||
|
|
Loading…
Reference in a new issue