Skip to content

Commit

Permalink
Disabled default blocks in mixins for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Doom2fan authored and madame-rachelle committed Jan 5, 2020
1 parent 3c45859 commit 74ca790
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/scripting/zscript/zcc_compile.cpp
Expand Up @@ -268,11 +268,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)
Expand All @@ -288,10 +286,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;
Expand All @@ -300,6 +301,8 @@ void ZCCCompiler::ProcessMixin(ZCC_MixinDef *cnode, PSymbolTreeNode *treenode)

node = node->SiblingNext;
} while (node != cnode->Body);

Mixins.Push(cls);
}

//==========================================================================
Expand Down

0 comments on commit 74ca790

Please sign in to comment.