def p_circuit_gate_or_measurement_or_if(self, p):
        """circuit :  circuit gate_op
        |  circuit measurement
        |  circuit reset
        |  circuit if"""
        self.circuit.append(p[2])
        p[0] = self.circuit
circuit :  circuit gate_op
        |  circuit measurement
        |  circuit reset
        |  circuit if
cirq-core/cirq/contrib/qasm_import/_parser.py