stack

package
v0.0.0-...-9edf4cd Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack[T any] []T

Stack[T] is a stack of [Node]. Used for keeping parent/child relationship during HTML tokenization.

func New

func New[T any]() *Stack[T]

NewStack returns a new [Stack[T]].

func (*Stack[T]) Peek

func (self *Stack[T]) Peek() (out T)

Peek returns the last node added to the stack or nil if queue is empty.

func (*Stack[T]) Pop

func (self *Stack[T]) Pop() (out T)

Pop removes a node from the stack and returns it.

func (*Stack[T]) Push

func (self *Stack[T]) Push(item T)

Push pushes a node to the stack.

func (*Stack[T]) Size

func (self *Stack[T]) Size() int

Size returns number of strings on the stack.

Jump to

Keyboard shortcuts

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