ds

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Index    int
	IsStatic bool
}

type Scope

type Scope struct {
	TrackSlots bool // when true, Declare records SlotInfo in slots
	// contains filtered or unexported fields
}

func (*Scope) Bind

func (sc *Scope) Bind(name string, index int, isStatic bool)

Bind makes a slot returned by Reserve visible as name in the current block-scope

func (*Scope) Capacity

func (sc *Scope) Capacity() int

func (*Scope) CloseBlock

func (sc *Scope) CloseBlock()

func (*Scope) CloseTo

func (sc *Scope) CloseTo(depth int)

CloseTo closes blocks until depth are open, as after compiling a statement failed halfway

func (*Scope) Declare

func (sc *Scope) Declare(name string, isStatic bool) (index int, success bool)

Declare adds a new binding to the current block-scope

func (*Scope) Depth

func (sc *Scope) Depth() int

Depth is how many blocks are open

func (*Scope) Names

func (sc *Scope) Names() []string

Names lists every binding visible in the scope

func (*Scope) OpenBlock

func (sc *Scope) OpenBlock()

func (*Scope) Reach

func (sc *Scope) Reach(name string) (binding Binding, success bool)

Reach searches for a binding in this scope

func (*Scope) Reserve

func (sc *Scope) Reserve(name string, isStatic bool) (index int, success bool)

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

func (*Scope) Slots

func (sc *Scope) Slots() []SlotInfo

Slots returns the recorded slot metadata when TrackSlots was enabled.

func (Scope) String

func (sc Scope) String() string

type Set

type Set[T comparable] map[T]struct{}

func (Set[T]) Add

func (s Set[T]) Add(item T)

func (Set[T]) Has

func (s Set[T]) Has(item T) bool

func (Set[T]) Len

func (s Set[T]) Len() int

func (Set[T]) Remove

func (s Set[T]) Remove(item T)

type Slice

type Slice[T any] []T

Slice is a small stack helper used by the compiler.

func (*Slice[T]) Last

func (s *Slice[T]) Last(i int) T

func (*Slice[T]) Len

func (s *Slice[T]) Len() int

func (*Slice[T]) Pop

func (s *Slice[T]) Pop() T

func (*Slice[T]) Push

func (s *Slice[T]) Push(item T)

type SlotInfo

type SlotInfo struct {
	Name     string
	IsStatic bool
}

SlotInfo records the name and mutability of a local stack slot when slot tracking is enabled for compiler inspection.

Jump to

Keyboard shortcuts

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