loader

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package loader reads the source files of a program together with the modules they use ("use name;"), directly or through other modules.

Index

Constants

View Source
const (
	Ext         = ".kkl"
	CompiledExt = ".kkc"
)

Ext is the extension of Kukel source files, CompiledExt of bytecode files (a module compiled on its own, kukel build -module).

Variables

This section is empty.

Functions

func Load

func Load(files []string, path []string) ([]*ast.File, error)

Load parses the program's files and every module they use, and returns them in compile order: each module before the files that use it, then the program's files in the order given.

Module name is a module written in Go (package native) if one is registered under that name; else the file name.kkl, looked up first in the directory of the file that uses it, then in the directories of path (KUKEL_PATH); in each directory, name.kkc (compiled on its own) if there is no name.kkl. A name stands for one file in the whole program; modules may not use each other in a cycle.

func LoadWith

func LoadWith(files []string, config *native.Config) ([]*ast.File, error)

LoadWith is Load for a program limited by config: the modules written in Go it may use, and where (and whether) it finds modules written in Kukel.

func Resolve

func Resolve(prog []*ast.File, config *native.Config, nextToFiles bool) ([]*ast.File, error)

Resolve loads the modules that already parsed program files use. With nextToFiles false, a module is looked for only in config.Path, not next to the file that uses it (for source that is not from a file).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL