AST debug cleanup

- Add ArrayIterationStmt printer.
- Mark ZCC_TreeNodes as const for the AST printers.
- Use static_assert to catch missing printers without needing to run with -dumpast.
This commit is contained in:
Marisa Heit 2022-11-25 11:35:13 -06:00 committed by Christoph Oelckers
commit 70df34674b
3 changed files with 98 additions and 82 deletions

View file

@ -1128,7 +1128,7 @@ ZCC_TreeNode *TreeNodeDeepCopy_Internal(ZCC_AST *ast, ZCC_TreeNode *orig, bool c
{
TreeNodeDeepCopy_Start(ArrayIterationStmt);
// ZCC_IterationStmt
// ZCC_ArrayIterationStmt
copy->ItName = static_cast<ZCC_VarName*>(TreeNodeDeepCopy_Internal(ast, origCasted->ItName, true, copiedNodesList));
copy->LoopStatement = static_cast<ZCC_Statement*>(TreeNodeDeepCopy_Internal(ast, origCasted->LoopStatement, true, copiedNodesList));
copy->ItArray = static_cast<ZCC_Expression*>(TreeNodeDeepCopy_Internal(ast, origCasted->ItArray, true, copiedNodesList));