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

edk2toollib/uefi/edk2/parsers: enhancements #419

Merged
merged 5 commits into from
Oct 2, 2023

Conversation

Javagedes
Copy link
Contributor

@Javagedes Javagedes commented Sep 29, 2023

Improves the following parsers in the following ways:

base_parser.py: Properly uses ivalue (int value) to check if the string representation of a value was correctly converted to an integer ('1' to 1, '0x0' to 0, etc) when evaluating conditionals

dsc_parser.py: register pcds when performing the initial parse responsible for finding define statements. This is necessary to evaluate conditionals that use pcds.

@Javagedes Javagedes added bug Something isn't working enhancement New feature or request labels Sep 29, 2023
@Javagedes Javagedes added this to the v0.18.1 milestone Sep 29, 2023
@Javagedes Javagedes requested a review from makubacki September 29, 2023 19:50
@Javagedes Javagedes self-assigned this Sep 29, 2023
@Javagedes Javagedes force-pushed the improve-pcd-parsing branch 2 times, most recently from e0eb86a to b47095b Compare September 29, 2023 20:15
This change temporarily registers pcd values when doing the initial
parse of the dsc file looking for defines. This is necessary for
processing conditionals that use PCD values
Fixes the bug where the `ComputeResult` attempts to evaluate the result
using the original string value, rather than the converted int value
when handling greater than or less than conditions.

It should have been using the ivalue, which is the conversion of the
parsing string into an actual integer (i.e. "1" to 1 or "0x0" to 0).
@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (2536e7f) 80.93% compared to head (ceceefa) 81.03%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #419      +/-   ##
==========================================
+ Coverage   80.93%   81.03%   +0.10%     
==========================================
  Files          57       57              
  Lines        7286     7289       +3     
==========================================
+ Hits         5897     5907      +10     
+ Misses       1389     1382       -7     
Files Coverage Δ
edk2toollib/uefi/edk2/parsers/base_parser.py 93.14% <100.00%> (+0.05%) ⬆️
edk2toollib/uefi/edk2/parsers/dsc_parser.py 89.36% <36.84%> (+2.08%) ⬆️

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

@Javagedes Javagedes merged commit 2178650 into tianocore:master Oct 2, 2023
@Javagedes Javagedes deleted the improve-pcd-parsing branch October 2, 2023 15:29
@Javagedes Javagedes modified the milestones: v0.18.1, 0.18.2 Oct 2, 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 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants