l0_paths.py

l0_paths.py

Module: l0_paths

Source: compiler/stage1_py/l0_paths.py Language: Python

Symbols

Namespace l0_paths

Class l0_paths::SourceSearchPaths

Search configuration for L0 modules.

Resolution order: system_roots are searched first, then project_roots.

Member Data l0_paths.SourceSearchPaths.system_roots

1
List system_roots

Member Data l0_paths.SourceSearchPaths.project_roots

1
List project_roots

Function l0_paths.SourceSearchPaths.add_system_root

1
None l0_paths.SourceSearchPaths.add_system_root(self, str|Path root)

Add a path to the system search roots.

Parameters:

  • root: The directory path to add.

    Function l0_paths.SourceSearchPaths.add_project_root

1
None l0_paths.SourceSearchPaths.add_project_root(self, str|Path root)

Add a path to the project search roots.

Parameters:

  • root: The directory path to add.

    Function l0_paths.SourceSearchPaths.module_relpath

1
Path l0_paths.SourceSearchPaths.module_relpath(self, str module_name)

Convert a dotted module name to its relative file path.

Example: ‘std.io’ -> ‘ std/io.l0

Parameters:

  • module_name: The dotted L0 module name.

Returns: The relative Path to the module file.

Function l0_paths.SourceSearchPaths.resolve

1
Path l0_paths.SourceSearchPaths.resolve(self, str module_name)

Find the absolute path for an L0 module name.

Parameters:

  • module_name: The dotted L0 module name.

Returns: The absolute Path to the first matching file found.