Skip to content

Conversation

@r41k0u
Copy link
Collaborator

@r41k0u r41k0u commented Oct 6, 2025

No description provided.

@r41k0u
Copy link
Collaborator Author

r41k0u commented Oct 8, 2025

A couple of failing tests which do have reliable syntax workarounds, so added their fixes as TODOs for now.

@r41k0u r41k0u marked this pull request as ready for review October 8, 2025 00:29
@r41k0u
Copy link
Collaborator Author

r41k0u commented Oct 8, 2025

I think this should be all for now for refactoring the conditionals and the expr_pass (incidental). We now need to extensively use eval_expr in binops, assignments and statemnet processing.

@r41k0u r41k0u requested a review from Copilot October 8, 2025 01:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors conditional expression handling by extracting condition evaluation logic from the functions module into a dedicated expression module. The refactoring improves support for complex conditional expressions including boolean operations, comparisons, and unary operations.

  • Moved conditional evaluation logic from functions_pass.py to a new expr module
  • Added comprehensive support for boolean operations (and, or) with proper short-circuiting
  • Enhanced comparison operations with type normalization and pointer handling

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pythonbpf/expr/__init__.py New module initialization exposing expression evaluation functions
pythonbpf/expr/expr_pass.py Enhanced expression evaluator with boolean operations, comparisons, and unary operations
pythonbpf/expr/type_normalization.py New utility for type conversion, comparison handling, and pointer dereferencing
pythonbpf/functions/functions_pass.py Simplified condition handling by delegating to expression module
pythonbpf/helper/helper_utils.py Updated import path for expression evaluation
pythonbpf/maps/maps_pass.py Updated import path for debug info
tests/passing_tests/conditionals/*.py New test files for various conditional scenarios
tests/passing_tests/return/bool.py Test file for boolean return values
tests/failing_tests/conditionals/*.py Test files for unsupported conditional patterns
TODO.md Updated task list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@r41k0u r41k0u merged commit 8485460 into master Oct 8, 2025
1 check passed
@varun-r-mallya varun-r-mallya moved this to In progress in TODOs Oct 8, 2025
@varun-r-mallya varun-r-mallya moved this from In progress to Done in TODOs Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants