@DanieleSassoli I started the refactoring by using a simple dictionary rather than a dispatcher, so a lot of the if statements have disappeared. Right now is also more efficient, the if statements won't be parsed, you have fast access in the dictionary for each method that you need
Next steps:
add lexer as a variable of the class and remove it from method calls. Once you have done that, you don't need to pass around the lexer and you can use the same dictionary key mechanism for some of the if statements
use boolean as much as possible and test truth values in if rather than comparing an integer.
I am happy to tackle the above points in another PR if you are happy to this one.
@DanieleSassoli I started the refactoring by using a simple dictionary rather than a dispatcher, so a lot of the if statements have disappeared. Right now is also more efficient, the if statements won't be parsed, you have fast access in the dictionary for each method that you need
Next steps:
I am happy to tackle the above points in another PR if you are happy to this one.