I am trying to write a tokenizer for calculator expressions. I have been following the examples of parsing in Bjarne Stroustrup's "The C++ Programming Language", translating my understanding to Typescript. The file attached is what I have so far.
The error I get is on line 122, "This comparison appears to be unintentional because the types calcEnum.LP and calcEnum.RP have no overlap
Yet through the recursive call to this.expression(true) it should always call this.getToken() eventually. Ensuring this.curToken is updated and requiring the evaluation.
Seeking suggestions for how to resolve this issue. Reading suggestions are welcome, when relevant.