Fix --unroll CLI argument to properly unroll arrays instead of repeating them (#5)

* Initial plan

* Fix --unroll CLI argument to properly unroll arrays

Updated check_is_array() method and all CPUIF implementations to correctly detect and handle unrolled array elements. When unroll=True, each array element is now treated as an individual instance instead of being repeated as an array.

Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com>

* Add comprehensive tests for --unroll functionality

Created tests to verify that array elements are correctly unrolled into individual instances when --unroll flag is used. Also fixed conftest.py fixture to keep temp files for later reference.

Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com>
This commit is contained in:
Copilot
2025-10-23 22:23:49 -07:00
committed by GitHub
parent 516da7a43b
commit 2ca1ce4e27
8 changed files with 209 additions and 22 deletions

View File

@@ -35,7 +35,8 @@ def compile_rdl(tmp_path: Path):
for include_path in include_paths or ():
compiler.add_include_path(str(include_path))
with NamedTemporaryFile("w", suffix=".rdl", dir=tmp_path) as tmp_file:
# Use delete=False to keep the file around after closing
with NamedTemporaryFile("w", suffix=".rdl", dir=tmp_path, delete=False) as tmp_file:
tmp_file.write(source)
tmp_file.flush()