kr.motd.maven.sphinx.dist.docutils.parsers.rst.states$py.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sphinx-maven-plugin Show documentation
Show all versions of sphinx-maven-plugin Show documentation
Maven plugin that creates the site with Sphinx
???? 1? f$0 R(Lorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject; __doc__ ?
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.
org/python/core/PyString fromInterned .(Ljava/lang/String;)Lorg/python/core/PyString;
org/python/core/PyFrame
setglobal /(Ljava/lang/String;Lorg/python/core/PyObject;)V
setline (I)V
reStructuredText
__docformat__ setlocal
sys org/python/core/imp importOne H(Ljava/lang/String;Lorg/python/core/PyFrame;I)Lorg/python/core/PyObject; " #
! $ re & types ( java/lang/String * FunctionType ,
MethodType .
importFrom \(Ljava/lang/String;[Ljava/lang/String;Lorg/python/core/PyFrame;I)[Lorg/python/core/PyObject; 0 1
! 2 docutils 4 nodes 6 statemachine 8 utils : ApplicationError < DataError > docutils.statemachine @ StateMachineWS B StateWS D docutils.nodes F fully_normalize_name H normalize_name J whitespace_normalize_name L docutils.parsers.rst N
directives P languages R tableparser T roles V docutils.parsers.rst.languages X en Z _fallback_language_module \ docutils.utils ^ escape2null ` unescape b column_width d punctuation_chars f roman h
urischemes j split_escaped_whitespace l org/python/core/PyObject n getname .(Ljava/lang/String;)Lorg/python/core/PyObject; p q
r MarkupError t
MarkupError$1
__module__ w __name__ y getf_locals ()Lorg/python/core/PyObject; { |
} docutils/parsers/rst/states$py Lorg/python/core/PyCode; v ? ? ? org/python/core/Py ? makeClass a(Ljava/lang/String;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;)Lorg/python/core/PyObject; ? ?
? ? java/util/Arrays ? fill (([Ljava/lang/Object;Ljava/lang/Object;)V ? ?
? ? UnknownInterpretedRoleError ? UnknownInterpretedRoleError$2 ? ? ? ? "InterpretedRoleNotImplementedError ? $InterpretedRoleNotImplementedError$3 ? ? ? ? ParserError ?
ParserError$4 ? ? ? ? Exception ? MarkupMismatch ? MarkupMismatch$5 ? ? ? ? EmptyObjects [Lorg/python/core/PyObject; ? ? ? ? Struct ? Struct$6 3Stores data attributes for dotted-attribute access. ? org/python/core/PyFunction ? f_globals Lorg/python/core/PyObject; ? ? ?
__init__$7 getlocal (I)Lorg/python/core/PyObject; ? ?
? __dict__ ? __getattr__ ? q
o ? update ? __call__ S(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ? ?
o ? f_lasti I ? ? ? None ? ? ? ? ? ? ? ? j(Lorg/python/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;)V ? ?
? ? __init__ ? ? ? ? ? RSTStateMachine ? RSTStateMachine$8 y
reStructuredText's master StateMachine.
The entry point to reStructuredText parsing is the `run()` method.
?
newInteger (I)Lorg/python/core/PyInteger; ? ?
? ? True ? ? run$9 ?
Parse `input_lines` and modify the `document` node in place.
Extend `StateMachineWS.run()`: set up parse-global data and
run the StateMachine.
? getglobal ? q
? get_language ? settings ?
language_code ? language ? __setattr__ ?
o ? match_titles ? _is 6(Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ? ?
o ? __nonzero__ ()Z ? ?
o ? Inliner ? 9(Lorg/python/core/ThreadState;)Lorg/python/core/PyObject; ? ?
o (ILorg/python/core/PyObject;)V
init_customizations reporter org/python/core/PyList ([Lorg/python/core/PyObject;)V ?
False document title_styles
section_level section_bubble_up_kludge inliner g(Lorg/python/core/ThreadState;[Lorg/python/core/PyObject;[Ljava/lang/String;)Lorg/python/core/PyObject; ?
o memo attach_observer note_source! node# run% source' __getitem__) ?
o* input_source, __debug__. _eq0 ?
o1 .RSTStateMachine.run() results should be empty!3 AssertionError5
makeException S(Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyException;78
?9 ? ? ?; ? ? ?= NestedStateMachine? NestedStateMachine$10 h
StateMachine run from within other StateMachine runs, to parse nested
document structures.
B run$11 ?
Parse `input_lines` and populate a `docutils.nodes.document` instance.
Extend `StateMachineWS.run()`: set up document-wide data.
E ?(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ?G
oH 1NestedStateMachine.run() results should be empty!JD ? ?LA ? ?N RSTStateP RSTState$12 `
reStructuredText State superclass.
Contains methods used by all State subclasses.
S nested_smU nested_sm_cacheW __init__$13 org/python/core/PyDictionaryZ
state_classes\
initial_state^ Body`
[ nested_sm_kwargscY ? ?e runtime_init$14 runtime_inith
state_machinej parentl hasattrn get_source_and_linep m(Lorg/python/core/ThreadState;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; ?r
os __not__u |
ovg ? ?x goto_line$15 T
Jump to input line `abs_line_offset`, ignoring jumps past the end.
{ goto_line} setException M(Ljava/lang/Throwable;Lorg/python/core/PyFrame;)Lorg/python/core/PyException;?
?? EOFError? org/python/core/PyException? match (Lorg/python/core/PyObject;)Z??
?? java/lang/Throwable?z ? ?? no_match$16 s
Override `StateWS.no_match` to generate a system message.
This code should never be run.
? severe? jInternal error: no transition pattern match. State: "%s"; transitions: %s; context: %s; current line: %r.? org/python/core/PyTuple? __class__? line?
? _mod? ?
o?? ? ?? no_match? bof$17 Called at beginning of file.?? ? ?? bof? nested_parse$18 g
Create a new StateMachine rooted at `node` and run it over the input
`block`.
? _iadd? ?
o? len? pop?
IndexError? debug?
_callextra ~([Lorg/python/core/PyObject;[Ljava/lang/String;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;??
o? append? unlink? abs_line_offset? _sub? ?
o? _ne? ?
o? next_line?? ? ?? nested_parse? nested_list_parse$19 ?
Create a new StateMachine rooted at `node` and run it over the input
`block`. Also keep track of optional intermediate blank lines and the
required final one.
? copy? __setitem__ 7(Lorg/python/core/PyObject;Lorg/python/core/PyObject;)V??
o? states? blank_finish? items? __iter__? |
o? unpackSequence 8(Lorg/python/core/PyObject;I)[Lorg/python/core/PyObject;??
?? setattr? __iternext__? |
o?? ? ?? nested_list_parse?
section$20 =Check for a valid subsection and create one if it checks out.? check_subsection? new_subsection?? ? ?? section? check_subsection$21?
Check for a valid subsection header. Return 1 (true) or None (false).
When a new section is reached that isn't a subsection of the current
section, back up the line count (use ``previous_line(-x)``), then
``raise EOFError``. The current StateMachine will finish, then the
calling StateMachine can re-examine the title. This will work its way
back up the calling chain until the correct section level isreached.
@@@ Alternative: Evaluate the title, store the title info & level, and
back up the chain until that level is reached. Store in memo? Or
return in results?
:Exception: `EOFError` when a sibling or supersection encountered.
? index? _add? ?
o?
ValueError title_inconsistent _le ?
o
previous_line 9(Lorg/python/core/PyObject;)Lorg/python/core/PyException;7
?? ? ?
title_inconsistent$22 Title level inconsistent:
literal_block ? ? new_subsection$23 ?Append new subsection to document tree. On return, check level. inline_text title astext names! note_implicit_target# line_offset% input_lines' __getslice__ j(Lorg/python/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;)*
o+ input_offset- ? ?/ paragraph$24 W
Return a list (paragraph & messages) & a boolean: literal_block next?
2
4 join6 rstrip8 search: (?