
    ?d                     &    d Z ddlmZ ddlmZ d Zy)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                      fd |        y)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                    t        | t        j                        r| j                  j	                         j                  d      r\| j                  | j                  j                  d      z
  }t        j                  t        j                  | j                  d|dff      S yd}t        | j                  dd       D ]4  \  }} |      }|s| j                  j                  ||z   |       |dz  }6 y)z,Inserts a continuation marker into the node.z\

 r   )typevaluecontextN   )
isinstancer   Leafprefixlstrip
startswithlinenocountr   CONTINUATION	enumeratechildreninsert)node
new_linenonum_insertedindexchildcontinuation_node
RecSplicers         B/usr/lib/python3/dist-packages/yapf/pytree/continuation_splicer.pyr   z'SpliceContinuations.<locals>.RecSplicer#   s    $$					(	(	0[[4;;#4#4T#::
{{**++*a)+ 	+ L!$--"23 u$U+	U\13DE	    N )treer   s    @r   SpliceContinuationsr#      s    " Tr    N)__doc__lib2to3r   yapf.yapflibr   r#   r!   r    r   <module>r'      s     %r    