From 0f14ce0f3b293f0f9e9a0f916377e06e21773053 Mon Sep 17 00:00:00 2001 From: Saem Ghani Date: Sun, 31 Jul 2022 12:42:51 -0700 Subject: [PATCH] internals: leaf nodes do not have sons - pulls nkEmpty and nkNone into a branch without sons - various small fixes to get bootstrap working - no tests failed, so that's a good{?} sign --- compiler/ast/ast.nim | 7 +++++-- compiler/ast/ast_types.nim | 21 +++++++++++++++------ compiler/ast/trees.nim | 3 +-- compiler/sem/evaltempl.nim | 2 +- compiler/sem/pragmas.nim | 3 +-- compiler/sem/sem.nim | 7 ++++--- compiler/sem/semexprs.nim | 5 +++-- compiler/sem/semtempl.nim | 10 +++++++--- compiler/sem/sigmatch.nim | 2 +- compiler/vm/vm.nim | 2 +- 10 files changed, 39 insertions(+), 23 deletions(-) diff --git a/compiler/ast/ast.nim b/compiler/ast/ast.nim index ebe61c51d3e..f0ea3c31018 100644 --- a/compiler/ast/ast.nim +++ b/compiler/ast/ast.nim @@ -430,8 +430,10 @@ proc addSonNilAllowed*(father, son: PNode) = father.sons.add(son) proc delSon*(father: PNode, idx: int) = - if father.len == 0: return - for i in idx..