a
    
d                     @   s(   d Z ddlmZ ddlmZ dd ZdS )zInsert "continuation" nodes into lib2to3 tree.

The "backslash-newline" continuation marker is shoved into the node's prefix.
Pull them out and make it into nodes of their own.

  SpliceContinuations(): the main function exported by this module.
    )pytree)format_tokenc                    s    fdd  |  dS )zGiven a pytree, splice the continuation marker into nodes.

  Arguments:
    tree: (pytree.Node) The tree to work on. The tree is modified by this
      function.
  c                    s   t | tjrN| j drJ| j| jd }tjtj	| jd|dffdS dS d}t
| jdd D ].\}} |}|rd| j|| | |d7 }qddS )z,Inserts a continuation marker into the node.z\

 r   )typevaluecontextN   )
isinstancer   ZLeafprefixlstrip
startswithlinenocountr   ZCONTINUATION	enumeratechildreninsert)nodeZ
new_linenoZnum_insertedindexchildZcontinuation_node
RecSplicer i/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/yapf/pytree/continuation_splicer.pyr   #   s    
z'SpliceContinuations.<locals>.RecSplicerNr   )treer   r   r   SpliceContinuations   s    r   N)__doc__Zyapf_third_party._ylib2to3r   Zyapf.yapflibr   r   r   r   r   r   <module>   s   