Documentation
¶
Index ¶
- Constants
- type Input
- type InputBytes
- func (i *InputBytes) CanCheckPrefix() bool
- func (i *InputBytes) Context(pos int) syntax.EmptyOp
- func (i *InputBytes) HasPrefix(p Prefixer) bool
- func (i *InputBytes) Index(p Prefixer, pos int) int
- func (i *InputBytes) Reset(str []byte)
- func (i *InputBytes) Rstep(pos int) (rune, int)
- func (i *InputBytes) Step(pos int) (rune, int)
- type InputReader
- type InputString
- func (i *InputString) CanCheckPrefix() bool
- func (i *InputString) Context(pos int) syntax.EmptyOp
- func (i *InputString) HasPrefix(p Prefixer) bool
- func (i *InputString) Index(p Prefixer, pos int) int
- func (i *InputString) Reset(str string)
- func (i *InputString) Rstep(pos int) (rune, int)
- func (i *InputString) Step(pos int) (rune, int)
- type Prefixer
- type Rinput
Constants ¶
View Source
const EndOfText rune = -1
View Source
const StartOfText rune = -2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input interface { // Step returns the rune starting at pos and its width. Unless // CanCheckPrefix is true, Step should always be called with // with the current position in the string, which is the sum // of the previous pos Step was called with, and the width // returned by that call. Step(pos int) (r rune, width int) // CanCheckInput reports whether we can look ahead without losing info. CanCheckPrefix() bool // HasPrefix reports whether the input has the prefix reported // by the Prefixer. HasPrefix(p Prefixer) bool // Index returns the index of the first occurence of the // prefix following pos, or -1 if it can't be found. Index(p Prefixer, pos int) int // Context returns the EmptyOp flags satisfied by the context at pos. Context(pos int) syntax.EmptyOp }
Input abstracts different representations of the input text. It provides one-character lookahead.
type InputBytes ¶
type InputBytes struct {
// contains filtered or unexported fields
}
InputBytes scans a byte slice.
func (*InputBytes) CanCheckPrefix ¶
func (i *InputBytes) CanCheckPrefix() bool
func (*InputBytes) HasPrefix ¶
func (i *InputBytes) HasPrefix(p Prefixer) bool
func (*InputBytes) Reset ¶
func (i *InputBytes) Reset(str []byte)
Reset resets the InputBytes with the given byte slice.
type InputReader ¶
type InputReader struct {
// contains filtered or unexported fields
}
InputReader scans a RuneReader.
func (*InputReader) CanCheckPrefix ¶
func (i *InputReader) CanCheckPrefix() bool
func (*InputReader) HasPrefix ¶
func (i *InputReader) HasPrefix(p Prefixer) bool
func (*InputReader) Reset ¶
func (i *InputReader) Reset(r io.RuneReader)
Reset resets the InputReader with the given RuneReader.
type InputString ¶
type InputString struct {
// contains filtered or unexported fields
}
InputString scans a string.
func (*InputString) CanCheckPrefix ¶
func (i *InputString) CanCheckPrefix() bool
func (*InputString) HasPrefix ¶
func (i *InputString) HasPrefix(p Prefixer) bool
func (*InputString) Reset ¶
func (i *InputString) Reset(str string)
Reset resets the InputString with the given string.
Click to show internal directories.
Click to hide internal directories.