class documentation

class _ParseVisitor(libcst.CSTVisitor): (source)

View In Hierarchy

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 visit_AnnAssign Undocumented
Method visit_Call Undocumented
Method visit_ClassDef Undocumented
Method visit_Comparison Undocumented
Method visit_Decorator Undocumented
Method visit_EmptyLine Undocumented
Method visit_FunctionDef Undocumented
Method visit_IndentedBlock Undocumented
Method visit_ParenthesizedWhitespace Undocumented
Method visit_Return Undocumented
Method visit_SimpleStatementLine Undocumented
Method visit_SimpleStatementSuite Undocumented
Method visit_Subscript Undocumented
Method visit_TrailingWhitespace Undocumented
Constant METADATA_DEPENDENCIES 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 _get_containing_groups Get _StructuredComment groups that fully contain the given line range.
Method _get_position Undocumented
Method _has_containing_group Undocumented
Method _process_comment Process a single comment.
Method _visit_comment_owner Undocumented
Method _visit_decorators Undocumented
Method _visit_def Undocumented
def __init__(self): (source)

Undocumented

def visit_AnnAssign(self, node): (source)

Undocumented

def visit_Call(self, node): (source)

Undocumented

def visit_ClassDef(self, node): (source)

Undocumented

def visit_Comparison(self, node): (source)

Undocumented

def visit_Decorator(self, node): (source)

Undocumented

def visit_EmptyLine(self, node): (source)

Undocumented

def visit_FunctionDef(self, node): (source)

Undocumented

def visit_IndentedBlock(self, node): (source)

Undocumented

def visit_ParenthesizedWhitespace(self, node): (source)

Undocumented

def visit_Return(self, node): (source)

Undocumented

def visit_SimpleStatementLine(self, node): (source)

Undocumented

def visit_SimpleStatementSuite(self, node): (source)

Undocumented

def visit_Subscript(self, node): (source)

Undocumented

def visit_TrailingWhitespace(self, node): (source)

Undocumented

METADATA_DEPENDENCIES = (source)

Undocumented

Value
(libcst.metadata.PositionProvider, libcst.metadata.ParentNodeProvider)
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 _get_containing_groups(self, start_line, end_line=None): (source)

Get _StructuredComment groups that fully contain the given line range.

def _get_position(self, node): (source)

Undocumented

def _has_containing_group(self, start_line, end_line=None): (source)

Undocumented

def _process_comment(self, line, comment, open_ended): (source)

Process a single comment.

def _visit_comment_owner(self, node, cls=LineRange): (source)

Undocumented

def _visit_decorators(self, node): (source)

Undocumented

def _visit_def(self, node): (source)

Undocumented