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

Expression parsing fixes #103

Merged
merged 3 commits into from
May 9, 2022
Merged

Expression parsing fixes #103

merged 3 commits into from
May 9, 2022

Conversation

DylanPiercey
Copy link
Contributor

Description

  • When parsing unenclosed expressions we look backwards for unary operators preceded by a word break. This caused a false positive when a member expression was found with the operator name, eg input.new. Now we ensure that these operators are not in a member expression like this.

  • Improves consistency with v2 of the parser by allowing expressions to span multiple lines if the line is ended with the continuation. This change also allows html attributes and grouped concise attributes to span multiple lines with a new line before or after the continuation.

Checklist:

  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

@changeset-bot
Copy link

changeset-bot bot commented May 8, 2022

🦋 Changeset detected

Latest commit: 98d31e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
htmljs-parser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented May 8, 2022

Codecov Report

Merging #103 (98d31e7) into main (c5bbf11) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
+ Coverage   94.42%   94.47%   +0.04%     
==========================================
  Files          26       26              
  Lines        1059     1067       +8     
  Branches      252      255       +3     
==========================================
+ Hits         1000     1008       +8     
  Misses         39       39              
  Partials       20       20              
Impacted Files Coverage Δ
src/states/EXPRESSION.ts 91.08% <100.00%> (+0.76%) ⬆️
src/states/OPEN_TAG.ts 95.83% <100.00%> (ø)

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 c5bbf11...98d31e7. Read the comment docs.

@DylanPiercey DylanPiercey merged commit a4e3635 into main May 9, 2022
@DylanPiercey DylanPiercey deleted the expression-parsing-fixes branch May 9, 2022 16:17
@github-actions github-actions bot mentioned this pull request May 9, 2022
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.

1 participant