qiskit/qasm/qasmparser.py
def p_indexed_id(self, program):
        """
           indexed_id : id '[' NNINTEGER ']'
                      | id '[' NNINTEGER error
                      | id '[' error
        """
        if len(program) == 4:
            raise QasmError("Expecting an integer index; received",
                            str(program[3].value))
        if program[4] != ']':
            raise QasmError("Missing ']' in indexed ID; received",
                            str(program[4].value))
        program[0] = node.IndexedId([program[1], node.Int(program[3])])
def p_indexed_id(self, program):
        """
           indexed_id : id '[' NNINTEGER ']'
                      | id '[' NNINTEGER error
                      | id '[' error
        """
        if len(program) == 4:
            raise QasmError("Expecting an integer index; received",
                            str(program[3].value))
        if program[4] != ']':
            raise QasmError("Missing ']' in indexed ID; received",
                            str(program[4].value))
        program[0] = node.IndexedId([program[1], node.Int(program[3])])
indexed_id : id '[' NNINTEGER ']'
                      | id '[' NNINTEGER error
                      | id '[' error