tex.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:SoCFoundationFlow 作者: mattaw 项目源码 文件源码
def scan_aux(self, node):
        """
        A recursive regex-based scanner that finds included auxiliary files.
        """
        nodes = [node]
        re_aux = re.compile(r'\\@input{(?P<file>[^{}]*)}', re.M)

        def parse_node(node):
            code = node.read()
            for match in re_aux.finditer(code):
                path = match.group('file')
                found = node.parent.find_or_declare(path)
                if found and found not in nodes:
                    Logs.debug('tex: found aux node ' + found.abspath())
                    nodes.append(found)
                    parse_node(found)

        parse_node(node)
        return nodes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号