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

base_parser: Update StripComment to consider quote groupings #456

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

Javagedes
Copy link
Contributor

@Javagedes Javagedes commented Nov 20, 2023

Previous update to StripComment would ignore any pound signs that were surrounded by quotes, but did not consider if the sign was inside two quotes or between two sets of two quotes (i.e. " # " vs " 1 " # " 2 "). This commit updates StripComment to check this scenario and not strip if the pound sign is inside two quotes.

This additionally adds support for ignoring escaped quotes.

@Javagedes Javagedes requested a review from makubacki November 20, 2023 16:50
Copy link
Contributor

@apop5 apop5 left a comment

Choose a reason for hiding this comment

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

New comment parser works in the project.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e795831) 81.14% compared to head (61a9e88) 78.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #456      +/-   ##
==========================================
- Coverage   81.14%   78.06%   -3.08%     
==========================================
  Files          57       57              
  Lines        7340     7358      +18     
==========================================
- Hits         5956     5744     -212     
- Misses       1384     1614     +230     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Previous update to StripComment would ignore any pound signs that were
surrounded by quotes, but did not consider if the sign was inside two
quotes or between two sets of two quotes
(i.e. `" # "` vs `" 1 " # " 2 "`). This commit updates StripComment to
check this scenario and not strip if the pound sign is inside two
quotes.
@Javagedes Javagedes merged commit e8586dc into tianocore:master Nov 21, 2023
11 of 12 checks passed
@Javagedes Javagedes deleted the more-line-support branch November 21, 2023 22:16
@Javagedes Javagedes added this to the 0.19.6 milestone Nov 21, 2023
@Javagedes Javagedes added the bug Something isn't working label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants