Skip to content

Add Spans to expression nodes - #4273

Merged
HalidOdat merged 48 commits into
mainfrom
feature/positioned-expression-nodes
Jun 14, 2025
Merged

HalidOdat merged 48 commits into
mainfrom
feature/positioned-expression-nodes

Conversation

@HalidOdat

@HalidOdat HalidOdat commented Jun 6, 2025 •

Copy link
Copy Markdown
Member

Related to #300

This PR adds Spans to expressions, sub-sequent PR will be made for statements and declarations.

@HalidOdat HalidOdat changed the title Add Span to Literal AST node Add Spans to expression nodes Jun 6, 2025
@HalidOdat
HalidOdat force-pushed the feature/positioned-expression-nodes branch 2 times, most recently from e49028d to 7120ed8 Compare June 6, 2025 06:47
@github-actions

github-actions Bot commented Jun 6, 2025 •

Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 50,254 50,254 0
Passed 47,109 47,109 0
Ignored 1,444 1,444 0
Failed 1,701 1,701 0
Panics 0 0 0
Conformance 93.74% 93.74% 0.00%

@HalidOdat
HalidOdat force-pushed the feature/positioned-expression-nodes branch from 7120ed8 to be84bb7 Compare June 6, 2025 13:50
@HalidOdat
HalidOdat marked this pull request as ready for review June 11, 2025 18:46
@HalidOdat
HalidOdat requested a review from a team June 11, 2025 18:46
@HalidOdat
HalidOdat force-pushed the feature/positioned-expression-nodes branch 2 times, most recently from 0b853c3 to 0c6a65b Compare June 13, 2025 13:57
@HalidOdat
HalidOdat force-pushed the feature/positioned-expression-nodes branch from 0c6a65b to 94c6173 Compare June 13, 2025 14:01

@nekevss nekevss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall. Pretty

I have a couple issues / nitpicks, but they're mostly doc related. I'd just prefer to have them cleaned up a bit so they don't get lost in subsequent updates.

I am a little curious about whether there's room for improving how spans are set in the parser ... But I'm not entirely convinced that it needs to be addressed currently.

Out of pure curiosity, did you happen to run any benchmarks on this branch to see what the impact of adding spans is (if there even is any)?

Comment thread core/ast/src/expression/mod.rs Resolved
Comment thread core/ast/src/expression/literal/mod.rs Resolved
Comment thread core/ast/src/expression/identifier.rs Resolved
Comment thread core/ast/src/expression/import_meta.rs Resolved
Comment thread core/ast/src/expression/new_target.rs Resolved
Comment thread core/ast/src/expression/new_target.rs Resolved
Comment thread core/ast/src/expression/this.rs Resolved
Comment thread core/ast/src/operations/mod.rs Resolved
@HalidOdat

HalidOdat commented Jun 14, 2025 •

Copy link
Copy Markdown
Member Author

Out of pure curiosity, did you happen to run any benchmarks on this branch to see what the impact of adding spans is (if there even is any)?

Ran the local parser benchmarks (criterion) and there was a performance improvement on almost all the benchmark ~10% 🥳.

I think this is due to wrapping some of the very big enum variants in Box (done to appease clippy), which overall shrunk the memory usage, see commit: 94c6173

NOTE: The quickjs/v8 benchmarks only benchmark runtime performance so they aren't relevant.

@nekevss nekevss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@HalidOdat
HalidOdat added this pull request to the merge queue Jun 14, 2025
@HalidOdat HalidOdat mentioned this pull request Jun 14, 2025
1 of 3 tasks
Merged via the queue into main with commit 68c806a Jun 14, 2025
@HalidOdat
HalidOdat deleted the feature/positioned-expression-nodes branch June 14, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants