symboltable

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Table       map[string]Entry
	SymbolsSize uint32
}

Builder is a string interner. It eventually turns into a list of offsets and a contiguous bytes buffer.

func NewBuilder

func NewBuilder() *Builder

func (*Builder) AddEntry

func (s *Builder) AddEntry(item string) uint32

AddEntry interns item into the table and returns its index.

func (*Builder) Len

func (s *Builder) Len() int32

Len returns the number of distinct interned symbols.

func (*Builder) Reset

func (s *Builder) Reset()

type Entry

type Entry struct {
	// Index is the sequential index assigned to the symbol.
	Index uint32
	// Start is the start byte offset in the contiguous symbols buffer.
	Start uint32
}

Entry is the metadata Builder stores for each interned string.

Jump to

Keyboard shortcuts

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