Let's keep the var declarations in the top of the function? It can be a one line with `res`, `inStack` and `parser`.