Documentation
¶
Index ¶
- type Binding
- type Scope
- func (sc *Scope) Bind(name string, index int, isStatic bool)
- func (sc *Scope) Capacity() int
- func (sc *Scope) CloseBlock()
- func (sc *Scope) CloseTo(depth int)
- func (sc *Scope) Declare(name string, isStatic bool) (index int, success bool)
- func (sc *Scope) Depth() int
- func (sc *Scope) Names() []string
- func (sc *Scope) OpenBlock()
- func (sc *Scope) Reach(name string) (binding Binding, success bool)
- func (sc *Scope) Reserve(name string, isStatic bool) (index int, success bool)
- func (sc *Scope) Slots() []SlotInfo
- func (sc Scope) String() string
- type Set
- type Slice
- type SlotInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scope ¶
type Scope struct {
TrackSlots bool // when true, Declare records SlotInfo in slots
// contains filtered or unexported fields
}
func (*Scope) Bind ¶
Bind makes a slot returned by Reserve visible as name in the current block-scope
func (*Scope) CloseBlock ¶
func (sc *Scope) CloseBlock()
func (*Scope) CloseTo ¶
CloseTo closes blocks until depth are open, as after compiling a statement failed halfway
func (*Scope) Reserve ¶
Reserve allocates the slot for a declaration in the current block-scope without making name visible yet, so code compiled before Bind still sees any outer binding of the same name
type Set ¶
type Set[T comparable] map[T]struct{}