Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Add AST node for parenthesized expressions #2738

Closed
wants to merge 2 commits into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Mar 25, 2023

Currently we have no explicit representation for parenthesized expressions which makes some behaviours impossible to detect. A bonus is that we can now turn AST that contains parenthesized expressions back to code.

This Pull Request changes the following:

  • Add an AST node for parenthesized expressions.
  • Adjust some conversions and checks to "ignore"/"expand" parenthesized expressions.
  • Fix some tests that had parenthesized expressions.

@raskad raskad added parser Issues surrounding the parser execution Issues or PRs related to code execution ast Issue surrounding the abstract syntax tree labels Mar 25, 2023
@raskad raskad added this to the v0.17.0 milestone Mar 25, 2023
@github-actions
Copy link

github-actions bot commented Mar 25, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,277 94,277 0
Passed 71,094 71,100 +6
Ignored 17,324 17,324 0
Failed 5,859 5,853 -6
Panics 0 0 0
Conformance 75.41% 75.42% +0.01%
Fixed tests (6):
test/language/expressions/assignmenttargettype/direct-asyncarrowfunction-1.js [strict mode] (previously Failed)
test/language/expressions/assignmenttargettype/direct-asyncarrowfunction-1.js (previously Failed)
test/language/expressions/assignmenttargettype/parenthesized-primaryexpression-objectliteral.js [strict mode] (previously Failed)
test/language/expressions/assignmenttargettype/parenthesized-primaryexpression-objectliteral.js (previously Failed)
test/language/expressions/assignmenttargettype/direct-arrowfunction-1.js [strict mode] (previously Failed)
test/language/expressions/assignmenttargettype/direct-arrowfunction-1.js (previously Failed)

@codecov
Copy link

codecov bot commented Mar 25, 2023

Codecov Report

Merging #2738 (73c822e) into main (9cfb68d) will decrease coverage by 0.08%.
The diff coverage is 52.12%.

❗ Current head 73c822e differs from pull request most recent head da10544. Consider uploading reports for the commit da10544 to get more accurate results

@@            Coverage Diff             @@
##             main    #2738      +/-   ##
==========================================
- Coverage   50.29%   50.21%   -0.08%     
==========================================
  Files         400      402       +2     
  Lines       39964    40144     +180     
==========================================
+ Hits        20101    20160      +59     
- Misses      19863    19984     +121     
Impacted Files Coverage Δ
boa_ast/src/visitor.rs 11.73% <0.00%> (-0.13%) ⬇️
boa_parser/src/parser/expression/update.rs 91.54% <0.00%> (-1.31%) ⬇️
...er/src/parser/statement/iteration/for_statement.rs 57.44% <20.00%> (+0.06%) ⬆️
boa_ast/src/expression/mod.rs 49.59% <25.00%> (-0.83%) ⬇️
boa_ast/src/expression/parenthesized.rs 66.66% <66.66%> (ø)
boa_engine/src/bytecompiler/mod.rs 61.14% <66.66%> (-0.21%) ⬇️
boa_ast/src/expression/operator/assign/mod.rs 82.14% <72.72%> (-1.54%) ⬇️
boa_engine/src/bytecompiler/expression/unary.rs 96.42% <75.00%> (-3.58%) ⬇️
boa_parser/src/parser/expression/unary.rs 68.51% <83.33%> (-0.11%) ⬇️
boa_engine/src/bytecompiler/expression/mod.rs 61.70% <100.00%> (+0.41%) ⬆️
... and 2 more

... and 8 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Just a small nitpick that doesn't block merging. Nice work!

boa_engine/src/bytecompiler/mod.rs Outdated Show resolved Hide resolved
@Razican
Copy link
Member

Razican commented Mar 30, 2023

bors r+

bors bot pushed a commit that referenced this pull request Mar 30, 2023
Currently we have no explicit representation for parenthesized expressions which makes some behaviours impossible to detect. A bonus is that we can now turn AST that contains parenthesized expressions back to code.

This Pull Request changes the following:

- Add an AST node for parenthesized expressions.
- Adjust some conversions and checks to "ignore"/"expand" parenthesized expressions.
- Fix some tests that had parenthesized expressions.
@bors
Copy link

bors bot commented Mar 30, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Add AST node for parenthesized expressions [Merged by Bors] - Add AST node for parenthesized expressions Mar 30, 2023
@bors bors bot closed this Mar 30, 2023
@bors bors bot deleted the add-parenthesized-ast branch March 30, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast Issue surrounding the abstract syntax tree execution Issues or PRs related to code execution parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants