-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code generation logic for improved readability and maintaina… (
#252) * Refactor code generation logic for improved readability and maintainability Replaced repeated shader type checks in `generate()` with a dictionary-based approach, improving clarity and reducing redundancy. - Simplified the `generate_if()` method to handle `else_if_conditions` and `else_if_bodies` more clearly, enhancing readability. - Refactored `generate_statement()` by using a dictionary-based mapping of node types to their corresponding handlers, reducing conditional branching and improving code organization. These changes streamline the code generation logic, making the codebase easier to understand and extend in the future. * Refactor code generation logic for improved readability and maintainability - Replaced repeated shader type checks in `generate()` with a dictionary-based approach, improving clarity and reducing redundancy. - Simplified the `generate_if()` method to handle `else_if_conditions` and `else_if_bodies` more clearly, enhancing readability. - Refactored `generate_statement()` by using a dictionary-based mapping of node types to their corresponding handlers, reducing conditional branching and improving code organization. These changes streamline the code generation logic, making the codebase easier to understand and extend in the future. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed Imports and the errors. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update directx_codegen.py * Update directx_codegen.py * Update directx_codegen.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update directx_codegen.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Nripesh Niketan <[email protected]>
- Loading branch information
Showing
1 changed file
with
35 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters