Пример #1
0
    def visit_Module(self, node):
        # build all types
        def gen_include(t):
            return "/".join(("pythonic", ) + t) + ".hpp"

        headers = map(Include, sorted(map(gen_include, self.dependencies)))

        body = map(self.visit, node.body)

        nsbody = body + self.declarations + self.definitions
        ns = Namespace(pythran_ward + self.passmanager.module_name, nsbody)
        self.result = CompilationUnit(headers + [ns])
Пример #2
0
    def visit_Module(self, node):
        """ Build a compilation unit. """
        # build all types
        headers = [Include(os.path.join("pythonic", "include",  *t) + ".hpp")
                   for t in self.dependencies]
        headers += [Include(os.path.join("pythonic", *t) + ".hpp")
                    for t in self.dependencies]

        body = map(self.visit, node.body)

        nsbody = body + self.declarations + self.definitions
        ns = Namespace(pythran_ward + self.passmanager.module_name, nsbody)
        self.result = CompilationUnit(headers + [ns])
Пример #3
0
    def visit_Module(self, node):
        """ Build a compilation unit. """
        # build all types
        deps = sorted(self.dependencies)
        headers = [Include(os.path.join("pythonic", "include",  *t) + ".hpp")
                   for t in deps]
        headers += [Include(os.path.join("pythonic", *t) + ".hpp")
                    for t in deps]

        decls_n_defns = [self.visit(stmt) for stmt in node.body]
        decls, defns = zip(*[s for s in decls_n_defns if s])

        nsbody = [s for ls in decls + defns for s in ls]
        ns = Namespace(pythran_ward + self.passmanager.module_name, nsbody)
        self.result = CompilationUnit(headers + [ns])
Пример #4
0
    def visit_Module(self, node):
        """ Build a compilation unit. """
        # build all types
        header_deps = sorted(self.dependencies)
        headers = [Include(os.path.join("pythonic", "include",
                                        *map(cxxid, t)) + ".hpp")
                   for t in header_deps]
        headers += [Include(os.path.join("pythonic", *map(cxxid, t)) + ".hpp")
                    for t in header_deps]

        decls_n_defns = list(filter(None, (self.visit(stmt) for stmt in
                                    node.body)))
        decls, defns = zip(*decls_n_defns) if decls_n_defns else ([], [])

        nsbody = [s for ls in decls + defns for s in ls]
        ns = Namespace(pythran_ward + self.passmanager.module_name, nsbody)
        self.result = CompilationUnit(headers + [ns])