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] - Remove Syntax Errors from Bytecompiler #2598

Closed
wants to merge 2 commits into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Feb 12, 2023

This Pull Request closes #1907.

It changes the following:

  • Implement several early errors relating to labels, break and continue in the parser.
  • Implement an early error for invalid cover grammar of object literals in the parser.
  • Remove all remaining syntax errors from the bytecompiler.

@raskad raskad added parser Issues surrounding the parser vm Issues and PRs related to the Boa Virtual Machine. Internal Category for changelog labels Feb 12, 2023
@raskad raskad added this to the v0.17.0 milestone Feb 12, 2023
@github-actions
Copy link

github-actions bot commented Feb 12, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,129 94,129 0
Passed 71,901 71,910 +9
Ignored 17,206 17,206 0
Failed 5,022 5,013 -9
Panics 12 12 0
Conformance 76.39% 76.40% +0.01%
Fixed tests (9):
test/language/statements/class/static-init-invalid-label-dup.js [strict mode] (previously Failed)
test/language/statements/class/static-init-invalid-label-dup.js (previously Failed)
test/language/statements/labeled/value-await-non-module.js [strict mode] (previously Failed)
test/language/statements/labeled/value-await-non-module.js (previously Failed)
test/language/statements/labeled/value-yield-non-strict.js (previously Failed)
test/language/statements/break/S12.8_A8_T2.js [strict mode] (previously Failed)
test/language/statements/break/S12.8_A8_T2.js (previously Failed)
test/language/module-code/early-dup-lables.js [strict mode] (previously Failed)
test/language/module-code/early-dup-lables.js (previously Failed)

@codecov
Copy link

codecov bot commented Feb 12, 2023

Codecov Report

Merging #2598 (c9acb9e) into main (60c25b4) will increase coverage by 0.26%.
The diff coverage is 62.80%.

@@            Coverage Diff             @@
##             main    #2598      +/-   ##
==========================================
+ Coverage   49.34%   49.60%   +0.26%     
==========================================
  Files         386      384       -2     
  Lines       38962    39089     +127     
==========================================
+ Hits        19224    19391     +167     
+ Misses      19738    19698      -40     
Impacted Files Coverage Δ
boa_engine/src/builtins/eval/mod.rs 6.86% <0.00%> (-0.29%) ⬇️
boa_engine/src/builtins/function/mod.rs 24.09% <0.00%> (ø)
boa_engine/src/bytecompiler/class.rs 0.00% <0.00%> (ø)
...rc/bytecompiler/declaration/declaration_pattern.rs 26.20% <0.00%> (-0.51%) ⬇️
boa_engine/src/bytecompiler/module.rs 0.00% <0.00%> (ø)
.../statement/declaration/hoistable/class_decl/mod.rs 50.71% <0.00%> (-0.61%) ⬇️
boa_parser/src/parser/statement/mod.rs 60.60% <0.00%> (-1.45%) ⬇️
boa_engine/src/bytecompiler/expression/assign.rs 38.16% <28.57%> (-0.93%) ⬇️
...gine/src/bytecompiler/expression/object_literal.rs 42.85% <40.00%> (+0.61%) ⬆️
boa_engine/src/bytecompiler/function.rs 65.54% <40.00%> (ø)
... and 35 more

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

@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.

Good work!

/// [BreakStatement]: https://tc39.es/ecma262/#sec-break-statement-static-semantics-early-errors
/// [ContinueStatement]: https://tc39.es/ecma262/#sec-continue-statement-static-semantics-early-errors
#[must_use]
pub fn check_labels<N>(node: &N, interner: &Interner) -> Option<String>
Copy link
Member

Choose a reason for hiding this comment

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

I think returning an Option is a bit misleading. It would be better to return Result<(), String> or even Result<(), CheckLabelsError> to defer the error reporting to the parser.

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.

Looks good to me!

@jedel1043
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Feb 18, 2023
This Pull Request closes #1907.

It changes the following:

- Implement several early errors relating to labels, `break` and `continue` in the parser.
- Implement an early error for invalid cover grammar of object literals in the parser.
- Remove all remaining syntax errors from the bytecompiler.
@bors
Copy link

bors bot commented Feb 18, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Remove Syntax Errors from Bytecompiler [Merged by Bors] - Remove Syntax Errors from Bytecompiler Feb 18, 2023
@bors bors bot closed this Feb 18, 2023
@bors bors bot deleted the move-syntax-errors branch February 18, 2023 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Category for changelog parser Issues surrounding the parser vm Issues and PRs related to the Boa Virtual Machine.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move syntax errors from the compiler to the parser
4 participants