INNER CODE UNIT · Python

SnippetOpen

bsilverthorn/maccarone · src/maccarone/preprocessor.py:101

class SnippetOpen:
    indent: str
    guidance: str

def find_line_number(text: str, pos: int):
    #<<find the line number of the given char position>>
    return text.count('\n', 0, pos) + 1
    #<</>>

class RawSourceVisitor(NodeVisitor):
    def __init__(self, raw_source: str, block_at_line: Optional[int] = None):
        self._raw_source = raw_source
        self._block_at_line = block_at_line

    def generic_visit(self, node: Node, visited_children: List[Node]):
        return visited_children or node

    def visit_maccarone(self, node: Node, visited_children: list):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…