runtime

package
v0.0.0-...-b738e08 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheFile

type CacheFile struct {
	SourcePath string
	Ast        ast.Node
}

type FileCache

type FileCache struct {
	// contains filtered or unexported fields
}

func NewFileCache

func NewFileCache() *FileCache

func (*FileCache) Load

func (c *FileCache) Load(path string) (*SourceFile, error)

Load the file from the cache if it exists or from the disk if it doesn't. - Path should be the absolute path to the file

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

TODO: how make this concurrent safe?

func New

func New() *Runtime

func (*Runtime) GlobalScope

func (r *Runtime) GlobalScope() *o.Scope

func (*Runtime) LoadAst

func (r *Runtime) LoadAst(code []byte) (ast.Node, error)

func (*Runtime) RunAst

func (r *Runtime) RunAst(node ast.Node) (o.Object, error)

func (*Runtime) RunCode

func (r *Runtime) RunCode(code []byte) (o.Object, error)

func (*Runtime) RunFile

func (r *Runtime) RunFile(path string) (o.Object, error)

type SourceFile

type SourceFile struct {
	// contains filtered or unexported fields
}

func (*SourceFile) CachePath

func (f *SourceFile) CachePath() string

func (*SourceFile) Hash

func (f *SourceFile) Hash() string

func (*SourceFile) LoadAst

func (f *SourceFile) LoadAst() (ast.Node, error)

func (*SourceFile) LoadSource

func (f *SourceFile) LoadSource() ([]byte, error)

func (*SourceFile) SourcePath

func (f *SourceFile) SourcePath() string

Jump to

Keyboard shortcuts

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