Twisted
Home FAQ Docs Download Timeline Roadmap View Tickets Search
class documentation

class AfterCommentParser(TokenProcessor): (source)

Constructor: AfterCommentParser(lines)

View In Hierarchy

Python source code parser to pick up comment after assignment.

This parser takes a python code starts with assignment statement, and returns the comments for variable if exists.

Method __init__ Undocumented
Method fetch_rvalue Fetch right-hand value of assignment.
Method parse Parse the code and obtain comment after assignment.
Instance Variable comment Undocumented

Inherited from TokenProcessor:

Method fetch_token Fetch a next token from source code.
Method fetch_until Fetch tokens until specified token appeared.
Method get_line Returns specified line.
Instance Variable buffers Undocumented
Instance Variable current Undocumented
Instance Variable previous Undocumented
Instance Variable tokens Undocumented
def __init__(self, lines: Sequence[str]): (source)
def fetch_rvalue(self) -> Sequence[Token]: (source)

Fetch right-hand value of assignment.

def parse(self): (source)

Parse the code and obtain comment after assignment.

comment: str | None = (source)

Undocumented