class documentation

Visitor for parsing a source tree. Attributes: structured_comment_groups: Ordered map from a line range to the "type:" and "pytype:" comments within the range. Line ranges come in several flavors: * Instances of the base LineRange class represent single logical statements. These ranges are ascending and non-overlapping and record all structured comments found. * Instances of the Call subclass represent function calls. These ranges are ascending by start_line but may overlap and only record "pytype:" comments. variable_annotations: Sequence of PEP 526-style variable annotations with line numbers. decorators: Sequence of lines at which decorated functions are defined. defs_start: The line number at which the first class or function definition appears, if any.

Method __init__ Undocumented
Method enter_AsyncWith Undocumented
Method enter_With Undocumented
Method generic_visit Called when no visit function is found for a node type.
Method leave_AsyncWith Undocumented
Method leave_Module Undocumented
Method leave_With Undocumented
Method visit_AnnAssign Undocumented
Method visit_AsyncFunctionDef Undocumented
Method visit_AsyncWith Undocumented
Method visit_Call Undocumented
Method visit_ClassDef Undocumented
Method visit_Compare Undocumented
Method visit_FunctionDef Undocumented
Method visit_Match Undocumented
Method visit_Return Undocumented
Method visit_Subscript Undocumented
Method visit_Try Undocumented
Method visit_With Undocumented
Instance Variable block_depth Undocumented
Instance Variable block_returns Undocumented
Instance Variable decorators Undocumented
Instance Variable defs_start Undocumented
Instance Variable function_ranges Undocumented
Instance Variable matches Undocumented
Instance Variable structured_comment_groups Undocumented
Instance Variable variable_annotations Undocumented
Method _add_structured_comment_group Adds an empty _StructuredComment group with the given line range.
Method _process_structured_comments Undocumented
Method _visit_decorators Undocumented
Method _visit_def Undocumented
Method _visit_function_def Undocumented
Method _visit_with Undocumented
Instance Variable _raw_structured_comments Undocumented

Inherited from BaseVisitor:

Method enter Does a pre-order traversal of the AST.
Method leave Called after visit() to do any cleanup that enter() needs.
Method visit Does a post-order traversal of the AST.
Method _call_visitor Undocumented
Method _children Children to recurse over.
Instance Variable _ast Undocumented
Instance Variable _node_children Undocumented
def __init__(self, raw_structured_comments): (source)
def enter_AsyncWith(self, node): (source)

Undocumented

def enter_With(self, node): (source)

Undocumented

def generic_visit(self, node): (source)

Called when no visit function is found for a node type.

def leave_AsyncWith(self, node): (source)

Undocumented

def leave_Module(self, node): (source)

Undocumented

def leave_With(self, node): (source)

Undocumented

def visit_AnnAssign(self, node): (source)

Undocumented

def visit_AsyncFunctionDef(self, node): (source)

Undocumented

def visit_AsyncWith(self, node): (source)

Undocumented

def visit_Call(self, node): (source)

Undocumented

def visit_ClassDef(self, node): (source)

Undocumented

def visit_Compare(self, node): (source)

Undocumented

def visit_FunctionDef(self, node): (source)

Undocumented

def visit_Match(self, node): (source)

Undocumented

def visit_Return(self, node): (source)

Undocumented

def visit_Subscript(self, node): (source)

Undocumented

def visit_Try(self, node): (source)

Undocumented

def visit_With(self, node): (source)

Undocumented

block_depth: int = (source)

Undocumented

block_returns = (source)

Undocumented

decorators: list = (source)

Undocumented

defs_start = (source)

Undocumented

function_ranges: dict = (source)

Undocumented

Undocumented

structured_comment_groups = (source)

Undocumented

variable_annotations: list = (source)

Undocumented

def _add_structured_comment_group(self, start_line, end_line, cls=LineRange): (source)

Adds an empty _StructuredComment group with the given line range.

def _process_structured_comments(self, line_range, cls=LineRange): (source)

Undocumented

def _visit_decorators(self, node): (source)

Undocumented

def _visit_def(self, node): (source)

Undocumented

def _visit_function_def(self, node): (source)

Undocumented

def _visit_with(self, node): (source)

Undocumented

_raw_structured_comments = (source)

Undocumented