Make options redef-able by default.

This commit is contained in:
Johanna Amann 2018-08-10 11:45:37 -07:00
parent 26ea1999ec
commit c34fbee0d1
4 changed files with 22 additions and 1 deletions

View file

@ -294,6 +294,22 @@ void ID::RemoveAttr(attr_tag a)
}
}
void ID::SetOption()
{
if ( is_option )
return;
is_option = true;
// option implied redefinable
if ( ! IsRedefinable() )
{
attr_list* attr = new attr_list;
attr->append(new Attr(ATTR_REDEF));
AddAttrs(new Attributes(attr, Type(), false));
}
}
void ID::EvalFunc(Expr* ef, Expr* ev)
{
Expr* arg1 = new ConstExpr(val->Ref());