tokenizer

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: MPL-2.0 Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader interface type is the interface for reading string with every token Reader is like bufio.Reader but has PeekRune which returns a rune without advancing pointer

func NewReader

func NewReader(r io.Reader) *Reader

NewReader creates interal reader from io.RuneReader

func (*Reader) Next

func (r *Reader) Next() (string, error)

ReadToken returns error or string as token

func (*Reader) PeekRune

func (r *Reader) PeekRune() (rune, int, error)

PeekRune returns a rune without advancing pointer

func (*Reader) Read

func (r *Reader) Read(b []byte) (int, error)

func (*Reader) ReadRune

func (r *Reader) ReadRune() (rune, int, error)

ReadRune returns a rune with advancing pointer

Jump to

Keyboard shortcuts

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