
    7j                     p    d Z ddlZ ej                  dej                  ej                  z        Zd Zd Zy)zdRemoves C/C++ style comments from text.

Gratefully adapted from https://stackoverflow.com/a/241506
    Nz7//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"c                 N    | j                  d      }|j                  d      rdS |S )z5Removes C/C++ style comments from a regex match.
    r   / )group
startswith)matchss     L/home/hanthebot/chat/keyboard/qmk_firmware/lib/python/qmk/comment_remover.py_comment_stripperr   
   s'     	AA,,s#3**    c                 @    t        j                  t        t        |       S )z+Remove C/C++ style comments from text.
    )resubcomment_patternr   )texts    r
   comment_removerr      s     66/#4d;;r   )__doc__r   compileDOTALL	MULTILINEr   r   r    r   r
   <module>r      s?    
"**WY[YbYbegeqeqYqr+<r   