
    %h|                     ,    S r SSKJr  SSKJr  S rS rg)zSQL formatter    )filters)SQLParseErrorc                 f   U R                  S5      nUS;  a  [        SR                  U5      5      eU R                  S5      nUS;  a  [        SR                  U5      5      eU R                  S5      nUS;  a  [        SR                  U5      5      eU R                  S	S
5      nUS;  a  [        SR                  U5      5      eU R                  SS
5      nUS;  a  [        SR                  U5      5      eU R                  SS
5      nUS;  a  [        SR                  U5      5      eU R                  S5      nUbE   [        U5      nUS::  a  [        SR                  U5      5      eXpS'   U R                  SS5      U S'   U R                  SS
5      nUS;  a  [        SR                  U5      5      eU(       a  SU S'   XS'   U R                  SS
5      n	U	S;  a  [        SR                  U	5      5      eU	(       a  SU S'   U R                  SS
5      n
U
S;  a  [        SR                  U	5      5      eU
(       a  SU S'   U R                  SS
5      nUS;  a  [        SR                  U5      5      eXS'   U R                  SS
5      nUS;  a  [        S R                  U5      5      eU(       a  S!U S"'   OS#U S"'   U R                  S$S%5      n [        U5      nUS:  a  [        S'5      eXS$'   U R                  S(S)5      n [        U5      nUS):  a  [        S+5      eXS('   U R                  S,S
5      nUS;  a  [        S-5      eXS,'   U R                  S.S
5      nUS;  a  [        S/5      eUU S.'   U R                  S05      nUb   [        U5      nUS2:  a  [        S35      eUU S0'   U $ ! [        [
        4 a    [        SR                  U5      5      ef = f! [
        [        4 a    [        S&5      ef = f! [
        [        4 a    [        S*5      ef = f! [
        [        4 a    [        S15      ef = f)4zValidates options.keyword_case)Nupperlower
capitalizez$Invalid value for keyword_case: {!r}identifier_casez'Invalid value for identifier_case: {!r}output_format)NsqlpythonphpzUnknown output format: {!r}strip_commentsF)TFz&Invalid value for strip_comments: {!r}use_space_around_operatorsz2Invalid value for use_space_around_operators: {!r}strip_whitespacez(Invalid value for strip_whitespace: {!r}truncate_stringsz(Invalid value for truncate_strings: {!r}   truncate_charz[...]indent_columnsz&Invalid value for indent_columns: {!r}Treindentz Invalid value for reindent: {!r}reindent_alignedz(Invalid value for reindent_aligned: {!r}indent_after_firstz*Invalid value for indent_after_first: {!r}indent_tabsz#Invalid value for indent_tabs: {!r}	indent_char indent_width   z indent_width requires an integerz(indent_width requires a positive integer
wrap_afterr   zwrap_after requires an integerz&wrap_after requires a positive integercomma_firstz$comma_first requires a boolean valuecompactz compact requires a boolean valueright_marginz right_margin requires an integer
   z%right_margin requires an integer > 10)getr   formatint
ValueError	TypeError)optionskwcaseidcaseofrmtr   space_around_operatorsstrip_wsr   r   r   r   r   r   r   r   r    r!   r"   s                     D/var/www/html/env/lib/python3.13/site-packages/sqlparse/formatter.pyvalidate_optionsr0      s   [[(F;; ##)6&>3 	3 [[*+F;; ##)6&>3 	3 KK(E22 ##)6%=2 	2 [[!159N]* ##)6.#9; 	; %[[)EuM]2 ##)6*@#AC 	C {{-u5H}$ ##)6(#35 	5 {{#56#	A"#34 q  !''-v.>'?A A&6"##*;;#H [[!159N]* ##)6.#9; 	;	"
 .{{:u-H}$ ##)6(#35 	5	&*"#{{#5u=}, ##)6(#35 	5	&*"# %95A. ##)6*<#=? 	?$6 !++mU3K-' ##)6+#68 	8	!%!$;;~q1L@<( aFGG*N\1-J>_
 A~DEE&L++mU3K-'BCC(Mkk)U+Gm#>?? GI;;~.L	D|,L " GHH*GNNi I& 	A !''-v.>'?A A	Ab z" @>??@ z" ><==>( :& 	D BCC	Ds0   ?N( O O5 P (+OO25PP0c                 4   UR                  S5      (       a2  U R                  R                  [        R                  " US   5      5        UR                  S5      (       a2  U R                  R                  [        R
                  " US   5      5        UR                  S5      (       a4  U R                  R                  [        R                  " US   US   S95        UR                  SS5      (       a>  U R                  5         U R                  R                  [        R                  " 5       5        UR                  S5      (       a>  U R                  5         U R                  R                  [        R                  " 5       5        UR                  S	5      (       d  UR                  S
5      (       a>  U R                  5         U R                  R                  [        R                  " 5       5        UR                  S
5      (       aX  U R                  5         U R                  R                  [        R                  " US   US   US   US   US   US   US   S95        UR                  SS5      (       a@  U R                  5         U R                  R                  [        R                  " US   S95        UR                  S5      (       a@  U R                  5         U R                  R                  [        R                  " US   S95        UR                  S5      (       ay  US   nUR                  5       S:X  a  [        R                   " 5       nO,UR                  5       S:X  a  [        R"                  " 5       nOSnUb  U R$                  R                  U5        U $ )zSetup and return a filter stack.

Args:
  stack: :class:`~sqlparse.filters.FilterStack` instance
  options: Dictionary with options validated by validate_options.
r   r
   r   r   )widthcharr   Fr   r   r   r   r   r   r   r   r    r!   )r3   r2   r   r   r   r    r!   r   )r3   r"   )r2   r   r   r   N)r$   
preprocessappendr   KeywordCaseFilterIdentifierCaseFilterTruncateStringFilterenable_groupingstmtprocessSpacesAroundOperatorsFilterStripCommentsFilterStripWhitespaceFilterReindentFilterAlignedIndentFilterRightMarginFilterr   OutputPHPFilterOutputPythonFilterpostprocess)stackr)   frmtfltrs       r/   build_filter_stackrG      s    {{>""%%gn&=>	@ {{$%%((1B)CD	F {{%&& < <,-GO4L!N 	O {{/77  !D!D!FG {{#$$  !<!<!>?{{%&&'++j*A*A  !>!>!@A{{:  ""]+n-#*+?#@&'78"<0#M2	*-	. {{%u--  ''W]-CD	F {{>""  %%GN,CD	F {{?##'::<5 **,DZZ\X%--/DD$$T*L    N)__doc__sqlparser   sqlparse.exceptionsr   r0   rG    rH   r/   <module>rM      s      -xvCrH   