This module is used to detect dead code branches and remove them. This is escecially useful after injecting values from the outside which might lead to simple truish equations which can be easily resolved.
This module is directly used by Class after Permutations have been applied (code branches) but can be used more widely, too.
This acts somewhat like the optimizers you find under “optimizer”, but is dependency relevant (Permutations might remove whole blocks of alternative code branches). It makes no sense to optimize this just before compilation. It must be done pretty early during the processing of classes.
The module currently support the following statements:
and can detect good code based on:
It supports the types “string” and “number” during comparisions. It uses a simple equality operator in Python which behaves like strict equal in JavaScript. This also means that number 42 is not equal to string “42” during the dead code analysis.
It can figure out combined expressions as well like: