scope

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opts

type Opts struct {
	Name   string
	Parent *Scope
}

type Scope

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

Scope stores our functions, variables, constants, etc.

func New

func New(opts Opts) *Scope

New creates and returns a new, empty scope

func (*Scope) AddBuiltin

func (s *Scope) AddBuiltin(b *object.Builtin) error

func (*Scope) AddBuiltins

func (s *Scope) AddBuiltins(funcs []*object.Builtin) error

func (*Scope) Clear added in v0.0.13

func (s *Scope) Clear()

func (*Scope) Contents

func (s *Scope) Contents() map[string]object.Object

func (*Scope) Declare

func (s *Scope) Declare(name string, obj object.Object, readOnly bool) error

func (*Scope) Get

func (s *Scope) Get(name string) (object.Object, bool)

func (*Scope) IsReadOnly

func (s *Scope) IsReadOnly(name string) bool

func (*Scope) Keys added in v0.0.13

func (s *Scope) Keys() []string

func (*Scope) Name

func (s *Scope) Name() string

func (*Scope) NewChild

func (s *Scope) NewChild(opts Opts) *Scope

func (*Scope) Update

func (s *Scope) Update(name string, obj object.Object) error

Jump to

Keyboard shortcuts

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