class documentation
class ParsedTypeDocstring(TypeDocstring, ParsedDocstring): (source)
Add 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 |
Not implemented. |
Method | to |
Present the type as a stan tree. |
Constant | FIELDS |
Undocumented |
Property | has |
Does this docstring have a non-empty body? |
Method | _convert |
Convert TokenType.OBJ and PEP 484 like TokenType.DELIMITER type to stan, merge them together. Leave the rest untouched. |
Method | _convert |
Convert type to Tag object. |
Method | _tokenize |
Undocumented |
Instance Variable | _lineno |
Undocumented |
Instance Variable | _tokens |
Undocumented |
Inherited from TypeDocstring
:
Method | __str__ |
No summary |
Instance Variable | warnings |
Undocumented |
Class Method | _tokenize |
Split the string in tokens for further processing. |
Static Method | _recombine |
Merge the special literal choices tokens together. |
Method | _build |
Undocumented |
Method | _convert |
Undocumented |
Method | _token |
Find the type of a token. Types are defined in C{TokenType} enum. |
Method | _trigger |
Append some warnings. |
Class Variable | _ast |
Undocumented |
Class Variable | _ast |
Undocumented |
Class Variable | _default |
Undocumented |
Class Variable | _natural |
Undocumented |
Class Variable | _natural |
Undocumented |
Class Variable | _token |
Undocumented |
Instance Variable | _annotation |
Undocumented |
Instance Variable | _warns |
Undocumented |
Inherited from ParsedDocstring
(via TypeDocstring
):
Method | get |
Returns the summary of this docstring. |
Method | get |
The table of contents of the docstring if titles are defined or None. |
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 | _compact |
Undocumented |
Instance Variable | _stan |
Undocumented |
Instance Variable | _summary |
Undocumented |
Undocumented
Parameters | |
annotation:Union[ | Undocumented |
warnsbool | Undocumented |
lineno:int | Undocumented |
Present the type as a stan tree.
Parameters | |
docstringDocstringLinker | Undocumented |
compact:bool | Undocumented |
Returns | |
Tag | Undocumented |
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) |
docstringDocstringLinker | Undocumented |
Returns | |
List[ | Undocumented |
Convert type to Tag
object.
Parameters | |
docstringDocstringLinker | Undocumented |
Returns | |
Tag | Undocumented |
Undocumented
Parameters | |
spec:nodes.document | Undocumented |
Returns | |
List[ | Undocumented |