compiler

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenMPCompilerReleaseAPI = "https://api.github.com/repos/openmultiplayer/compiler/releases/latest"
)

Variables

View Source
var (
	ErrNoCompilerAsset       = errors.New("no compatible openmultiplayer compiler asset found")
	ErrMissingCompilerDigest = errors.New("compiler release asset has no SHA-256 digest")
)
View Source
var ErrPawnCCNotFound = errors.New("pawncc not found")

Functions

func Compile

func Compile(path string, opts Options) (string, error)

func CompileContext

func CompileContext(ctx context.Context, path string, opts Options) (string, error)

Types

type Compiler

type Compiler struct {
	Path    string
	LibDirs []string
}

Compiler configures pawncc and its library paths.

func Bare

func Bare(path string) *Compiler

Bare configures pawncc without inferred library paths.

func FindCachedCompiler

func FindCachedCompiler(cacheDir string) (*Compiler, bool)

func FromPath

func FromPath(path string) *Compiler

FromPath configures pawncc with adjacent and sibling library directories.

func InstallOpenMPCompiler

func InstallOpenMPCompiler(ctx context.Context, dir string) (*Compiler, error)

func (*Compiler) Command

func (c *Compiler) Command(args ...string) *exec.Cmd

Command creates a pawncc command.

func (*Compiler) CommandContext

func (c *Compiler) CommandContext(ctx context.Context, args ...string) *exec.Cmd

CommandContext creates a cancellable pawncc command.

type DiagnosticExpectation

type DiagnosticExpectation struct {
	Kind string
	Code string
}

func DiagnosticExpectations

func DiagnosticExpectations(path string) ([]DiagnosticExpectation, error)

type DiagnosticResult

type DiagnosticResult struct {
	Passed  bool
	Message string
}

func CheckDiagnostics

func CheckDiagnostics(path string, opts Options, expected []DiagnosticExpectation) (DiagnosticResult, error)

type Options

type Options struct {
	Compiler    *Compiler
	Includes    []string
	Defines     []string
	ExtraArgs   []string
	OutDir      string
	NoCache     bool
	Count       int
	Diagnostics io.Writer
}

Jump to

Keyboard shortcuts

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