-
Notifications
You must be signed in to change notification settings - Fork 6
Fix several bugs in the build-time AST rewrite #57
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
Changes from all commits
76f10fa
d61a9ef
7094325
755e683
d0bba0b
5eb330d
0b0f891
fa123e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "contributors": [ "dabacon", "mjk", "splch", "guenp" ], | ||
| "contributors": [ "dabacon", "mjk", "splch", "antalszava" ], | ||
| "message": "We require contributors to sign our Contributor License Agreement, and we don't have one on file for your GitHub username. In order for us to review and merge your code, please contact @mjk or opensource@ionq.com to sign the CLA." | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,6 @@ | |
|
|
||
| import gast | ||
|
|
||
|
|
||
| ANNOTATIONS = ["original_lineno"] | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,6 @@ | |
|
|
||
| from blqs import statement | ||
|
|
||
|
|
||
| if TYPE_CHECKING: | ||
| import blqs # coverage: ignore | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,6 @@ | |
|
|
||
| from blqs import _stack | ||
|
|
||
|
|
||
| if TYPE_CHECKING: | ||
| import blqs # coverage: ignore | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,6 @@ | |
|
|
||
| from blqs import block, protocols, statement | ||
|
|
||
|
|
||
| if TYPE_CHECKING: | ||
| import blqs # coverage: ignore | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,6 @@ | |
|
|
||
| from blqs import instruction | ||
|
|
||
|
|
||
| if TYPE_CHECKING: | ||
| import blqs # coverage: ignore | ||
|
|
||
|
|
@@ -46,7 +45,7 @@ def __call__(self, *targets) -> blqs.Instruction: | |
| return instruction.Instruction(self, *targets) | ||
|
|
||
| def __eq__(self, other): | ||
| if not isinstance(self, type(other)): | ||
| if type(self) is not type(other): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Minor as unsure how much testing we'd like here): is there a test case for this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good idea! i added a subclass test that isn't equal to a base Op of the same name |
||
| return NotImplemented | ||
| return self._name == other._name | ||
|
|
||
|
|
||
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.
we're caching the line map too - could it happen that we have two distinct exceptions for the same inputs (and so using the same line map through caching outputs invalid line nums for the 2nd exception)?
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.
no the line map only maps generated line numbers to original ones, so it's the same for every exception. i added a comment noting that :)