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

Implement template literals and tagged templates #997

Merged
merged 16 commits into from
Jan 12, 2021
Merged

Implement template literals and tagged templates #997

merged 16 commits into from
Jan 12, 2021

Conversation

tofpie
Copy link
Contributor

@tofpie tofpie commented Dec 26, 2020

This Pull Request closes #996.

It changes the following:

  • Parsing and lexing of template literals and tagged templates
  • New AST nodes for template literals and tagged templates

@codecov
Copy link

codecov bot commented Dec 26, 2020

Codecov Report

Merging #997 (d817a1d) into master (abd893c) will increase coverage by 0.10%.
The diff coverage is 56.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #997      +/-   ##
==========================================
+ Coverage   58.37%   58.47%   +0.10%     
==========================================
  Files         173      176       +3     
  Lines       12050    12225     +175     
==========================================
+ Hits         7034     7149     +115     
- Misses       5016     5076      +60     
Impacted Files Coverage Δ
...rc/syntax/parser/expression/left_hand_side/call.rs 40.42% <0.00%> (-7.08%) ⬇️
...src/syntax/parser/expression/left_hand_side/mod.rs 90.90% <ø> (ø)
boa/src/syntax/parser/function/mod.rs 63.23% <0.00%> (-0.95%) ⬇️
boa/src/syntax/lexer/template.rs 48.78% <48.64%> (-12.34%) ⬇️
boa/src/syntax/ast/node/mod.rs 47.05% <50.00%> (+0.08%) ⬆️
boa/src/syntax/parser/expression/primary/mod.rs 72.88% <50.00%> (-4.05%) ⬇️
boa/src/syntax/parser/mod.rs 53.57% <50.00%> (-1.99%) ⬇️
boa/src/syntax/lexer/string.rs 53.08% <52.17%> (+14.99%) ⬆️
boa/src/syntax/ast/node/template/mod.rs 53.57% <53.57%> (ø)
.../syntax/parser/expression/left_hand_side/member.rs 69.76% <57.14%> (-2.46%) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abd893c...d817a1d. Read the comment docs.

@Razican Razican added this to the v0.11.0 milestone Dec 28, 2020
@Razican Razican added execution Issues or PRs related to code execution lexer Issues surrounding the lexer parser Issues surrounding the parser labels Dec 28, 2020
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!
I have some comments for my understanding mostly, and I have some files left to review. Things are looking very good from a conformance point of view:

Test262 conformance changes:

Test result master count PR count difference
Total 78,497 78,497 0
Passed 24,548 24,698 +150
Ignored 15,585 15,587 +2
Failed 38,364 38,212 -152
Panics 28 30 +2
Conformance 31.27 31.46 +0.19%

test_ignore.txt Show resolved Hide resolved
boa/src/syntax/parser/cursor/buffered_lexer/mod.rs Outdated Show resolved Hide resolved
@Razican Razican added the enhancement New feature or request label Jan 1, 2021
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

I had a bit of time to check more files, looking good. I had some comments, though.

boa/src/syntax/lexer/string.rs Outdated Show resolved Hide resolved
boa/src/syntax/lexer/string.rs Outdated Show resolved Hide resolved
boa/src/syntax/lexer/token.rs Outdated Show resolved Hide resolved
boa/src/syntax/lexer/string.rs Show resolved Hide resolved
boa/src/syntax/ast/node/template/mod.rs Outdated Show resolved Hide resolved
boa/src/syntax/ast/node/template/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

Numbers look great :) there might be a small performance penalty, but this is expected in any new features.

I have reviewed the code, and I didn't see any potential improvement. I would still like for @Lan2u and/or others to review it.

From my side, it can be merged as-is.

@RageKnify
Copy link
Contributor

@tofpie please don't merge master to your PRs unless there are conflicts or you need code that was merged in those commits. It's running all CI again unnecessarily. Wasted CPU time means wasted eletricity.

@tofpie
Copy link
Contributor Author

tofpie commented Jan 11, 2021

OK. Sorry for that.

@Razican Razican merged commit f62a77d into boa-dev:master Jan 12, 2021
@tofpie tofpie deleted the template branch January 12, 2021 19:44
@Razican Razican mentioned this pull request Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request execution Issues or PRs related to code execution lexer Issues surrounding the lexer parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement template literals and tagged templates
4 participants