4 ms·
How about this: ( x ) / b / a It could be part of: var x = (x) / b / a; Or if (x) /b/a.test(z) X could be an arbitrary complex expression. Loo
by bazoom42 3y ago
How about this:
( x ) / b / a
It could be part of:
var x = (x) / b / a;
Or
if (x) /b/a.test(z)
X could be an arbitrary complex expression. Looking at one preceding token is not enough to disambiguate the slash.
I suspect the only real solution is to intertwine lexing and parsing, so the parser asks for the next token with a flag indicating context. But this constrains what parsing algorithm can be used.