scanner

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const EOF byte = 0xFF

0xFF is a byte that should not appear in a UTF-8 encoded stream of bytes.

Variables

This section is empty.

Functions

func IsAlnum

func IsAlnum[T byte | rune](b T) bool

func IsAlpha

func IsAlpha[T byte | rune](b T) bool

func IsCtrl

func IsCtrl[T byte | rune](b T) bool

func IsDigit

func IsDigit[T byte | rune](b T) bool

Types

type Pipe

type Pipe[T any] struct {
	// contains filtered or unexported fields
}

func (*Pipe[T]) Write

func (p *Pipe[T]) Write(data []T)

type Pos

type Pos struct {
	Line int
	Col  int
}

type Scanner

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

func NewScanner

func NewScanner(reader io.Reader) *Scanner

func NewScannerSize

func NewScannerSize(reader io.Reader, size int) *Scanner

func (*Scanner) Back

func (s *Scanner) Back()

func (*Scanner) CurrentPos

func (s *Scanner) CurrentPos() Pos

func (*Scanner) EndToken

func (s *Scanner) EndToken() []byte

func (*Scanner) Peek

func (s *Scanner) Peek() (byte, error)

func (*Scanner) Read

func (s *Scanner) Read() (byte, error)

func (*Scanner) SkipSpaceAndPeek

func (s *Scanner) SkipSpaceAndPeek() (byte, error)

func (*Scanner) SkipSpaceAndRead

func (s *Scanner) SkipSpaceAndRead() (byte, error)

func (*Scanner) StartToken

func (s *Scanner) StartToken() Pos

Jump to

Keyboard shortcuts

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