KCL parser: Allow .prop or [index] to follow any expression#7371
Merged
adamchalmers merged 4 commits intomainfrom Jun 5, 2025
Merged
KCL parser: Allow .prop or [index] to follow any expression#7371adamchalmers merged 4 commits intomainfrom
adamchalmers merged 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Previously in a member expression like foo.x or foo[3], `foo` had to be an identifier. You could not do something like f().x Now you can. Closes #7273
377b8f4 to
a489de9
Compare
CodSpeed Instrumentation Performance ReportMerging #7371 will degrade performances by 17.65%Comparing Summary
Benchmarks breakdown
|
58a8f5b to
8ea3130
Compare
jtran
approved these changes
Jun 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously in a member expression like
foo.xorfoo[3],foohad to be an identifier. You could not do something likef().x(and if you tried, you got a cryptic error). Rather than make the error better, we should just accept any expression to be the LHS of a member expression (aka its 'object').This does knock our "parse lots of function calls" from 58 to 55 calls before it stack overflows. But I think it's fine, we'll address this in #6226 when I get back to it.
This makes the parser a bit slower, which is fine, because the parser is stronger and more capable now.
Closes #7273