compiler

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package compiler owns the public compilation pipeline.

Index

Constants

View Source
const MainFunction = "main"

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Filename      string
	Mode          string
	AST           *ast.Program
	IR            *ir.Program
	Output        []byte
	CompilerOwned bool
	Official      bool
}

func Compile

func Compile(filename string, source []byte, mode string) (*Artifact, error)

func CompileProject

func CompileProject(sources []SourceUnit, options Options) ([]*Artifact, error)

CompileProject parses every unit before resolving or checking any body. This establishes a stable project catalog, import graph, and exported signature environment shared by all files.

func CompileWithOptions

func CompileWithOptions(filename string, source []byte, options Options) (*Artifact, error)

type CompileError

type CompileError struct {
	Filename    string
	Diagnostics []diagnostic.Diagnostic
}

func (*CompileError) Error

func (e *CompileError) Error() string

type Options

type Options struct {
	Mode               string
	Package            string
	ModulePath         string
	GoModule           string
	RubyLoader         string
	TypeScriptRuntime  string
	SourceRoot         string
	ProjectRoot        string
	PackageOptions     map[string][]byte
	AllowUnusedImports bool
	InteractiveModule  string
}

type SourceUnit

type SourceUnit struct {
	Filename      string
	Source        []byte
	ModulePath    string
	Package       string
	CompilerOwned bool
	Official      bool
}

Jump to

Keyboard shortcuts

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