scanutil

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReverseString

func ReverseString(s string) string

Types

type Matcher

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

func (*Matcher) Any

func (m *Matcher) Any(valid string) bool

func (*Matcher) End

func (m *Matcher) End() bool

func (*Matcher) Escape

func (m *Matcher) Escape(escape rune) bool

func (*Matcher) Except

func (m *Matcher) Except(invalid string) bool

func (*Matcher) ExceptUnescapedSpaces

func (m *Matcher) ExceptUnescapedSpaces(escape rune) bool

func (*Matcher) Float

func (m *Matcher) Float() bool

func (*Matcher) FloatValue

func (m *Matcher) FloatValue() (float64, error)

func (*Matcher) FloatValueAdvance

func (m *Matcher) FloatValueAdvance() (float64, error)

func (*Matcher) Fn

func (m *Matcher) Fn(fn func(rune) bool) bool

func (*Matcher) FnLoop

func (m *Matcher) FnLoop(fn func(rune) bool) bool

Returns true if at least one rune was read.

func (*Matcher) FnOrder

func (m *Matcher) FnOrder(fns ...func() bool) bool

Must all return true.

func (*Matcher) GoQuotes

func (m *Matcher) GoQuotes(escape rune, maxLen, maxLenSingleQuote int) bool

func (*Matcher) Id

func (m *Matcher) Id() bool

func (*Matcher) Int

func (m *Matcher) Int() bool

func (*Matcher) IntValue

func (m *Matcher) IntValue() (int, error)

func (*Matcher) IntValueAdvance

func (m *Matcher) IntValueAdvance() (int, error)

func (*Matcher) NPos

func (m *Matcher) NPos(n int) bool

func (*Matcher) NRunes

func (m *Matcher) NRunes(n int) bool

func (*Matcher) Quote

func (m *Matcher) Quote(quote rune, escape rune, breakOnNewline bool, maxLen int) bool

func (*Matcher) Quoted

func (m *Matcher) Quoted(validQuotes string, escape rune, breakOnNewline bool, maxLen int) bool

func (*Matcher) Rune

func (m *Matcher) Rune(ru rune) bool

func (*Matcher) Sequence

func (m *Matcher) Sequence(s string) bool

func (*Matcher) Spaces

func (m *Matcher) Spaces() bool

func (*Matcher) SpacesAdvance

func (m *Matcher) SpacesAdvance() error

func (*Matcher) SpacesExceptNewline

func (m *Matcher) SpacesExceptNewline() bool

func (*Matcher) ToNewlineOrEnd

func (m *Matcher) ToNewlineOrEnd()

type Scanner

type Scanner struct {
	Start int
	Pos   int
	R     iorw.ReaderAt
	Match Matcher

	Reverse bool // read direction
}

func NewScanner

func NewScanner(r iorw.ReaderAt) *Scanner

func (*Scanner) Advance

func (sc *Scanner) Advance()

func (*Scanner) Empty

func (sc *Scanner) Empty() bool

func (*Scanner) Errorf

func (sc *Scanner) Errorf(f string, args ...interface{}) error

func (*Scanner) PeekRune

func (sc *Scanner) PeekRune() rune

func (*Scanner) ReadRune

func (sc *Scanner) ReadRune() rune

func (*Scanner) RewindOnFalse

func (sc *Scanner) RewindOnFalse(fn func() bool) bool

func (*Scanner) SetStartPos

func (sc *Scanner) SetStartPos(v int)

func (*Scanner) Value

func (sc *Scanner) Value() string

Jump to

Keyboard shortcuts

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