- added mixin support to AST output

This commit is contained in:
alexey.lysiuk 2020-06-20 16:53:30 +03:00 committed by drfrag
parent f2b1d45985
commit da8c452795

View file

@ -914,6 +914,25 @@ static void PrintPropertyStmt(FLispString &out, ZCC_TreeNode *node)
out.Close();
}
static void PrintMixinDef(FLispString &out, ZCC_TreeNode *node)
{
ZCC_MixinDef *mdnode = (ZCC_MixinDef *)node;
out.Break();
out.Open("mixin-def");
out.AddName(mdnode->NodeName);
PrintNodes(out, mdnode->Body);
out.Close();
}
static void PrintMixinStmt(FLispString &out, ZCC_TreeNode *node)
{
ZCC_MixinStmt *msnode = (ZCC_MixinStmt *)node;
out.Break();
out.Open("mixin-stmt");
out.AddName(msnode->MixinName);
out.Close();
}
void (* const TreeNodePrinter[NUM_AST_NODE_TYPES])(FLispString &, ZCC_TreeNode *) =
{
PrintIdentifier,
@ -973,6 +992,8 @@ void (* const TreeNodePrinter[NUM_AST_NODE_TYPES])(FLispString &, ZCC_TreeNode *
PrintStaticArrayState,
PrintProperty,
PrintFlagDef,
PrintMixinDef,
PrintMixinStmt,
};
FString ZCC_PrintAST(ZCC_TreeNode *root)