HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //proc/thread-self/root/lib/python3.6/site-packages/pycparser/ast_transforms.pyc
�
Ʋ@ac@s8ddlmZd�Zd�Zd�Zd�ZdS(i(tc_astcCs�t|tj�st�t|jtj�s1|Stjg|jj�}d}x�|jjpagD]�}t|tj	tj
f�r�|jj|�t||j�|jd}qb|dkr�|jj|�qb|j
j|�qbW||_|S(s� The 'case' statements in a 'switch' come out of parsing with one
        child node, so subsequent statements are just tucked to the parent
        Compound. Additionally, consecutive (fall-through) case statements
        come out messy. This is a peculiarity of the C grammar. The following:

            switch (myvar) {
                case 10:
                    k = 10;
                    p = k + 1;
                    return 10;
                case 20:
                case 30:
                    return 20;
                default:
                    break;
            }

        Creates this tree (pseudo-dump):

            Switch
                ID: myvar
                Compound:
                    Case 10:
                        k = 10
                    p = k + 1
                    return 10
                    Case 20:
                        Case 30:
                            return 20
                    Default:
                        break

        The goal of this transform is to fix this mess, turning it into the
        following:

            Switch
                ID: myvar
                Compound:
                    Case 10:
                        k = 10
                        p = k + 1
                        return 10
                    Case 20:
                    Case 30:
                        return 20
                    Default:
                        break

        A fixed AST node is returned. The argument may be modified.
    i����N(t
isinstanceRtSwitchtAssertionErrortstmttCompoundtcoordtNonetblock_itemstCasetDefaulttappendt_extract_nested_casetstmts(tswitch_nodetnew_compoundt	last_casetchild((s../pycparser/ast_transforms.pytfix_switch_cases
s3	cCsPt|jdtjtjf�rL|j|jj��t|d|�ndS(s� Recursively extract consecutive Case statements that are made nested
        by the parser and add them to the stmts_list.
    ii����N(RR
RR	R
RtpopR(t	case_nodet
stmts_list((s../pycparser/ast_transforms.pyRcs"cCs�x&tr(t|�\}}|sPqqW|}x8t|tj�siy
|j}Wq2tk
re|SXq2Wd|jkr�d|jkr�|jjd�n|j	dkr�|j|_	n|S(sK Atomic specifiers like _Atomic(type) are unusually structured,
        conferring a qualifier upon the contained type.

        This function fixes a decl with atomic specifiers to have a sane AST
        structure, by removing spurious Typename->TypeDecl pairs and attaching
        the _Atomic qualifier in the right place.
    t_AtomicN(tTruet_fix_atomic_specifiers_onceRRtTypeDeclttypetAttributeErrortqualsRtdeclnameRtname(tdecltfoundttyp((s../pycparser/ast_transforms.pytfix_atomic_specifiersls
	

	cCs�|}d}|j}xi|dk	r�t|tj�rId|jkrIPny|}|}|j}Wqtk
r||tfSXqWt|tj�s�t	�|j|_d|jjkr�|jjj
d�n|tfS(s� Performs one 'fix' round of atomic specifiers.
        Returns (modified_decl, found) where found is True iff a fix was made.
    RN(RRRRtTypenameRRtFalseRRRR(Rtparenttgrandparenttnode((s../pycparser/ast_transforms.pyR�s"	!

N(tRRRR"R(((s../pycparser/ast_transforms.pyt<module>
s	V