Documentation ¶
Index ¶
- Constants
- type Scanner
- func (s *Scanner) Advance() error
- func (s *Scanner) ConsumeRune(r rune) error
- func (s *Scanner) ConsumeUntil(pred func(r rune) bool) error
- func (s *Scanner) ConsumeWhile(pred func(r rune) bool) error
- func (s *Scanner) Current() rune
- func (s *Scanner) ParseError(err error) error
- func (s *Scanner) ParseString(str string) error
- func (s *Scanner) Position() model.FilePosition
- func (s *Scanner) ReadN(n int) (string, error)
- func (s *Scanner) ReadRune() (r rune, size int, err error)
- func (s *Scanner) ReadWhile(pred func(r rune) bool) (string, error)
Constants ¶
View Source
const EOF = rune(0)
EOF is a rune representing the end of a file
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct { // Path is the file path. Path string // contains filtered or unexported fields }
Scanner is a backtracking reader.
func (*Scanner) ConsumeRune ¶
ConsumeRune consumes the given rune
func (*Scanner) ConsumeUntil ¶
ConsumeUntil advances the parser until the predicate holds
func (*Scanner) ConsumeWhile ¶
ConsumeWhile advances the parser while the predicate holds
func (*Scanner) ParseError ¶ added in v0.0.6
ParseError creates a new parser error with the current position.
func (*Scanner) ParseString ¶
ParseString parses the given string
func (*Scanner) Position ¶
func (s *Scanner) Position() model.FilePosition
Position returns the current position.
Click to show internal directories.
Click to hide internal directories.