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

fix: always consume terminator if it is preceded by an operator #162

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

DylanPiercey
Copy link
Contributor

Description

Ensures that in the expression state whenever a terminator is found for the expression and the terminator is preceded by an operator that expression state continues.

Motivation and Context

This allows for better parsing of expressions in several places. The case that brought about this change was as follows:

<let/a:(B | C) = D/>

With the above the tag variable state was being terminated by the ( and going into tag arguments / shorthand default method mode. With this change it will now see the paren and walk backward past whitespace to see the : which is an expression operator causing the (B | C) to be a part of the tag variable (for types).

Screenshots (if appropriate):

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 Mar 15, 2023

🦋 Changeset detected

Latest commit: e8463ff

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

@DylanPiercey DylanPiercey force-pushed the consume-terminator-if-operator branch from 94e5c64 to 695cd2b Compare March 15, 2023 20:26
@DylanPiercey DylanPiercey force-pushed the consume-terminator-if-operator branch from 695cd2b to e8463ff Compare March 15, 2023 20:29
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.18 🎉

Comparison is base (be73442) 93.66% compared to head (e8463ff) 93.84%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #162      +/-   ##
==========================================
+ Coverage   93.66%   93.84%   +0.18%     
==========================================
  Files          27       27              
  Lines        1294     1300       +6     
  Branches      293      296       +3     
==========================================
+ Hits         1212     1220       +8     
+ Misses         53       51       -2     
  Partials       29       29              
Impacted Files Coverage Δ
src/states/EXPRESSION.ts 93.78% <100.00%> (+0.24%) ⬆️

... and 1 file 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.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@DylanPiercey DylanPiercey merged commit 085451c into main Mar 15, 2023
@DylanPiercey DylanPiercey deleted the consume-terminator-if-operator branch March 15, 2023 20:33
@github-actions github-actions bot mentioned this pull request Mar 15, 2023
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