Remove syntax node introspection from the parser after it was parsed
Summary:
We are using "hacky" tricks to remove inspection of the node after it was created. Some of the cases were trivial like returning additional `Token.t` along with `Syntax.t` so that we can make some decision based on the former one.
Changing `PrefixUnaryExpression` was the hardest one. I had to store(cache) necessary information in the module state each time `make_prefix_unary_expression` was called, so that functions afterwards could inspect it.
Better datastructure for caching prefix unary expressions would be map/hashtable, but in our case is simple enough to just use list and iterate.
Differential Revision:
D6890521
fbshipit-source-id:
4b6a130819a141d7699765ff2eed6f615834b7c2