Skip to content

Allow externs with no arguments and no return value #58

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

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

anuragm
Copy link
Contributor

@anuragm anuragm commented Jul 19, 2023

This pull request proposes two changes:

  1. Allow externs that don't accept any arguments. We represent this with an empty list.
  2. Allow externs with no return value. We represent void return type with python None.

On (2), while OpenQASM spec defines a void keyword, the AST does not expose it anywhere. Using None internally is a working compromise.

@anuragm anuragm marked this pull request as draft July 19, 2023 20:06
@anuragm anuragm changed the title Allow externs with no arguments Allow externs with no arguments and no return value Jul 19, 2023
@anuragm anuragm marked this pull request as ready for review July 19, 2023 21:06
Copy link
Collaborator

@PhilReinhold PhilReinhold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@PhilReinhold PhilReinhold merged commit 1a1b84c into openqasm:main Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants