Esempio n. 1
0
 def _to_require(self, fname, path=None):
     path = shorten_submodule_path(path)
     modtable = self.modtable
     if modtable.builtin(fname):
         return VOID
     fname = rpath.realpath(fname)
     return Require(fname, self, path=path)
Esempio n. 2
0
 def _to_require(self, fname, path=None):
     path = shorten_submodule_path(path)
     modtable = self.modtable
     if modtable.builtin(fname):
         return VOID
     fname = rpath.realpath(fname)
     return Require(fname, self, path=path)
Esempio n. 3
0
 def expand_to_ast(self, fname):
     assert fname is not None
     fname = rpath.realpath(fname)
     data = expand_file_rpython(fname, self._lib_string())
     self.modtable.enter_module(fname)
     module = self.to_module(pycket_json.loads(data))
     module = finalize_module(module)
     self.modtable.exit_module(fname, module)
     return module
Esempio n. 4
0
 def load_json_ast_rpython(self, modname, fname):
     assert modname is not None
     modname = rpath.realpath(modname)
     data = readfile_rpython(fname)
     self.modtable.enter_module(modname)
     module = self.to_module(pycket_json.loads(data))
     module = finalize_module(module)
     self.modtable.exit_module(modname, module)
     return module
Esempio n. 5
0
 def expand_to_ast(self, fname):
     assert fname is not None
     fname = rpath.realpath(fname)
     data = expand_file_rpython(fname, self._lib_string())
     self.modtable.enter_module(fname)
     module = self.to_module(pycket_json.loads(data))
     module = finalize_module(module)
     self.modtable.exit_module(fname, module)
     return module
Esempio n. 6
0
 def load_json_ast_rpython(self, modname, fname):
     assert modname is not None
     modname = rpath.realpath(modname)
     data = readfile_rpython(fname)
     self.modtable.enter_module(modname)
     module = self.to_module(pycket_json.loads(data))
     module = finalize_module(module)
     self.modtable.exit_module(modname, module)
     return module
Esempio n. 7
0
def parse_path(p):
    assert len(p) >= 1
    arr = convert_path(p)
    srcmod, path = arr[0], arr[1:]
    # Relative module names go into the path.
    # None value for the srcmod indicate the current module
    if srcmod in (".", ".."):
        return None, arr
    if not ModTable.builtin(srcmod):
        srcmod = rpath.realpath(srcmod)
    return srcmod, path
Esempio n. 8
0
def parse_path(p):
    assert len(p) >= 1
    arr = convert_path(p)
    srcmod, path = arr[0], arr[1:]
    # Relative module names go into the path.
    # None value for the srcmod indicate the current module
    if srcmod in (".", ".."):
        return None, arr
    if not ModTable.builtin(srcmod):
        srcmod = rpath.realpath(srcmod)
    return srcmod, path
Esempio n. 9
0
    def load_json_ast_rpython(self, modname, fname):
        assert modname is not None
        modname = rpath.realpath(modname)
        self.modtable.enter_module(modname)

        if self.multi_mod_flag:
            mod_ast = self.multi_mod_mapper.get_mod(modname)
            module = self.to_module(mod_ast)
        else:
            data = readfile_rpython(fname)
            module = self.to_module(pycket_json.loads(data))

        module = finalize_module(module)
        self.modtable.exit_module(modname, module)
        return module
Esempio n. 10
0
    def load_json_ast_rpython(self, modname, fname):
        assert modname is not None
        modname = rpath.realpath(modname)
        self.modtable.enter_module(modname)

        if self.multi_mod_flag:
            mod_ast = self.multi_mod_mapper.get_mod(modname)
            module = self.to_module(mod_ast)
        else:
            data = readfile_rpython(fname)
            module = self.to_module(pycket_json.loads(data))

        module = finalize_module(module)
        self.modtable.exit_module(modname, module)
        return module
Esempio n. 11
0
 def __init__(self, json_file_name):
     assert json_file_name is not None and json_file_name != ""
     data = readfile_rpython(rpath.realpath(os.path.abspath(json_file_name)))
     self.source_json = json_file_name
     self.mod_map = pycket_json.loads(data)
Esempio n. 12
0
 def __init__(self, json_file_name):
     assert json_file_name is not None and json_file_name != ""
     data = readfile_rpython(rpath.realpath(os.path.abspath(json_file_name)))
     self.source_json = json_file_name
     self.mod_map = pycket_json.loads(data)