input

package
v0.0.0-...-c04ea6e Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File encapsulates all operations related to file IO

func (*File) CurLoc

func (file *File) CurLoc() locator.Locator

func (*File) Init

func (file *File) Init(dirname, filename string)

Init initializes File by reading and storing the contents in the file to src

func (*File) IsEOF

func (file *File) IsEOF() bool

IsEOF returns true if nothing can be read further

func (*File) NextRune

func (file *File) NextRune() rune

NextRune returns the next rune. The user needs to check IsEOF before calling this function.

func (*File) Peek

func (file *File) Peek() rune

Peek returns the next rune without modifying any field (does not considered as a read)

type Input

type Input interface {
	NextRune() rune
	Peek() rune
	IsEOF() bool
	CurLoc() locator.Locator
}

type StringInput

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

func (*StringInput) CurLoc

func (input *StringInput) CurLoc() locator.Locator

func (*StringInput) Init

func (input *StringInput) Init(src string)

func (*StringInput) IsEOF

func (input *StringInput) IsEOF() bool

func (*StringInput) NextRune

func (input *StringInput) NextRune() rune

func (*StringInput) Peek

func (input *StringInput) Peek() rune

Jump to

Keyboard shortcuts

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