Currently the code that calls feature hooks checks the AST in various places differently for each case. This adds up to some big if/else chains in the analyzer and transformer and to some duplicate checks inside features.
Need to refactor the flow to be unified so it's easy to understand and add new cases without bloat.
Maybe it would be nice for the features the register hooks to specific node types in order to reduce if statements and then we can guarantee that a hook is called with the node it needs without inner checks.
It would also be good to add a case insensitive check to all the nodes.
Currently the code that calls feature hooks checks the AST in various places differently for each case. This adds up to some big
if/elsechains in the analyzer and transformer and to some duplicate checks inside features.Need to refactor the flow to be unified so it's easy to understand and add new cases without bloat.
Maybe it would be nice for the features the register hooks to specific node types in order to reduce if statements and then we can guarantee that a hook is called with the node it needs without inner checks.
It would also be good to add a case insensitive check to all the nodes.