Skip to content
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

Update pragma rewiring expectations #878

Merged
merged 4 commits into from
Apr 22, 2019

Conversation

ecpeterson
Copy link
Contributor

The quilc PR quil-lang/quilc#159 changes how rewirings get announced to the user: since the rewirings themselves are not considered to be machine-readable, it emits them as comments on existing instructions rather than as distinct instructions in their own right. This breaks some expectations that the pyQuil tests have, which this PR addresses.

Additionally, pyQuil's ANTLR grammar for Quil did not permit comments to be preceded by a substantial amount of whitespace. This PR additionally makes this permissiveness change.

@ecpeterson ecpeterson requested a review from a team as a code owner April 11, 2019 18:33
@stevenheidel
Copy link
Contributor

Neither of these changes make sense to me - do you have examples?

@ecpeterson
Copy link
Contributor Author

Sure. Typical quilc output will soon look like this:

RZ(-1.500635301883098) 0                # Entering rewiring: #(0 1 2 3)
RZ(-pi/2) 2
HALT                                    # Exiting rewiring: #(0 1 2 3)

The current ANTLR grammar barfs on the spaces (or, perhaps, tabs) intervening between the instruction and the comment, and the test wants there to be specific PRAGMA instructions set aside for recording the rewirings, where there soon won't be any.

Copy link
Contributor

@karalekas karalekas left a comment

Choose a reason for hiding this comment

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

LGTM

@ecpeterson ecpeterson merged commit 341e282 into master Apr 22, 2019
@karalekas karalekas added this to the v2.7.0 milestone Apr 29, 2019
@karalekas karalekas deleted the update-pragma-rewiring-expectations branch April 29, 2019 21:32
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.

3 participants