Closed as not planned
Description
In #1487 we made a change to mark all keywords output as Keyword
tokens.
I've since learned that this was incorrect for some of them.
There are keywords which are classed as "contextual keywords". These keywords are keywords when they're in a their keyword position, and identifiers when they're in an identifier position.
So we need to either:
- provide context to the token parser so it can create the correct token, or
- always parse them as
Identifier
tokens (this is the route that espree/acorn takes)
The list of contextual keywords:
https://github.com/microsoft/TypeScript/blob/eeff036519362513cc86a95e260a281a725295f4/src/compiler/types.ts#L255-L285