Documentation
¶
Index ¶
- Constants
- func ReverseString(s string) string
- type Ast
- type Matcher
- func (m *Matcher) Any(valid string) bool
- func (m *Matcher) DoubleQuoteStr() bool
- func (m *Matcher) End() bool
- func (m *Matcher) Escape(escape rune) bool
- func (m *Matcher) Except(invalid string) bool
- func (m *Matcher) ExceptUnescapedSpaces(escape rune) bool
- func (m *Matcher) Float() bool
- func (m *Matcher) FloatValue() (float64, error)
- func (m *Matcher) FloatValueAdvance() (float64, error)
- func (m *Matcher) Fn(fn func(rune) bool) bool
- func (m *Matcher) FnLoop(fn func(rune) bool) bool
- func (m *Matcher) FnOrder(fns ...func() bool) bool
- func (m *Matcher) GoQuotes(escape rune, maxLen, maxLenSingleQuote int) bool
- func (m *Matcher) Id() bool
- func (m *Matcher) Int() bool
- func (m *Matcher) IntValue() (int, error)
- func (m *Matcher) IntValueAdvance() (int, error)
- func (m *Matcher) LineComment() bool
- func (m *Matcher) MultiLineComment() bool
- func (m *Matcher) NPos(n int) bool
- func (m *Matcher) NRunes(n int) bool
- func (m *Matcher) Quote(quote rune, escape rune, failOnNewline bool, maxLen int) bool
- func (m *Matcher) Quoted(validQuotes string, escape rune, failOnNewline bool, maxLen int) bool
- func (m *Matcher) Rune(ru rune) bool
- func (m *Matcher) Section(open, close string, escape rune, failOnNewline bool, maxLen int, eofClose bool) bool
- func (m *Matcher) Sequence(s string) bool
- func (m *Matcher) SingleQuoteStr() bool
- func (m *Matcher) Spaces() bool
- func (m *Matcher) SpacesAdvance() error
- func (m *Matcher) SpacesExceptNewline() bool
- func (m *Matcher) ToNewlineOrEnd()
- type Parse
- func (p *Parse) And(fns ...ParseFunc) ParseFunc
- func (p *Parse) DoubleQuotedString() (Ast, error)
- func (p *Parse) LoopUntil(fn ParseFunc) ParseFunc
- func (p *Parse) OptionalNoErr(def Ast, fn ParseFunc) ParseFunc
- func (p *Parse) OptionalWithErr(def Ast, fn ParseFunc) ParseFunc
- func (p *Parse) Or(fns ...ParseFunc) ParseFunc
- func (p *Parse) RewindOnNilValue(fn ParseFunc) ParseFunc
- func (p *Parse) Rune(ru rune) ParseFunc
- func (p *Parse) Sequence(s string) ParseFunc
- func (p *Parse) Spaces() (Ast, error)
- func (p *Parse) SpacesExceptNewline() (Ast, error)
- func (p *Parse) ValueAdv(fn func() bool) ParseFunc
- type ParseFunc
- type Scanner
- func (sc *Scanner) Advance()
- func (sc *Scanner) Empty() bool
- func (sc *Scanner) Errorf(f string, args ...interface{}) error
- func (sc *Scanner) PeekRune() rune
- func (sc *Scanner) ReadRune() rune
- func (sc *Scanner) RewindOnFalse(fn func() bool) bool
- func (sc *Scanner) SetStartPos(v int)
- func (sc *Scanner) Value() string
- func (sc *Scanner) ValueAdv() string
- func (sc *Scanner) ValueBytes() []byte
- func (sc *Scanner) ValueBytesAdv() []byte
Constants ¶
View Source
const Eof = -1
Variables ¶
This section is empty.
Functions ¶
func ReverseString ¶
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
func (*Matcher) DoubleQuoteStr ¶ added in v1.3.1
func (*Matcher) ExceptUnescapedSpaces ¶
func (*Matcher) FloatValue ¶
func (*Matcher) FloatValueAdvance ¶
func (*Matcher) IntValueAdvance ¶
func (*Matcher) LineComment ¶ added in v1.3.1
func (*Matcher) MultiLineComment ¶ added in v1.3.1
func (*Matcher) SingleQuoteStr ¶ added in v1.3.1
func (*Matcher) SpacesAdvance ¶
func (*Matcher) SpacesExceptNewline ¶
func (*Matcher) ToNewlineOrEnd ¶
func (m *Matcher) ToNewlineOrEnd()
type Parse ¶ added in v1.3.1
type Parse struct {
// contains filtered or unexported fields
}
func (*Parse) DoubleQuotedString ¶ added in v1.3.1
func (*Parse) OptionalNoErr ¶ added in v1.3.1
func (*Parse) OptionalWithErr ¶ added in v1.3.1
func (*Parse) RewindOnNilValue ¶ added in v1.3.1
func (*Parse) SpacesExceptNewline ¶ added in v1.3.1
type ParseFunc ¶ added in v1.3.1
returning (nil,nil) means not parsed returning (<somevalue>,nil) means parsed
type Scanner ¶
type Scanner struct {
Start int
Pos int
R iorw.ReaderAt
// utils to advance the scanner
Match Matcher
Parse Parse
Reverse bool // read direction
}
func NewScanner ¶
func NewScanner2 ¶ added in v1.3.1
func NewScanner3 ¶ added in v1.3.1
func (*Scanner) RewindOnFalse ¶
func (*Scanner) SetStartPos ¶
func (*Scanner) ValueBytes ¶ added in v1.3.1
func (*Scanner) ValueBytesAdv ¶ added in v1.3.1
Click to show internal directories.
Click to hide internal directories.