Description
A few years ago we adopted the 'sweet.js algorithm', which tries to distinguish syntactical syntax from the token stream to be able to disambiguate things like the division op and the start of a regexp, so that the tokenizer can be ran without also running the parser.
New ES versions have increasingly complicated the story here, and neither sweet.js itself nor Esprima, which also implements this, seems to really be motivated to keep up with that. We've been slowly complicating our algorithm, but it's starting to get shaky, and now PR #575 is the first place where we've reintroduced a dependency of the tokenizer on the parser.
Maybe, instead of putting further energy into this, and dealing with the bugs that come from this complexity, we should just deprecate tokenizing without also running a parser?
(Though that would have consequences like making it impossible to, in the future, reframe our lookahead approach or loose parser in terms of actual token lookahead, so that'd have to be considered carefully.)