HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sphinx/util/__pycache__/smartypants.cpython-310.pyc
o

�$�ar>�@s�dZddlZddlZddlmZmZmZddlmZddl	m
Z
ddlmZ
e�de
�idd	�d
d�dd
�dd�dd	�dd
�dd�dd�dd
�dd
�dd�dd�dd�dd	�dd�dd	�dd�id d	�d!d
�d"d�d#d�d$d%�d&d'�d(d)�d*d+�d,d�d-d.�d/d�d0d1�d2d�d3d4�d5d�d6d
�d7d��id8d9�d:d
�d;d�d<d�d=d	�d>d?�d@d
�dAd
�dBd
�dCd	�dDd�dEdF�dGdF�dHdI�dJdF�dKdI�dLd9��idMdN�dOd�dPd	�dQd9�dRdS�dTd�dUd�dVd
�dWd�dXd
�dYd�dZd�d[d\�d]d^�d_d�d`d%�dad'��d	ddSd
d	d?db��Zdmdceddedeefdfdg�Zejdfdheeeefdieddedeeeddffdjdk�Ze
dlk�rBee_ee_eej_dSdS)nuP
    sphinx.util.smartypants
    ~~~~~~~~~~~~~~~~~~~~~~~

    This is extracted (with minor adaptations for flake8 compliance) from
    docutils’ docutils/utils/smartquotes.py as of revision 8097 (30 May 2017),
    in order to backport for Sphinx usage with Docutils < 0.14 extra language
    configurations and fixes. Replaces earlier smartypants version as used up
    to Sphinx 1.5.6.

    :copyright: © 2010 Günter Milde,
                original `SmartyPants`_: © 2003 John Gruber
                smartypants.py:          © 2004, 2007 Chad Miller
    :license: Released under the terms of the `2-Clause BSD license`_, in short:

       Copying and distribution of this file, with or without modification,
       are permitted in any medium without royalty provided the copyright
       notices and this notice are preserved.
       This file is offered as-is, without any warranty.

    .. _SmartyPants: https://daringfireball.net/projects/smartypants/
    .. _2-Clause BSD license: https://spdx.org/licenses/BSD-2-Clause

    See the LICENSE file and the original docutils code for details.

�N)�	Generator�Iterable�Tuple)�smartquotes)�RemovedInSphinx60Warning)�__version_info__z&sphinx.util.smartypants is deprecated.�afu“”‘’zaf-x-altquotu„”‚’�bgu„“‚‘�cau
«»“”zca-x-altquot�cszcs-x-altquotu
»«›‹�dazda-x-altquot�dezde-x-altquotzde-chu
«»‹›�el�enzen-uk-x-altquotu‘’“”�eo�eszes-x-altquot�etzet-x-altquot�eu�fiu””’’zfi-x-altquotu
»»››�fr)u« u »�“�”zfr-x-altquot)�« � »rrzfr-chzfr-ch-x-altquot)rru‹ u ›�gl�heu
”“»«zhe-x-altquot�hru„”‘’zhr-x-altquot�hsbz
hsb-x-altquot�huu
„”«»�is�itzit-chzit-x-altquot�jau「」『』�lt�lv�mk�nlznl-x-altquot�nbu
«»’’�nnznn-x-altquotu
«»‘’�nozno-x-altquot�plzpl-x-altquotu
«»‚’�ptzpt-br�ro�ruu
«»„“�shzsh-x-altquot�skzsk-x-altquot�slzsl-x-altquot�sqzsq-x-altquotu“„‘‚�sru„”’’zsr-x-altquot�svzsv-x-altquot)�trztr-x-altquot�ukzuk-x-altquotzzh-cnzzh-tw�text�language�returncCs�t�|�}z|j}Wntyd}Ynwd}t�d|f|j|�}t�d|f|j|�}t�d|j|j	|�}t�d|j	|j|�}|�
d�rStjd||tjd	�}d
}d}t�d|ftj
tjB�}|�d
|j	|�}|j|krt�dtj�}|�||�}t�d|ftj
tjB�}	|	�d
|j|�}t�d|ftj
tjB�}	|	�d|j|�}t�d|j	|�}t�d|ftj
�}
|
�d
|j|�}t�d|ftj
�}|�|j|�}t�d|ftj
�}|�d
|j|�}t�d|j|�}|S)u
    Parameter:  - text string (unicode or bytes).
                - language (`BCP 47` language tag.)
    Returns:    The `text`, with "educated" curly quote characters.

    Example input:  "Isn't this fun?"
    Example output: “Isn’t this fun?“;
    u’z)[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]z^'(?=%s\\B)z^"(?=%s\\B)z"'(?=\w)z'"(?=\w)rz'(?=\d{2}s))�flagsz[^\ \t\r\n\[\{\(\-]z&#8211;|&#8212;a<
                    (
                            \s          |   # a whitespace char, or
                            &nbsp;      |   # a non-breaking space entity, or
                            --          |   # dashes, or
                            &[mn]dash;  |   # named dash entities
                            %s          |   # or decimal entities
                            &\#x201[34];    # or hex
                    )
                    '                 # the quote
                    (?=\w)            # followed by a word character
                    z\1z(?<=(\w|\d))'(?=\w)z�
                    (%s)
                    '
                    (?!\s  |       # whitespace
                       s\b |
                        \d         # digits   ('80s)
                    )
                    zc
                    (%s)
                    '
                    (\s | s\b)
                    z\1%s\2�'a<
                    (
                            \s          |   # a whitespace char, or
                            &nbsp;      |   # a non-breaking space entity, or
                            --          |   # dashes, or
                            &[mn]dash;  |   # named dash entities
                            %s          |   # or decimal entities
                            &\#x201[34];    # or hex
                    )
                    "                 # the quote
                    (?=\w)            # followed by a word character
                    z�
                    #(%s)?   # character that indicates the quote should be closing
                    "
                    (?=\s)
                    z}
                    (%s)   # character that indicates the quote should be closing
                    "
                    �")r�
smartchars�
apostrophe�	Exception�re�sub�csquote�cpquote�opquote�osquote�
startswith�UNICODE�compile�VERBOSE)r5r6�smartr<�punct_class�close_class�
dec_dashes�opening_single_quotes_regex�apostrophe_regex�closing_single_quotes_regex�opening_double_quotes_regex�closing_double_quotes_regex�rQ�9/usr/lib/python3/dist-packages/sphinx/util/smartypants.py�
educateQuotes�sr


�
�
�
�
��
�������rS�text_tokens�attrccs��d}d}d}d}d}d}|dkrd}d}d}nO|dkr#d}d}d}nD|dkr0d}d}d	}d}n7|d
kr7d}n0d|vr=d}d|vrCd}d
|vrId}d|vrOd}d|vrUd}d|vr[d	}d|vrad}d|vrgd}d}	|D]�\}
}|
dksu|sy|Vqk|
dkr�|dd�}	|Vqk|dd�}t�|�}|r�t�dd|�}|dkr�t�|�}n|dkr�t�|�}n	|d	kr�t�|�}|r�t�|�}|r�t�||�}|dkr�t�	||�}|r�|	�
dd��
dd�}
t|
||�dd�}|r�t�||�}|}	tj|dd�}|VqkdS)a5Return iterator that "educates" the items of `text_tokens`.

    This is modified to intercept the ``attr='2'`` as it was used by the
    Docutils 0.13.1 SmartQuotes transform in a hard coded way. Docutils 0.14
    uses ``'qDe'``` and is configurable, and its choice is backported here
    for use by Sphinx with earlier Docutils releases. Similarly ``'1'`` is
    replaced by ``'qde'``.

    Use ``attr='qDbe'``, resp. ``'qdbe'`` to recover Docutils effect of ``'2'``,
    resp. ``'1'``.

    refs: https://sourceforge.net/p/docutils/mailman/message/35869025/
    Fr�1T��2��3�z-1�q�b�B�d�D�i�e�w� �tag�literal���Nz&quot;r:�;r9)�restore)
r�processEscapesr>r?�
educateDashes�educateDashesOldSchool�educateDashesOldSchoolInverted�educateEllipses�educateBackticks�educateSingleBackticks�replacerS�stupefyEntities)rTrUr6�convert_quot�	do_dashes�do_backticks�	do_quotes�do_ellipses�
do_stupefy�prev_token_last_char�ttyper5�	last_char�contextrQrQrR�educate_tokens�s��!


�r})r�
rY)r)�__doc__r>�warnings�typingrrr�docutils.utilsr�sphinx.deprecationr�sphinx.util.docutilsr�docutils_version�warn�
langquotes�strrS�default_smartypants_attrr}r;�quotesrQrQrQrR�<module>sP���������
���
������������������!�"�#�$�%�&�'�(�)�+�,�-�.�0�1�3�4�5�8�9�<�=�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Zs���
�
	�