refactor(parser): remove lookahead usage in parsing arrow function expressions#11220
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #11220 will degrade performances by 13.46%Comparing Summary
Benchmarks breakdown
|
|
@Boshen is this sort of snapshot update expected? It looks like the parser error message has changed here, where before we just had "unexpected token" and now it says we were looking for a "=>", which feels better? But I'm not sure if it's correct or not, since I'm less familiar with the parser changes.
|
269e829 to
c1f6380
Compare
|
Actually, it looks like this is correct I think. This is the same error that TypeScript will emit:
https://www.typescriptlang.org/play/?#code/BQOjEMEoAIGpoIwCgg |
c1f6380 to
597969f
Compare
Yes! We expect more alignment to tsc from making these changes. |
Merge activity
|
c1b83c8 to
a9dbf0a
Compare
597969f to
def05bc
Compare




Replaces all usage of the lexer lookahead functions like
nth_kind, so that we only use checkpoints and rewinding, which is aligned with the TypeScript compiler implementation. This also will allow us to remove the lookahead field from the lexer in the future.