Skip to content

Commit

Permalink
work on QValue sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
dellard committed Apr 9, 2019
1 parent d2a0103 commit bffd0d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/python/pyqgl2/sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from pyqgl2.ast_util import ast2str, NodeError
from pyqgl2.quickcopy import quickcopy
from pyqgl2.qreg import is_qbit_create
from pyqgl2.qval import is_qval_create

class SequenceExtractor(object):
"""
Expand Down Expand Up @@ -50,8 +51,9 @@ def find_imports(self, node):
isinstance(subnode.func, ast.Name)):
funcname = subnode.func.id

# QRegister calls will be stripped by find_sequences, so skip
if funcname == 'QRegister':
# QRegister/QValue calls will be stripped by
# find_sequences, so skip
if funcname == 'QRegister' or funcname == 'QValue':
continue

# If we created a node without an qgl_fname,
Expand Down Expand Up @@ -237,7 +239,8 @@ def find_sequences(self, node):
# print("Line %d of %d" % (lineNo+1, len(node.body)))
stmnt = node.body[lineNo]
# print("Looking at stmnt %s" % stmnt)
if is_qbit_create(stmnt):
if is_qbit_create(stmnt) or is_qval_create(stmnt):
print('skipping over [%s]' % ast2str(stmnt))
# drop it
continue

Expand Down

0 comments on commit bffd0d4

Please sign in to comment.