
    h	                     ^    d Z ddlmZ ddlmZ ddlmZmZmZ ddl	m
Z
  G d de      Zd
d	Zy)z	SQL Lexer    )tokens)	SQL_REGEX)
bytes_type	text_type
file_types)consumec                   "    e Zd ZdZedd       Zy)Lexerz?Lexer
    Empty class. Leaving for backwards-compatibility
    Nc              #     K   t        | t              r| j                         } t        | t              rnZt        | t              r'|r| j                  |      } n6	 | j                  d      } n#t        dj                  t        |                   t        |       }|D ]  \  }}t        D ]  \  }} || |      }|st        |t        j                        r||j                         f n#t        |      r ||j                                t!        ||j#                         |z
  dz
           t        j$                  |f  y# t        $ r | j                  d      } Y w xY ww)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 inital stack (default: ``['root']``)
        zutf-8zunicode-escapez+Expected text or file-like object, got {!r}   N)
isinstancer   readr   r   decodeUnicodeDecodeError	TypeErrorformattype	enumerater   r   
_TokenTypegroupcallabler   endError)textencodingiterableposcharrexmatchactionms           Q/var/www/html/ranktracker/api/venv/lib/python3.12/site-packages/sqlparse/lexer.py
get_tokenszLexer.get_tokens   sB     dJ'99;DdI&j){{8,9;;w/D J"F4:.0 0 T?! 	)IC$- ) &T3'(9(9: !'')++f% ++!%%'C-!"34) llD((	) * 9;;'78D9s+   AE%E *CE%E"E%!E""E%N)__name__
__module____qualname____doc__staticmethodr#        r"   r
   r
      s     -) -)r+   r
   Nc                 6    t               j                  | |      S )zTokenize sql.

    Tokenize *sql* using the :class:`Lexer` and return a 2-tuple stream
    of ``(token type, value)`` items.
    )r
   r#   )sqlr   s     r"   tokenizer.   K   s     7c8,,r+   r$   )r(   sqlparser   sqlparse.keywordsr   sqlparse.compatr   r   r   sqlparse.utilsr   objectr
   r.   r*   r+   r"   <module>r4      s-      ' = = "3)F 3)l-r+   