-
Notifications
You must be signed in to change notification settings - Fork 11
keep track of the subroutine definition order #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Would it be possible to preserve the ordering of all declarations, regardless of type? For example, in OpenQASM a subroutine definition can refer to a global |
Some variables are automatic declared at serialization for convenience. This might make strict ordering more difficult. Users could always force the declaration if they want to have it somewhere precisely. |
0a87f84
to
63a6ebd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few suggestions
Very nice, I like the new changes! It is much more consistent in how the declaration gets handled. |
The order of the subroutine definitions was based on their call order. We now update a list of function name at decorator call.
Only subroutines that have been called in the program will be added to prog.subroutines. The subroutines are then added to the program at the final serialization step in order given by prog._subroutine_definition_order.
Added a unit test.