From 9629a737b95a90bc05ad565da607f011bfda3cbf Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 20 Jun 2020 16:53:30 +0300 Subject: [PATCH] - added mixin support to AST output --- src/common/scripting/frontend/ast.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/common/scripting/frontend/ast.cpp b/src/common/scripting/frontend/ast.cpp index ae198dc84..cb29457e4 100644 --- a/src/common/scripting/frontend/ast.cpp +++ b/src/common/scripting/frontend/ast.cpp @@ -913,6 +913,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, @@ -972,6 +991,8 @@ void (* const TreeNodePrinter[NUM_AST_NODE_TYPES])(FLispString &, ZCC_TreeNode * PrintStaticArrayState, PrintProperty, PrintFlagDef, + PrintMixinDef, + PrintMixinStmt, }; FString ZCC_PrintAST(ZCC_TreeNode *root)