common

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeError

func MakeError(err string, inner error) error

func Qstringify added in v0.4.2

func Qstringify(v any) string

func Stringify added in v0.4.2

func Stringify(v any) string

Types

type BuiltIn

type BuiltIn map[string]func(context *Context, args []NamedValue) (any, error)

type CliSystem added in v0.5.12

type CliSystem struct {
	Cwd string
	Out *bufio.Writer
	Err *bufio.Writer
}

func MakeSystemContext added in v0.5.12

func MakeSystemContext() CliSystem

func (CliSystem) Invoke added in v0.5.12

func (a CliSystem) Invoke(executable string, args []string, stdin string) (string, string, string, error)

func (CliSystem) OutputError added in v0.5.12

func (a CliSystem) OutputError(text string)

func (CliSystem) OutputText added in v0.5.12

func (a CliSystem) OutputText(text string)

func (CliSystem) ResolvePath added in v0.5.12

func (a CliSystem) ResolvePath(context *Context, filePath string) (string, error)

type Context

type Context struct {
	Locals    *s.Stack[*Locals]
	BuiltIn   BuiltIn
	System    System
	PathStack *s.Stack[string]
}

type KeyValue added in v0.4.2

type KeyValue[K any, V any] struct {
	Key   K
	Value V
}

type LikeError

type LikeError struct {
	ErrorText  string
	InnerError error
}

func (*LikeError) Error

func (a *LikeError) Error() string

type List added in v0.4.2

type List []any

type Locals added in v0.3.10

type Locals struct {
	Store  Store
	Input  string
	Output strings.Builder
	Errors strings.Builder
	Mixed  strings.Builder
}

func MakeLocals added in v0.3.10

func MakeLocals(store Store) *Locals

func (*Locals) Reset added in v0.5.13

func (a *Locals) Reset()

type NamedValue added in v0.4.2

type NamedValue KeyValue[string, any]

func (NamedValue) String added in v0.4.2

func (a NamedValue) String() string

type Store

type Store map[string]any

func CopyStore added in v0.3.11

func CopyStore(m map[string]interface{}) Store

type System

type System interface {
	OutputText(text string)
	OutputError(text string)
	ResolvePath(context *Context, filePath string) (string, error)
	Invoke(executable string, args []string, stdin string) (string, string, string, error)
}

Jump to

Keyboard shortcuts

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