-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Expr
support to QPY for conditions and targets
This adds support to QPY for the current `Expr` nodes, for *all* instruction parameters and conditions. The `Expr` tree is written out to the file in a sort of forwards Polish notation; each node has a type code and header, followed by a type-code-specific number of `Expr` children. While only `IfElseOp.condition`, `WhileLoopOp.condition` and `SwitchCaseOp.target` are allowed to have these nodes in Terra's data model right now, the QPY serialisation does not need to have this arbitrary restriction, and it's much easier just to write the general case. The backwards-compatibility guarantees of QPY are now brought to bear on the `Unary.Op` and `Binary.Op` enumeration values. They were already marked in the source code as their values needing to be part of the stable public interface, and their use in things like QPY is the reason why.
- Loading branch information
1 parent
0abfb1f
commit b0c56bd
Showing
7 changed files
with
809 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.