compiler/stage2_l0/src/util/path.l0
Module util.path
Overview Symbols grouped by source file: compiler/stage2_l0/src/util/path.l0
Module: util.path
Source: compiler/stage2_l0/src/util/path.l0 Language: Dea/L0
Imports / Includes
std.stringstd.path
Symbols
- up_is_sep
- up_is_absolute
- up_find_last_sep
- up_has_parent
- up_basename
- up_parent
- up_is_l0_file
- up_stem
- up_join
Function up_is_sep
func up_is_sep(c: byte) -> bool
Check whether a byte is a path separator.
Parameters:
c: Byte to inspect.
Returns: true if c is / or \\.
Function up_is_absolute
func up_is_absolute(path: string) -> bool
Check whether a path is absolute.
Parameters:
path: Path string to inspect.
Returns: true for POSIX absolute paths and Windows drive-rooted paths.
Function up_find_last_sep
func up_find_last_sep(path: string) -> int
Find the last path separator in a string.
Parameters:
path: Path string to inspect.
Returns: Index of the last separator, or -1 if none is present.
Function up_has_parent
func up_has_parent(path: string) -> bool
Check whether a path has a parent component.
Parameters:
path: Path string to inspect.
Returns: true if the path contains a separator.
Function up_basename
func up_basename(path: string) -> string
Return the last component of a path.
Parameters:
path: Path string to inspect.
Returns: Basename with trailing separators ignored.
Function up_parent
func up_parent(path: string) -> string
Return the parent directory of a path.
Parameters:
path: Path string to inspect.
Returns: Parent directory, or . when the path has no parent.
Function up_is_l0_file
func up_is_l0_file(path: string) -> bool
Check whether a path ends with .l0 .
Parameters:
path: Path string to inspect.
Returns: true if path has the .l0 suffix.
Function up_stem
func up_stem(path: string) -> string
Return a path basename without the .l0 suffix when present.
Parameters:
path: Path string to inspect.
Returns: Basename stem.
Function up_join
func up_join(root: string, rel: string) -> string
Join a root path and relative path with one separator.
Parameters:
root: Root directory path.rel: Relative path to append.
Returns: Combined path.