File: //usr/lib/python3/dist-packages/sphinx/__pycache__/parsers.cpython-310.pyc
o
�$�a; � @ s� d Z ddlZddlmZmZmZmZmZmZ ddl Z
ddlZ
ddl
mZ ddlm
Z
ddlmZ ddlmZ ddlmZ dd lmZ dd
lmZmZ erRddlmZ G dd
� d
e
jj�ZG dd� de
jjje�Zdddeeef fdd�Z dS )z�
sphinx.parsers
~~~~~~~~~~~~~~
A Base class for additional parsers.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)�
TYPE_CHECKING�Any�Dict�List�Type�Union)�nodes)�states)�
StringList)� Transform)�SmartQuotes)�RemovedInSphinx50Warning)�
append_epilog�prepend_prolog)�Sphinxc @ s( e Zd ZdZd
dd�Zeddd ��ZdS )�Parsera�
A base class of source parsers. The additional parsers should inherit this class instead
of ``docutils.parsers.Parser``. Compared with ``docutils.parsers.Parser``, this class
improves accessibility to Sphinx APIs.
The subclasses can access the following objects and functions:
self.app
The application object (:class:`sphinx.application.Sphinx`)
self.config
The config object (:class:`sphinx.config.Config`)
self.env
The environment object (:class:`sphinx.environment.BuildEnvironment`)
self.warn()
Emit a warning. (Same as :meth:`sphinx.application.Sphinx.warn()`)
self.info()
Emit an info message. (Same as :meth:`sphinx.application.Sphinx.info()`)
.. deprecated:: 1.6
``warn()`` and ``info()`` is deprecated. Use :mod:`sphinx.util.logging` instead.
.. deprecated:: 3.0
parser.app is deprecated.
�appr �returnNc C s || _ |j| _|j| _dS )z�set_application will be called from Sphinx to set app and other instance variables
:param sphinx.application.Sphinx app: Sphinx application object
N)�_app�config�env)�selfr � r �0/usr/lib/python3/dist-packages/sphinx/parsers.py�set_application6 s zParser.set_applicationc C s t jdtdd� | jS )Nzparser.app is deprecated.� )�
stacklevel)�warnings�warnr
r )r r r r r ? s z
Parser.app)r r r N)r r )�__name__�
__module__�__qualname__�__doc__r �propertyr r r r r r s
r c s` e Zd ZdZdeee f� fdd�Zdee e
f dejddfdd �Z
d
e
ddfdd�Z� ZS )
� RSTParserzA reST parser for Sphinx.r c s t � �� }|�t� |S )z�
Sphinx's reST parser replaces a transform class for smart-quotes by its own
refs: sphinx.io.SphinxStandaloneReader
)�super�get_transforms�remover )r �
transforms�� __class__r r r&