o
    q²“ih  ã                   @   s    d Z ddlmZmZ ddlmZ ddlmZmZm	Z	m
Z
mZ ddlmZ ddlmZ g d¢Zded	eeeef  fd
d„Zded	eeeef  fdd„ZdZdS )z¤
A package to compare python-style regexes and test if they have intersections.
Based on the `greenery`-package by @qntm, adapted and specialized for `lark-parser`
é    )ÚIterableÚTuple)ÚFSM)ÚPatternÚparse_patternÚREFlagsÚUnsupportedÚInvalidSyntax)Ú
Comparator)Úlogger)
r   r   r
   r   Úcompare_patternsÚcompare_regexesÚ__version__r   r   r	   ÚregexesÚreturnc                  G   s&   t dd„ | D ƒƒ}t|jƒ | | ¡S )zJ
    Checks the regexes for intersections. Returns all pairs it found
    c                 S   s   i | ]}|t |ƒ“qS © )r   )Ú.0Úrr   r   úH/home/ubuntu/.local/lib/python3.10/site-packages/interegular/__init__.pyÚ
<dictcomp>   s    z#compare_regexes.<locals>.<dictcomp>)r
   ÚprintÚ	_patternsÚcheck)r   Úcr   r   r   r      s   

r   Úpsc                  G   s   t dd„ | D ƒƒ}| | ¡S )zK
    Checks the Patterns for intersections. Returns all pairs it found
    c                 S   s   i | ]}||“qS r   r   )r   Úpr   r   r   r      s    z$compare_patterns.<locals>.<dictcomp>)r
   r   )r   r   r   r   r   r      s   
r   z0.3.3N)Ú__doc__Útypingr   r   Úinteregular.fsmr   Úinteregular.patternsr   r   r   r   r	   Úinteregular.comparatorr
   Úinteregular.utilsr   Ú__all__Ústrr   r   r   r   r   r   r   Ú<module>   s    	