tokenqueue

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token = jargon.Token

Token is an alias to jargon.Token for convenience

type TokenQueue

type TokenQueue struct {
	Tokens []*Token
}

TokenQueue is a FIFO queue

func New

func New(tokens ...*Token) *TokenQueue

New creates a new TokenQueue

func (*TokenQueue) Any

func (q *TokenQueue) Any() bool

Any returns whether there are any tokens in the queue

func (*TokenQueue) Clear

func (q *TokenQueue) Clear()

Clear drops all tokens from the queue

func (*TokenQueue) Drop

func (q *TokenQueue) Drop(n int)

Drop removes n elements from the front of the queue

func (*TokenQueue) FlushTo

func (q *TokenQueue) FlushTo(dst *TokenQueue)

FlushTo moves all tokens from one queue to another

func (*TokenQueue) Len

func (q *TokenQueue) Len() int

Len is len(q.Tokens)

func (*TokenQueue) Pop

func (q *TokenQueue) Pop() *Token

Pop returns the first token (front of) the queue, and removes it from the queue

func (*TokenQueue) PopTo

func (q *TokenQueue) PopTo(dst *TokenQueue)

PopTo moves a token from one queue to another

func (*TokenQueue) Push

func (q *TokenQueue) Push(tokens ...*Token)

Push appends a token to the end of the queue

func (*TokenQueue) String

func (q *TokenQueue) String() string

Jump to

Keyboard shortcuts

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