示例#1
0
文件: server.py 项目: yaoshaojun/pyhp
    def _bytecode(self, filename):
        filename = os.path.abspath(self.root + filename)

        # bytecode cache based on the filename
        try:
            return self.cached_files[filename]
        except KeyError:
            data = self._read_file(filename)
            if data is None:
                return None

            ast = source_to_ast(data)
            bc = compile_ast(ast, ast.scope, unicode(filename))

            self.cached_files[filename] = bc

        return bc
示例#2
0
文件: main.py 项目: yaoshaojun/pyhp
def ast(source):
    ast = source_to_ast(source)
    return ast
示例#3
0
文件: main.py 项目: blakev/pyhp
def ast(source):
    ast = source_to_ast(source)
    return ast