
    j                     ,    S r SSKJr  SSKJr  S rS rg)zSQL formatter    )filters)SQLParseErrorc                 H   U R                  S5      nUS;  a  [        SU< 35      eU R                  S5      nUS;  a  [        SU< 35      eU R                  S5      nUS;  a  [        SU< 35      eU R                  S	S
5      nUS;  a  [        SU< 35      eU R                  SS
5      nUS;  a  [        SU< 35      eU R                  SS
5      nUS;  a  [        SU< 35      eU R                  S5      nUb:   [        U5      nUS::  a  [        SU< 35      eXpS'   U R                  SS5      U S'   U R                  SS
5      nUS;  a  [        SU< 35      eU(       a  SU S'   XS'   U R                  SS
5      n	U	S;  a  [        SU	< 35      eU	(       a  SU S'   U R                  SS
5      n
U
S;  a  [        SU	< 35      eU
(       a  SU S'   U R                  SS
5      nUS;  a  [        SU< 35      eXS'   U R                  SS
5      nUS;  a  [        S U< 3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U< 3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: identifier_casez#Invalid value for identifier_case: output_format)NsqlpythonphpzUnknown output format: strip_commentsF)TFz"Invalid value for strip_comments: use_space_around_operatorsz.Invalid value for use_space_around_operators: strip_whitespacez$Invalid value for strip_whitespace: truncate_stringsz$Invalid value for truncate_strings:    truncate_charz[...]indent_columnsz"Invalid value for indent_columns: TreindentzInvalid value for reindent: reindent_alignedz$Invalid value for reindent_aligned: indent_after_firstz&Invalid value for indent_after_first: indent_tabszInvalid value for indent_tabs: 	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   int
ValueError	TypeError)optionskwcaseidcaseofrmtr   space_around_operatorsstrip_wsr   r   r   r   r   r   r   r   r    r!   r"   s                     J/var/www/html/KUNJ/venv/lib/python3.13/site-packages/sqlparse/formatter.pyvalidate_optionsr/      s   [[(F;;>%j* + 	+ [[*+F;;A%j* + 	+ KK(E225$i) * 	* [[!159N]*@-02 3 	3 %[[)EuM]2L58: ; 	; {{-u5H}$B'l, - 	- {{#56#	9"#34 q  F#3"6!8 9 9&6"##*;;#H [[!159N]*@-02 3 	3	"
 .{{:u-H}$:'l, - 	-	&*"#{{#5u=},B'l, - 	-	&*"# %95A.D146 7 	7$6 !++mU3K-'=*o/ 0 	0	!%!$;;~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& 	9 F#3"6!8 9 9	9b z" @>??@ z" ><==>( :& 	D BCC	Ds0   =L$ 
M =M& N $ MM#&NN!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!   )r2   r1   r   r   r   r    r!   r   )r2   r"   )r1   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_stackrF      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   r/   rF    rG   r.   <module>rL      s      -xvCrG   