Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: remove obsolete
nkExprColonExpr
detection
Summary ======= Remove detection of `nkExprColonExpr` nodes in the context of tuple, array, and object construction expressions in the code generators. The ASTs reaching the code generators are expected to have a specific shape; violations thereof need to be treated as internal errors and should not be silently supported. Details ======= The AST coming out of `astgen` does not contain `nkExprColonExpr` nodes in `nkTupleConstr` trees, so the detection for them in `ccgexprs.genTupleConstr` and `vmgen.genTupleConstr` is obsolete and thus removed. Since `jsgen.genTupleConstr` is used for both normal procedure-level code and constant initializers, it cannot have the detection removed, as constant initializers do use `nkExprColonExpr` nodes for named tuple constructions (`nkTupleConstr`). In addition, the constant initializer AST that comes out of both `semfold` or `vmcompilerserdes`: - doesn't have `nkExprColonExpr` nodes in `nkBracket` (array construction) trees - always has `nkExprColonExpr` nodes in `nkObjConstr` trees Therefore, `ccgexprs.getNullValueAux` (code generation for constant object constructions) can depend on the presence of `nkExprColonExpr` nodes and `ccgexprs.genConstSimpleList` (code generation for constant array constructions) on their absence.
- Loading branch information