interpreter

package
v0.0.0-...-09ec4ce Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

GoSpeccy's scripting language based on "github.com/sbinet/go-eval"

Index

Constants

View Source
const (
	SCRIPT_DIRECTORY = "scripts"
	STARTUP_SCRIPT   = "startup"
)
View Source
const (
	NONE           ast_state_t = iota
	DEFINE_VAR_LHS             // The left-hand-side of an assignment which defines a new variable
)
View Source
const (
	SINGLE_LINE print_style_t = iota
	MULTI_LINE
)

Variables

View Source
var (
	IgnoreStartupScript = false
)

These variables are set only once, before starting new goroutines, so there is no need for controlling concurrent access via a sync.Mutex

Functions

func DefineFunction

func DefineFunction(f Function)

func Init

func Init(_app *spectrum.Application, _cmdLineArg string, _speccy *spectrum.Spectrum48k)

Types

type Function

type Function struct {
	Name       string         // Name of the variable used to access the function
	Type       *eval.FuncType // Function type
	Value      eval.FuncValue // The function itself
	Help_key   string         // Help
	Help_value string
}

type Interpreter

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

func GetInterpreter

func GetInterpreter() *Interpreter

func (*Interpreter) Run

func (i *Interpreter) Run(sourceCode string) error

func (*Interpreter) SetStdout

func (i *Interpreter) SetStdout(newStdout io.Writer) io.Writer

Returns the previous stdout

type WOS

type WOS struct {
	URL         string
	MachineType string
	Publication string
	Score       string
}

Jump to

Keyboard shortcuts

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