예제 #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