Skip to content

Conversation

@horw
Copy link
Collaborator

@horw horw commented Jan 2, 2025

Description

This MR introduces the esp-bool-parser package, a utility for parsing and evaluating boolean expressions based on soc_caps files in the ESP-IDF. It includes the following core functionalities:

  1. BOOL_EXPR Parser: Supports parsing complex boolean statements and evaluating them based on target configurations.
  2. ChipAttr Enhancements: Provides access to soc_headers constants and allows dynamic extension via custom attributes.
  3. Custom Attribute Registration: Introduced the register_addition_attribute method for extending or overriding existing attributes in ChipAttr.

Key Changes

  • Added support for multiple chained or and and statements.
  • Provided a mechanism to extend ChipAttr functionality using register_addition_attribute.

Related

Testing

Added tests for parsing statements.


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@horw horw changed the title ref: removed dependencies and update parser Introduction esp-bool-parser Jan 2, 2025
@github-actions
Copy link

github-actions bot commented Jan 2, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
esp_bool_parser
   bool_parser.py1232976%58, 82–107, 128, 131, 158–165, 170, 178, 182
   constants.py411368%19–20, 45–57
   soc_header.py684140%54–64, 77–82, 86–93, 97–138
   utils.py11373%21, 25–26
TOTAL2468665% 

Tests Skipped Failures Errors Time
49 0 💤 0 ❌ 0 🔥 0.615s ⏱️

@horw horw changed the title Introduction esp-bool-parser Introducing esp-bool-parser Jan 2, 2025
@horw horw force-pushed the init branch 3 times, most recently from 0eaeb8e to b1d02b5 Compare January 2, 2025 08:11
@horw horw requested a review from hfudev January 2, 2025 08:11
@horw
Copy link
Collaborator Author

horw commented Jan 2, 2025

Also, renamed if_parser.py to bool_parser.py to make it clearer, as in this context, it’s no longer closely related to if statements.

@horw
Copy link
Collaborator Author

horw commented Jan 2, 2025

@hfudev Hello! I’ve moved the bool parser from idf-build-apps.
Could you please take a look? Thank you so much!

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: RDT
JIRA_COMPONENT: idf-build-apps
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we create new component?

@horw horw force-pushed the init branch 4 times, most recently from 6fd6d5d to ee0e3bf Compare January 2, 2025 09:10
Copy link
Member

@hfudev hfudev left a comment

Choose a reason for hiding this comment

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

LGTM! Great job!

@horw horw force-pushed the init branch 8 times, most recently from f8b6f78 to 732723e Compare January 3, 2025 07:40
@horw horw requested a review from hfudev January 3, 2025 07:43
Copy link
Member

@hfudev hfudev left a comment

Choose a reason for hiding this comment

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

Thanks for the improvements. Only one last comment about version.

@horw horw merged commit f85b2f5 into main Jan 3, 2025
4 checks passed
@hfudev hfudev deleted the init branch January 3, 2025 13:09
@github-actions github-actions bot changed the title Introducing esp-bool-parser Introducing esp-bool-parser (RDT-1070) Jan 6, 2025
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.

3 participants