qiskit/qasm/qasmparser.py
def id_tuple_list(self, id_node):
        """Return a list of (name, index) tuples for this id node."""
        if id_node.type != "id":
            raise QasmError("internal error, id_tuple_list")
        bit_list = []
        try:
            g_sym = self.current_symtab[id_node.name]
        except KeyError:
            g_sym = self.global_symtab[id_node.name]
        if g_sym.type == "qreg" or g_sym.type == "creg":
            # Return list of (name, idx) for reg ids
            for idx in range(g_sym.index):
                bit_list.append((id_node.name, idx))
        else:
            # Return (name, -1) for other ids
            bit_list.append((id_node.name, -1))
        return bit_list
def id_tuple_list(self, id_node):
        """Return a list of (name, index) tuples for this id node."""
        if id_node.type != "id":
            raise QasmError("internal error, id_tuple_list")
        bit_list = []
        try:
            g_sym = self.current_symtab[id_node.name]
        except KeyError:
            g_sym = self.global_symtab[id_node.name]
        if g_sym.type == "qreg" or g_sym.type == "creg":
            # Return list of (name, idx) for reg ids
            for idx in range(g_sym.index):
                bit_list.append((id_node.name, idx))
        else:
            # Return (name, -1) for other ids
            bit_list.append((id_node.name, -1))
        return bit_list
def id_tuple_list ( self , id_node ) : if id_node . type != "id" : raise QasmError ( "internal error, id_tuple_list" ) bit_list = [ ] try : g_sym = self . current_symtab [ id_node . name ] except KeyError : g_sym = self . global_symtab [ id_node . name ] if g_sym . type == "qreg" or g_sym . type == "creg" : # Return list of (name, idx) for reg ids for idx in range ( g_sym . index ) : bit_list . append ( ( id_node . name , idx ) ) else : # Return (name, -1) for other ids bit_list . append ( ( id_node . name , - 1 ) ) return bit_list
Return a list of (name, index) tuples for this id node.
Return a list of ( name index ) tuples for this id node .