This PR fixes an endless loop in the OpenQASM parser upon encountering unexpected statements in gate declarations.
WIth this PR, the parser actually errors out with an appropriate error message instead of looping forever.
Checklist:
[x] The pull request only contains commits that are related to it.
[x] I have added appropriate tests and documentation.
[x] I have made sure that all CI jobs on GitHub pass.
[x] The pull request introduces no new warnings and follows the project's style guidelines.
Description
This PR fixes an endless loop in the OpenQASM parser upon encountering unexpected statements in gate declarations. WIth this PR, the parser actually errors out with an appropriate error message instead of looping forever.
Checklist: