scope

package
v0.0.0-...-4763a2a Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Namespace

type Namespace struct {
	Name  string `json:"name"`
	Scope Scope  `json:"scope"`
}

type Scope

type Scope struct {
	Immutable bool                            `json:"immutable"`
	Foreign   bool                            `json:"foreign"`
	Frame     []Value                         `json:"frame"`
	Blocks    []ast.BlockDeclarationStatement `json:"blocks"`
}

func (*Scope) AddVariable

func (scope *Scope) AddVariable(value Value)

func (*Scope) DeleteVariable

func (scope *Scope) DeleteVariable(index int)

type ScopeBlock

type ScopeBlock struct {
	Block      *ast.BlockDeclarationStatement `json:"block"`
	Foreign    bool                           `json:"foreign"`
	Immutable  bool                           `json:"immutable"`
	OuterScope bool                           `json:"outer_scope"`
}

type ScopeValue

type ScopeValue struct {
	Value      *Value `json:"value"`
	Foreign    bool   `json:"foreign"`
	Immutable  bool   `json:"immutable"`
	OuterScope bool   `json:"outer_scope"`
}

type Scopestack

type Scopestack struct {
	Scopes     []Scope     `json:"scopes"`
	Namespaces []Namespace `json:"namespaces"`
}

func (*Scopestack) AddBlock

func (scopestack *Scopestack) AddBlock(block ast.BlockDeclarationStatement)

func (*Scopestack) AddNativeBlock

func (scopestack *Scopestack) AddNativeBlock(block ast.BlockDeclarationStatement)

func (*Scopestack) AddVariable

func (scopestack *Scopestack) AddVariable(value Value)

func (*Scopestack) BlockExists

func (scopestack *Scopestack) BlockExists(key string) bool

func (*Scopestack) FindBlock

func (scopestack *Scopestack) FindBlock(key string) ScopeBlock

func (*Scopestack) FindInNamespace

func (scopestack *Scopestack) FindInNamespace(name string, index string) *Value

func (*Scopestack) FindVariable

func (scopestack *Scopestack) FindVariable(key string) ScopeValue

func (*Scopestack) GetCurrentScope

func (scopestack *Scopestack) GetCurrentScope() *Scope

func (*Scopestack) IsVariableUpdatable

func (scopestack *Scopestack) IsVariableUpdatable(key string) UpdateReport

func (*Scopestack) NamespaceExists

func (scopestack *Scopestack) NamespaceExists(name string) bool

func (*Scopestack) PopScope

func (scopestack *Scopestack) PopScope() *Scope

func (*Scopestack) PushNamespace

func (scopestack *Scopestack) PushNamespace(name string, scope Scope)

func (*Scopestack) PushScope

func (scopestack *Scopestack) PushScope(scope Scope)

func (*Scopestack) Reverse

func (scopestack *Scopestack) Reverse() []Scope

func (*Scopestack) ShiftScope

func (scopestack *Scopestack) ShiftScope(scope Scope)

func (*Scopestack) SwapAtIndex

func (scopestack *Scopestack) SwapAtIndex(index int, scope Scope)

func (*Scopestack) UnshiftScope

func (scopestack *Scopestack) UnshiftScope()

func (*Scopestack) UpdateVariable

func (scopestack *Scopestack) UpdateVariable(key string, value ast.IntPrimitiveExpression)

func (*Scopestack) VariableExists

func (scopestack *Scopestack) VariableExists(key string) bool

type UpdateReport

type UpdateReport int

type Value

type Value struct {
	Key   ast.Identifier             `json:"key"`
	Value ast.IntPrimitiveExpression `json:"value"`
	Kind  string                     `json:"kind"`
}

Jump to

Keyboard shortcuts

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