OwlCyberSecurity - MANAGER
Edit File: lexer.cpython-39.pyc
a gH�fg � @ s\ d Z ddlZddlmZ ddlmZ ddlmZmZ ddl m Z G dd� d�Zdd d �ZdS )z SQL Lexer� N)�Lock)� TextIOBase)�tokens�keywords)�consumec @ sX e Zd ZdZdZe� Zedd� �Zdd� Z dd� Z d d � Zdd� Zd d� Z ddd�ZdS )�LexerzrThe Lexer supports configurable syntax. To add support for additional keywords, use the `add_keywords` method.Nc C sH | j �, | jdu r$| � | _| j�� W d � n1 s80 Y | jS )zRReturns the lexer instance used internally by the sqlparse core functions.N)�_lock�_default_instance�default_initialization)�cls� r �P/home/gouroczh/virtualenv/test/3.9/lib/python3.9/site-packages/sqlparse/lexer.py�get_default_instance0 s (zLexer.get_default_instancec C s� | � � | �tj� | �tj� | �tj� | �tj� | �tj� | �tj � | �tj � | �tj� | �tj� | �tj � dS )zlInitialize the lexer with default dictionaries. Useful if you need to revert custom syntax settings.N)�clear� set_SQL_REGEXr � SQL_REGEX�add_keywordsZKEYWORDS_COMMONZKEYWORDS_ORACLEZKEYWORDS_MYSQLZKEYWORDS_PLPGSQLZKEYWORDS_HQLZKEYWORDS_MSACCESSZKEYWORDS_SNOWFLAKEZKEYWORDS_BIGQUERY�KEYWORDS��selfr r r r : s zLexer.default_initializationc C s g | _ g | _dS )z�Clear all syntax configurations. Useful if you want to load a reduced set of syntax configurations. After this call, regexps and keyword dictionaries need to be loaded to make the lexer functional again.N)� _SQL_REGEX� _keywordsr r r r r I s zLexer.clearc s$ t jt jB � � fdd�|D �| _dS )z.Set the list of regex that will parse the SQL.c s"