Your IP : 216.73.216.85


Current Path : /opt/alt/python37/lib64/python3.7/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/Tools/scripts/__pycache__/parseentities.cpython-37.pyc

B

� f��@s�dZddlZddlZe�d�Zddd�Zdd�Zedkr�eej	�d	krVe
ej	d	�ZnejZeej	�d
kr|e
ej	d
d�Z
nejZ
e��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:t�|||�}|s.P|��\}}}||f||<|��}qW|S)Nr)�len�entityRE�search�groups�end)�text�pos�endpos�d�m�name�charcode�comment�r�@/opt/alt/python37/lib64/python3.7/Tools/scripts/parseentities.py�parsesrcCs�|�d�t|���}xz|D]r\}\}}|dd�dkrdt|dd��}|dkrZd|}qlt|�}nt|�}d�|���}|�d|||f�qW|�d	�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__�r�w)rN)�__doc__�re�sys�compilerrr �__name__r�argv�openZinfile�stdinZoutfile�stdout�readrrrrrr�<module>s