Documentation
¶
Index ¶
- func NewCurrentScope(isFunc bool, isLoop bool)
- func NewGlobalScope()
- type Scope
- func (s *Scope) Depth() int
- func (s *Scope) Functions() map[string]*object.RuntimeFunc
- func (s *Scope) Get(n string, stopOnFunc bool) object.Object
- func (s *Scope) GetFunction(name string) object.Object
- func (s *Scope) IsBreak() bool
- func (s *Scope) IsContinue() bool
- func (s *Scope) IsFunc() bool
- func (s *Scope) IsGlobal() bool
- func (s *Scope) IsInFunc() bool
- func (s *Scope) IsInLoop() bool
- func (s *Scope) Parent() *Scope
- func (s *Scope) Put(n string, o object.Object)
- func (s *Scope) SetLoopBreak()
- func (s *Scope) SetLoopContinue()
- func (s *Scope) UnsetLoopBreak()
- func (s *Scope) UnsetLoopContinue()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCurrentScope ¶ added in v1.0.1
NewBaseScope create current scope on top of another
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, functions map[string]*object.RuntimeFunc, ) *Scope
NewScope creates new scope
func (*Scope) Functions ¶ added in v1.0.1
func (s *Scope) Functions() map[string]*object.RuntimeFunc
Functions returns map with functions registered in current scope
func (*Scope) Get ¶
Get returns value of variable from storage (with search inside of parent scope and checking is scope function)
func (*Scope) GetFunction ¶ added in v1.0.1
GetFunction returns runtime function by name (search in parent scopes)
func (*Scope) IsContinue ¶
IsContinue returns true if continue necessary
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
Click to show internal directories.
Click to hide internal directories.