Disabled default blocks in mixins for now.

This commit is contained in:
Chronos Ouroboros 2020-01-05 19:07:03 -03:00 committed by drfrag
parent 721faee4d8
commit fea9814d19

View file

@ -276,11 +276,9 @@ void ZCCCompiler::ProcessMixin(ZCC_MixinDef *cnode, PSymbolTreeNode *treenode)
{
ZCC_MixinWork *cls = new ZCC_MixinWork(cnode, treenode);
Mixins.Push(cls);
auto node = cnode->Body;
// Need to check if the class actually has a body.
// Need to check if the mixin actually has a body.
if (node != nullptr) do
{
if (cnode->MixinType == ZCC_Mixin_Class)
@ -296,10 +294,13 @@ void ZCCCompiler::ProcessMixin(ZCC_MixinDef *cnode, PSymbolTreeNode *treenode)
case AST_EnumTerminator:
case AST_States:
case AST_FuncDeclarator:
case AST_Default:
case AST_StaticArrayStatement:
break;
case AST_Default:
Error(node, "Default blocks currently disabled in mixins");
return;
default:
assert(0 && "Unhandled AST node type");
break;
@ -308,6 +309,8 @@ void ZCCCompiler::ProcessMixin(ZCC_MixinDef *cnode, PSymbolTreeNode *treenode)
node = node->SiblingNext;
} while (node != cnode->Body);
Mixins.Push(cls);
}
//==========================================================================