- give the 'default' block its own node type in the AST.

- group a class's body the same way as the global AST. Only partially implemented so far so that constants can be processed.
This commit is contained in:
Christoph Oelckers 2016-10-08 15:27:20 +02:00
commit d139ee9f68
6 changed files with 138 additions and 24 deletions

View file

@ -629,6 +629,15 @@ static void PrintCompoundStmt(FLispString &out, ZCC_TreeNode *node)
out.Close();
}
static void PrintDefault(FLispString &out, ZCC_TreeNode *node)
{
ZCC_Default *snode = (ZCC_Default *)node;
out.Break();
out.Open("default");
PrintNodes(out, snode->Content, false, true);
out.Close();
}
static void PrintContinueStmt(FLispString &out, ZCC_TreeNode *node)
{
out.Break();
@ -853,7 +862,8 @@ void (* const TreeNodePrinter[NUM_AST_NODE_TYPES])(FLispString &, ZCC_TreeNode *
PrintConstantDef,
PrintDeclarator,
PrintVarDeclarator,
PrintFuncDeclarator
PrintFuncDeclarator,
PrintDefault
};
FString ZCC_PrintAST(ZCC_TreeNode *root)