Use an array instead of a switch in token_kind_name
This change removes 19 lines of code and gives the function a (negligible) speed improvement .
this removes the concrete link between each Token_kind value and the name that represents it, which makes the code less readable and less extensible. the data structure that would be an improvement is a map, but that's pretty overkill
this removes the concrete link between each Token_kind value and the name that represents it, which makes the code less readable and less extensible. the data structure that would be an improvement is a map, but that's pretty overkill
Yeah I guess there is a trade off here, I would chose the array method but the maintainer might disagree with me. Thanks for the review!
Speed improvement makes by the compiler itself, IMHO. And UNREACHABLE feature lost.
Speed improvement makes by the compiler itself, IMHO. And
UNREACHABLEfeature lost.
I can put it back.