+
    |f                        ^ RI Ht ^RIHtHtHt . R
Ot]P                  t]P                  t
]P                  t]P                  t]P                  t]P"                  tRtRP)                  ]4      t ! R R4      t ! R R]4      tR	# )    )Node)
namespacesvoidElementsspaceCharacters
TreeWalkerNonRecursiveTreeWalkerz<#UNKNOWN#> c                   n   a  ] tR t^t o RtR tR tR tRR ltR t	R t
R tR	 tRR ltR tR tRtV tR
# )r   zqWalks a tree yielding tokens

Tokens are dicts that all have a ``type`` field specifying the type of the
token.

c                    Wn         R# )z3Creates a TreeWalker

:arg tree: the tree to walk

Ntree)selfr   s   &&;/usr/lib/python3/dist-packages/html5lib/treewalkers/base.py__init__TreeWalker.__init__   s	     	    c                    \         hNNotImplementedError)r   s   &r   __iter__TreeWalker.__iter__"       !!r   c                    RRRV/# )znGenerates an error token with the given message

:arg msg: the error message

:returns: SerializeError token

typeSerializeErrordata )r   msgs   &&r   errorTreeWalker.error%   s     (&#66r   c              #  `   "   RRRVRVRV/x  V'       d   V P                  R4      x  R# R# 5i)a:  Generates an EmptyTag token

:arg namespace: the namespace of the token--can be ``None``

:arg name: the name of the element

:arg attrs: the attributes of the element as a dict

:arg hasChildren: whether or not to yield a SerializationError because
    this tag shouldn't have children

:returns: EmptyTag token

r   EmptyTagname	namespacer   zVoid element has childrenNr    )r   r%   r$   attrshasChildrens   &&&&&r   emptyTagTreeWalker.emptyTag/   s>      z64Iu 	 **899 s   ,.c                    RRRVRVRV/# )zGenerates a StartTag token

:arg namespace: the namespace of the token--can be ``None``

:arg name: the name of the element

:arg attrs: the attributes of the element as a dict

:returns: StartTag token

r   StartTagr$   r%   r   r   )r   r%   r$   r'   s   &&&&r   startTagTreeWalker.startTagD   s"     
Y 	r   c                    RRRVRV/# )zGenerates an EndTag token

:arg namespace: the namespace of the token--can be ``None``

:arg name: the name of the element

:returns: EndTag token

r   EndTagr$   r%   r   )r   r%   r$   s   &&&r   endTagTreeWalker.endTagU   s     Y( 	(r   c              #  &  "   TpVP                  \        4      pVR\        V4      \        V4      ,
           pV'       d	   RRRV/x  TpVP                  \        4      pV\        V4      R pV'       d	   RRRV/x  V'       d   RRRV/x  R# R# 5i)a  Generates SpaceCharacters and Characters tokens

Depending on what's in the data, this generates one or more
``SpaceCharacters`` and ``Characters`` tokens.

For example:

    >>> from html5lib.treewalkers.base import TreeWalker
    >>> # Give it an empty tree just so it instantiates
    >>> walker = TreeWalker([])
    >>> list(walker.text(''))
    []
    >>> list(walker.text('  '))
    [{u'data': '  ', u'type': u'SpaceCharacters'}]
    >>> list(walker.text(' abc '))  # doctest: +NORMALIZE_WHITESPACE
    [{u'data': ' ', u'type': u'SpaceCharacters'},
    {u'data': u'abc', u'type': u'Characters'},
    {u'data': u' ', u'type': u'SpaceCharacters'}]

:arg data: the text data

:returns: one or more ``SpaceCharacters`` and ``Characters`` tokens

Nr   SpaceCharactersr   
Characters)lstripr   lenrstrip)r   r   middleleftrights   &&   r   textTreeWalker.textc   s     2 _-,SYV,-,fd;;_-S[\"<88,fe<< s   BBBc                    RRRV/# )zLGenerates a Comment token

:arg data: the comment

:returns: Comment token

r   Commentr   r   )r   r   s   &&r   commentTreeWalker.comment   s     	6400r   Nc                    RRRVRVRV/# )zdGenerates a Doctype token

:arg name:

:arg publicId:

:arg systemId:

:returns: the Doctype token

r   Doctyper$   publicIdsystemIdr   )r   r$   rD   rE   s   &&&&r   doctypeTreeWalker.doctype   s"     	HH& 	&r   c                    RRRV/# )zRGenerates an Entity token

:arg name: the entity name

:returns: an Entity token

r   Entityr$   r   )r   r$   s   &&r   entityTreeWalker.entity   s     &$//r   c                2    V P                  RV,           4      # )zHandles unknown node typeszUnknown node type: r&   )r   nodeTypes   &&r   unknownTreeWalker.unknown   s    zz/(:;;r   r   )F)NN)__name__
__module____qualname____firstlineno____doc__r   r   r    r)   r-   r1   r<   r@   rF   rJ   rN   __static_attributes____classdictcell____classdict__s   @r   r   r      sG     "7:*"($=L1&"0< <r   c                   >   a  ] tR t^t o R tR tR tR tR tRt	V t
R# )r   c                    \         hr   r   r   nodes   &&r   getNodeDetails%NonRecursiveTreeWalker.getNodeDetails   r   r   c                    \         hr   r   r[   s   &&r   getFirstChild$NonRecursiveTreeWalker.getFirstChild   r   r   c                    \         hr   r   r[   s   &&r   getNextSibling%NonRecursiveTreeWalker.getNextSibling   r   r   c                    \         hr   r   r[   s   &&r   getParentNode$NonRecursiveTreeWalker.getParentNode   r   r   c              #  r  "   V P                   pVEe"   V P                  V4      pV^ ,          VR,          r#RpV\        8X  d   V P                  ! V!  x  EMV\        8X  d   V P
                  ! V!   F  pVx  K	  	  MV\        8X  da   Vw  rgrV'       d   V\        R,          8X  d-   V\        9   d"   V P                  WgVV4       F  pVx  K	  	  RpMV P                  WgV4      x  MtV\        8X  d   V P                  V^ ,          4      x  MNV\        8X  d   V P                  V^ ,          4      x  M(V\        8X  d   RpMV P!                  V^ ,          4      x  V'       d   V P#                  V4      p	MR p	V	e   T	pEKs  Vf   EKz  V P                  V4      pV^ ,          VR,          r#V\        8X  d>   Vw  rgrV'       d   V\        R,          8w  g   V\        9  d   V P%                  Wg4      x  V P                   VJ d   R pEK  V P'                  V4      p
V
e   T
pEK  V P)                  V4      pK  R # 5i)N:   NNFhtmlT)r   r]   DOCTYPErF   TEXTr<   ELEMENTr   r   r)   r-   COMMENTr@   ENTITYrJ   DOCUMENTrN   r`   r1   rc   rf   )r   currentNodedetailsr   r(   tokenr%   r$   
attributes
firstChildnextSiblings   &          r   r   NonRecursiveTreeWalker.__iter__   s    ii%))+6G#AJ'KwllG,,!YY0EK 1 ;B8	!Y*V2D%D$R^J^!%y
/:"<#"< #(K--	DDll71:..kk'!*--!" ll71:..!//<
!
%(!-"11+>G$+AJ'wCJ@	%)z&7I*IdZfNf"&++i">>yyK/&*"&"5"5k"BK".&1&*&8&8&Es &s   E"H7%H7	B.H7r   N)rP   rQ   rR   rS   r]   r`   rc   rf   r   rU   rV   rW   s   @r   r   r      s%     """";F ;Fr   N)	rp   rk   rl   rm   rn   ro   UNKNOWNr   r   )xml.domr   	constantsr   r   r   __all__DOCUMENT_NODErp   DOCUMENT_TYPE_NODErk   	TEXT_NODErl   ELEMENT_NODErm   COMMENT_NODErn   ENTITY_NODEro   rx   joinr   r   r   r   r   <module>r      s     A A3 

!
!~~





			
''/*]< ]<@HFZ HFr   