refactor: Reduce excessive nesting in codegen inline operations #213
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#213
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
crates/compiler/src/codegen.rscontains functions with 5-6 levels of nesting, making the code difficult to read, test, and modify.Example:
codegen_inline_binary_op(lines 4079-4190)Impact
Affected Functions
codegen_inline_binary_op(lines 4079-4190) - 5-6 levelscodegen_match_statement(lines 5269-5386) - 4-5 levelscodegen_program_with_config(lines 820-1144) - deep initialization nestingProposed Solution
1. Extract fast/slow paths to separate methods
2. Use early returns to flatten
3. Replace nested matches with lookup tables where applicable
Acceptance Criteria
Labels
refactor, technical-debt, medium-priority
https://github.com/navicore/patch-seq/pull/221