Conversation
|
A couple of failing tests which do have reliable syntax workarounds, so added their fixes as TODOs for now. |
|
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. |
There was a problem hiding this comment.
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.pyto a newexprmodule - 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.
No description provided.