scope

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scope

type Scope struct {
	// contains filtered or unexported fields
}
var CurrentScope *Scope

current scope

var GlobalScope *Scope

global scope

func NewScope

func NewScope(
	parent *Scope,
	depth int,
	isFunc bool,
	isLoop bool,
	objects map[string]object.Object,
) *Scope

NewScope creates new scope

func (*Scope) Depth

func (s *Scope) Depth() int

Depth returns current depth of scopes

func (*Scope) Get

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

Get returns value of variable from storage (with search inside of parent scope)

func (*Scope) IsBreak

func (s *Scope) IsBreak() bool

IsBreak returns true if break necessary

func (*Scope) IsContinue

func (s *Scope) IsContinue() bool

IsContinue returns true if continue necessary

func (*Scope) IsFunc

func (s *Scope) IsFunc() bool

IsFunc returns true if scope is function

func (*Scope) IsGlobal

func (s *Scope) IsGlobal() bool

IsGLobal returns true if scope is global

func (*Scope) IsInFunc

func (s *Scope) IsInFunc() bool

IsInFunc returns true if scope inside of function

func (*Scope) IsInLoop

func (s *Scope) IsInLoop() bool

IsInLoop returns true if scope inside of loop

func (*Scope) Parent

func (s *Scope) Parent() *Scope

Parent returns parent scope

func (*Scope) Put

func (s *Scope) Put(n string, o object.Object)

Put saves variable in scope

func (*Scope) SetLoopBreak

func (s *Scope) SetLoopBreak()

SetLoopBreak sets flag for break necessity

func (*Scope) SetLoopContinue

func (s *Scope) SetLoopContinue()

SetLoopContinue sets flag for continue necessity

func (*Scope) UnsetLoopBreak

func (s *Scope) UnsetLoopBreak()

UnsetLoopBreak unsets flag for break necessity

func (*Scope) UnsetLoopContinue

func (s *Scope) UnsetLoopContinue()

UnsetLoopContinue unsets flag for continue necessity

Jump to

Keyboard shortcuts

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