qir-alliance / qcor

C++ compiler for heterogeneous quantum-classical computing built on Clang and XACC
http://docs.aide-qc.org
MIT License
97 stars 39 forks source link

pyxasm token collector cannot handle function docs strings in qjit kernel #88

Open amccaskey opened 3 years ago

amccaskey commented 3 years ago

The following causes an assertion to be triggered

@qjit
def oracle(q : qreg):
    """
    Define the oracle for our phase estimation algorithm,
    a T gate on the last qubit
    """
    ... oracle code ...

but this does not

@qjit
def oracle(q : qreg):
    ... oracle code ...
1tnguyen commented 3 years ago

I guess this might be because we're doing single-line parsing of the Python code. We probably need to track the scope of these multi-line comment blocks in the handler.