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.py: support conditions checking for empty string #653

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented Oct 15, 2024

base_parser.py did not support conditional directives that were comparing to empty strings (e.g. !if $(MY_VAL) == "", !if $(MY_VAL) != "". The logic in _TokenizeConditional, was setting mode to QUOTE_MODE twice because the token length was zero for an empty quote (len(token) == 0`).

This PR Updates the logic to not enter QUOTE_MODE when its already in QUOTE_MODE, and to fall over to end of QUOTE_MODE.

@apop5 apop5 requested a review from Javagedes October 15, 2024 22:52
@apop5 apop5 force-pushed the personal/apop5/parserchange branch from b07aa86 to a5d662f Compare October 15, 2024 23:17
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.43%. Comparing base (ce85203) to head (d9d389b).
Report is 121 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #653      +/-   ##
==========================================
- Coverage   81.43%   81.43%   -0.01%     
==========================================
  Files          56       45      -11     
  Lines        7514     7492      -22     
==========================================
- Hits         6119     6101      -18     
+ Misses       1395     1391       -4     

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

@Javagedes Javagedes force-pushed the personal/apop5/parserchange branch from 56abc95 to d9d389b Compare October 18, 2024 14:49
@Javagedes Javagedes changed the title BaseParser: Updated _TokenizeConditional to better deal with != in dsc files base_parser.py: support conditions checking for empty string Oct 18, 2024
@Javagedes Javagedes added the bug Something isn't working label Oct 18, 2024
@Javagedes Javagedes added this to the v0.22.1 milestone Oct 18, 2024
@Javagedes Javagedes merged commit db0565d into tianocore:master Oct 18, 2024
12 checks passed
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.

2 participants