class ParsedTypeDocstring(TypeDocstring, ParsedDocstring):
ParsedDocstring
interface on top of TypeDocstring
and allow to parse types from nodes.Node
objects, providing the --process-types option.Method | __init__ |
Undocumented |
Method | to_node |
Not implemented. |
Method | to_stan |
Present the type as a stan tree. |
Constant | FIELDS |
Undocumented |
Property | has_body |
Does this docstring have a non-empty body? |
Method | _convert_obj_tokens_to_stan |
Convert TokenType.OBJ and PEP 484 like TokenType.DELIMITER type to stan, merge them together. Leave the rest untouched. |
Method | _convert_type_spec_to_stan |
Convert type to Tag object. |
Method | _tokenize_node_type_spec |
Undocumented |
Instance Variable | _lineno |
Undocumented |
Instance Variable | _tokens |
Undocumented |
Inherited from TypeDocstring
:
Method | __str__ |
Returns ------- The parsed type in reStructuredText format. |
Instance Variable | warnings |
Undocumented |
Class Method | _tokenize_type_spec |
Split the string in tokens for further processing. |
Static Method | _recombine_set_tokens |
Merge the special literal choices tokens together. |
Method | _build_tokens |
Undocumented |
Method | _convert_type_spec_to_rst |
Undocumented |
Method | _token_type |
Find the type of a token. Types are defined in C{TokenType} enum. |
Method | _trigger_warnings |
Append some warnings. |
Class Variable | _ast_like_delimiters_regex |
Undocumented |
Class Variable | _ast_like_delimiters_regex_str |
Undocumented |
Class Variable | _default_regex |
Undocumented |
Class Variable | _natural_language_delimiters_regex |
Undocumented |
Class Variable | _natural_language_delimiters_regex_str |
Undocumented |
Class Variable | _token_regex |
Undocumented |
Instance Variable | _annotation |
Undocumented |
Instance Variable | _warns_on_unknown_tokens |
Undocumented |
Inherited from ParsedDocstring
:
Instance Variable | fields |
A list of Field s, each of which encodes a single field. The field's bodies are encoded as ParsedDocstrings. |
Instance Variable | _stan |
Undocumented |
Undocumented
Parameters | |
annotation:Union[ | Undocumented |
warns_on_unknown_tokens:bool | Undocumented |
lineno:int | Undocumented |
Parameters | |
docstring_linker:DocstringLinker | Undocumented |
Returns | |
Tag | Undocumented |
bool
=
Does this docstring have a non-empty body?
The body is the part of the docstring that remains after the fields have been split off.
Convert TokenType.OBJ
and PEP 484 like TokenType.DELIMITER
type to stan, merge them together. Leave the rest untouched.
Exemple:
>>> tokens = [("list", TokenType.OBJ), ("(", TokenType.DELIMITER), ("int", TokenType.OBJ), (")", TokenType.DELIMITER)] >>> ann._convert_obj_tokens_to_stan(tokens, NotFoundLinker()) ... [(Tag('code', children=['list', '(', 'int', ')']), TokenType.OBJ)]
Parameters | |
tokens:List[ | List of tuples: (token, type) |
docstring_linker:DocstringLinker | Undocumented |
Returns | |
List[ | Undocumented |
Tag
object.Parameters | |
docstring_linker:DocstringLinker | Undocumented |
Returns | |
Tag | Undocumented |