Hacked By AnonymousFox
�
i��f� � �H � d Z dZddlZddlmZmZ ddlmZmZm Z ddlm
Z
mZ ddlm
Z
mZ ddlmZ dd lmZmZ ddlZdd
lmZmZmZmZ ddlmZmZ ddlmZmZmZ dd
lmZ G d� de� � Z G d� de� � Z! G d� de� � Z" G d� de
� � Z# G d� de$� � Z% G d� d� � Z& G d� de
� � Z' G d� de
� � Z( G d� de� � Z)dNd!�Z* G d"� d#� � Z+ e,d$� � d%z
fd&�Z- e,d'� � d%z
fd(�Z.d)� Z/ G d*� d+e)� � Z0 G d,� d-e0� � Z1 G d.� d/e0� � Z2 G d0� d1e2� � Z3 G d2� d3e2� � Z4 G d4� d5e2� � Z5 G d6� d7e2� � Z6 G d8� d9e2� � Z7 G d:� d;e2e1� � Z8 G d<� d=e6� � Z9 G d>� d?e2� � Z: G d@� dAe2� � Z; G dB� dCe0� � Z< G dD� dEe)� � Z= G dF� dGe=� � Z> G dH� dIe>� � Z? G dJ� dKe>� � Z@ G dL� dMe)� � ZAe0e3e4e5e6e7e:e9e;e=e?e@e<e1e8fZBdS )Oa�
This is the ``docutils.parsers.rst.states`` module, the core of
the reStructuredText parser. It defines the following:
:Classes:
- `RSTStateMachine`: reStructuredText parser's entry point.
- `NestedStateMachine`: recursive StateMachine.
- `RSTState`: reStructuredText State superclass.
- `Inliner`: For parsing inline markup.
- `Body`: Generic classifier of the first line of a block.
- `SpecializedBody`: Superclass for compound element members.
- `BulletList`: Second and subsequent bullet_list list_items
- `DefinitionList`: Second+ definition_list_items.
- `EnumeratedList`: Second+ enumerated_list list_items.
- `FieldList`: Second+ fields.
- `OptionList`: Second+ option_list_items.
- `RFC2822List`: Second+ RFC2822-style fields.
- `ExtensionOptions`: Parses directive option fields.
- `Explicit`: Second+ explicit markup constructs.
- `SubstitutionDef`: For embedded directives in substitution definitions.
- `Text`: Classifier of second line of a text block.
- `SpecializedText`: Superclass for continuation lines of Text-variants.
- `Definition`: Second line of potential definition_list_item.
- `Line`: Second line of overlined section title or transition marker.
- `Struct`: An auxiliary collection class.
:Exception classes:
- `MarkupError`
- `ParserError`
- `MarkupMismatch`
:Functions:
- `escape2null()`: Return a string, escape-backslashes converted to nulls.
- `unescape()`: Return a string, nulls removed or restored to backslashes.
:Attributes:
- `state_classes`: set of State classes used with `RSTStateMachine`.
Parser Overview
===============
The reStructuredText parser is implemented as a recursive state machine,
examining its input one line at a time. To understand how the parser works,
please first become familiar with the `docutils.statemachine` module. In the
description below, references are made to classes defined in this module;
please see the individual classes for details.
Parsing proceeds as follows:
1. The state machine examines each line of input, checking each of the
transition patterns of the state `Body`, in order, looking for a match.
The implicit transitions (blank lines and indentation) are checked before
any others. The 'text' transition is a catch-all (matches anything).
2. The method associated with the matched transition pattern is called.
A. Some transition methods are self-contained, appending elements to the
document tree (`Body.doctest` parses a doctest block). The parser's
current line index is advanced to the end of the element, and parsing
continues with step 1.
B. Other transition methods trigger the creation of a nested state machine,
whose job is to parse a compound construct ('indent' does a block quote,
'bullet' does a bullet list, 'overline' does a section [first checking
for a valid section header], etc.).
- In the case of lists and explicit markup, a one-off state machine is
created and run to parse contents of the first item.
- A new state machine is created and its initial state is set to the
appropriate specialized state (`BulletList` in the case of the
'bullet' transition; see `SpecializedBody` for more detail). This
state machine is run to parse the compound element (or series of
explicit markup elements), and returns as soon as a non-member element
is encountered. For example, the `BulletList` state machine ends as
soon as it encounters an element which is not a list item of that
bullet list. The optional omission of inter-element blank lines is
enabled by this nested state machine.
- The current line index is advanced to the end of the elements parsed,
and parsing continues with step 1.
C. The result of the 'text' transition depends on the next line of text.
The current state is changed to `Text`, under which the second line is
examined. If the second line is:
- Indented: The element is a definition list item, and parsing proceeds
similarly to step 2.B, using the `DefinitionList` state.
- A line of uniform punctuation characters: The element is a section
header; again, parsing proceeds as in step 2.B, and `Body` is still
used.
- Anything else: The element is a paragraph, which is examined for
inline markup and appended to the parent element. Processing
continues with step 1.
�reStructuredText� N)�FunctionType�
MethodType)�nodes�statemachine�utils)�ApplicationError� DataError)�StateMachineWS�StateWS)�fully_normalize_name)�unescape�whitespace_normalize_name)�
directives� languages�tableparser�roles)�escape2null�column_width)�punctuation_chars�roman�
urischemes)�split_escaped_whitespacec � � e Zd ZdS )�MarkupErrorN��__name__�
__module__�__qualname__� � �{/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/docutils/parsers/rst/states.pyr r y � � � � � � � � r! r c � � e Zd ZdS )�UnknownInterpretedRoleErrorNr r r! r"