[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:
Bill Currie 2024-09-20 12:28:02 +09:00
parent 1117d31b30
commit 186a781121

View file

@ -43,11 +43,13 @@ ALLOC_STATE (attribute_t, attributes);
attribute_t *
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");
}
bool err = false;
if (params) {
if (params && params->type == ex_list) {
for (auto p = params->list.head; p; p = p->next) {
auto e = p->expr;
if (e->type == ex_expr) {