a
    ÛEb•	  ã                   @   sP   d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd„ dƒZ	dd	d
„Z
dS )z	SQL Lexeré    )Ú
TextIOBase)Útokens)Ú	SQL_REGEX)Úconsumec                   @   s   e Zd ZdZeddd„ƒZdS )ÚLexerz?Lexer
    Empty class. Leaving for backwards-compatibility
    Nc                 c   s
  t | tƒr|  ¡ } t | tƒrnZt | tƒrf|r8|  |¡} qxz|  d¡} W qx tyb   |  d¡} Y qx0 ntd t	| ƒ¡ƒ‚t
| ƒ}|D ]€\}}tD ]f\}}|| |ƒ}|sªq�n2t |tjƒrÆ|| ¡ fV  nt|ƒrÜ|| ¡ ƒV  t|| ¡ | d ƒ  q„q�tj|fV  q„dS )a³  
        Return an iterable of (tokentype, value) pairs generated from
        `text`. If `unfiltered` is set to `True`, the filtering mechanism
        is bypassed even if filters are defined.

        Also preprocess the text, i.e. expand tabs and strip it if
        wanted and applies registered filters.

        Split ``text`` into (tokentype, text) pairs.

        ``stack`` is the initial stack (default: ``['root']``)
        zutf-8zunicode-escapez+Expected text or file-like object, got {!r}é   N)Ú
isinstancer   ÚreadÚstrÚbytesÚdecodeÚUnicodeDecodeErrorÚ	TypeErrorÚformatÚtypeÚ	enumerater   r   Ú
_TokenTypeÚgroupÚcallabler   ÚendÚError)ÚtextÚencodingÚiterableÚposÚcharÚrexmatchÚactionÚm© r   úN/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/sqlparse/lexer.pyÚ
get_tokens   s6    


ÿ
zLexer.get_tokens)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr!   r   r   r   r    r      s   r   Nc                 C   s   t ƒ  | |¡S )z�Tokenize sql.

    Tokenize *sql* using the :class:`Lexer` and return a 2-tuple stream
    of ``(token type, value)`` items.
    )r   r!   )Úsqlr   r   r   r    ÚtokenizeL   s    r(   )N)r%   Úior   Zsqlparser   Zsqlparse.keywordsr   Zsqlparse.utilsr   r   r(   r   r   r   r    Ú<module>   s   6