Your IP : 216.73.216.213


Current Path : /opt/alt/python36/lib64/python3.6/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/Tools/scripts/__pycache__/parseentities.cpython-36.opt-1.pyc

3

� f��@s�dZddlZddlZejd�Zddd�Zdd�Zedkr�eej	�d	krVe
ej	d	�ZnejZeej	�d
kr|e
ej	d
d�Z
nejZ
ej�Zee�Zee
e�dS)
a� Utility for parsing HTML entity definitions available from:

      http://www.w3.org/ as e.g.
      http://www.w3.org/TR/REC-html40/HTMLlat1.ent

    Input is read from stdin, output is written to stdout in form of a
    Python snippet defining a dictionary "entitydefs" mapping literal
    entity name to character or numeric entity.

    Marc-Andre Lemburg, mal@lemburg.com, 1999.
    Use as you like. NO WARRANTIES.

�Nz8<!ENTITY +(\w+) +CDATA +"([^"]+)" +-- +((?:.|\n)+?) *-->cCsXd}|dkrt|�}i}x:tj|||�}|s.P|j�\}}}||f||<|j�}qW|S)Nr)�len�entityRE�search�groups�end)�text�pos�endpos�d�m�name�charcode�comment�r�@/opt/alt/python36/lib64/python3.6/Tools/scripts/parseentities.py�parsesrcCs�|jd�t|j��}xz|D]r\}\}}|dd�dkrdt|dd
��}|dkrZd|}qlt|�}nt|�}dj|j��}|jd|||f�qW|jd	�dS)Nzentitydefs = {
�z&#��z'\%o'� z    '%s':	%s,  	# %s
z
}
���)�write�sorted�items�int�repr�join�split)�f�defsrrr
r�coderrr�	writefile"s


r!�__main__rr�w)rN)�__doc__�re�sys�compilerrr!�__name__r�argv�openZinfile�stdinZoutfile�stdout�readrrrrrr�<module>s