compiler

package
v0.23.11 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package compiler translates the ast structures that represent the parsed course code into instructions that can be executed by the VM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile added in v0.19.0

func Compile(rootPath, pkgPath string, includeTests bool, anonFunctionName int) (*vm.File, []error)

Compile will return the compiled file. If there are any dependent packages they will also be compiled.

func CompileFunc

func CompileFunc(
	fn *ast.Func,
	file *vm.File,
	parentFunc *vm.CompiledFunc,
	constants map[string]*ast.Literal,
) (*vm.CompiledFunc, error)

CompileFunc translates a single function into a set of instructions. The number of instructions returned may be zero.

func CompileTest

func CompileTest(
	fn *ast.Test,
	file *vm.File,
	constants map[string]*ast.Literal,
) (*vm.CompiledTest, error)

CompileTest will compile a test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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