util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntValue

func IntValue(lit []byte) (int64, error)

IntValue will attempt to parse a byte-slice as a signed base-10 64-bit integer.

func LitToRune

func LitToRune(lit []byte) rune

LitToRun will attempt to convert the literal value of a scanned token to a rune.

func RuneToString

func RuneToString(r rune) string

func UintValue

func UintValue(lit []byte) (uint64, error)

UintValue will attempt to parse a byte-slice as an unsigned base-10 64-bit integer.

Types

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack(capacity int) *Stack

NewStack will return a new, initialized stack.

func (*Stack) Len

func (this *Stack) Len() int

Len returns the number of items on the stack, or 0 if it is empty.

func (*Stack) Peek

func (this *Stack) Peek(index int) interface{}

Peek will return the item at `index` in the stack, where 0 is the bottom. Returns nil if the index exceeds the length of the stack.

func (*Stack) Pop

func (this *Stack) Pop() (item interface{})

Pop removes and returns the item at the top of the stack or nil.

func (*Stack) Push

func (this *Stack) Push(items ...interface{}) *Stack

Push places an item at the top of the stack or panics if item is nil.

func (*Stack) Top

func (this *Stack) Top() interface{}

Top returns the item at the top of the stack without altering the stack.

Directories

Path Synopsis
gen
Package md extracts code sections of markdown files
Package md extracts code sections of markdown files

Jump to

Keyboard shortcuts

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