Conversation
|
👋 Hey there! It looks like the changelog might need an update. Please take a moment to edit the
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
TheGupta2012
left a comment
There was a problem hiding this comment.
Hi @LukeAndreesen , thanks for the changes! It looks good overall, some comments about tests and minor refactoring.
Also, if you wanna give it a try, the recursive approach for multiple includes can be implemented using a stack as well.
|
Hey @TheGupta2012 , thanks for the feedback! I'll work on getting those changes made and implement the recursive approach! |
…cases, moved preprocessing testing to new file
|
Hey @TheGupta2012 , I just pushed over a fresh version of the pre-processing routine, which now uses a stack-based approach to recursively handle nested inclusions. I ended up needing to change around my last commit quite a bit to work out some of the details of this nested include handling, so apologies for a lot of fresh code. I tried to get things to a pretty clean and comprehensible place, but the code definitely still feels a bit confusing and perhaps not as efficient as it could be, though it does work. As such, any feedback on the code, or suggestions on a better approach to take, would be greatly appreciated! Also, please let me know if you have any suggestions on my current testing format - I know I created quite a few .qasm and .inc files for testing, but am happy to clean this up / reformat tests if needed. Thanks so much, |
TheGupta2012
left a comment
There was a problem hiding this comment.
Nice work @LukeAndreesen ! I like the IncludeContext and stack based approach. Gave a few comments but looks pretty close to merging
|
Hey @TheGupta2012 , I've made some changes to ensure the insertions occur at the line of the include statement in the original script - this ended up being easier by using a recursive call rather than stack approach to avoid reading files multiple times; hopefully the logic here should be a bit clearer to follow. |
TheGupta2012
left a comment
There was a problem hiding this comment.
Great work @LukeAndreesen ! The recursive approach sure looks a lot cleaner. Once you add the qasm2 tests, I think the code should be good to merge.
Custom include file support (issue)
A basic implementation of processing custom .inc and .qasm "include" files in QASM3 programs. This implementation simply inserts the contents of included files directly into the file where they are referenced prior to parsing the program. This is a preliminary, naive approach - any feedback would be appreciated.
Summary of Changes
_process_include_statementsin entrypoint.py, which simply iterates through included files, searches for the included file in user's directory, then replaces the include statement with the content of the file.