scanner

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferScanner

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

Wrap Scanner with a buffer

func NewBufferScanner

func NewBufferScanner(s *Scanner) *BufferScanner

func (*BufferScanner) Peek

func (bs *BufferScanner) Peek() TokenText

Peek() return next token but it's still there return scan result and set cached is true

func (*BufferScanner) Scan

func (bs *BufferScanner) Scan() TokenText

Scan() return next token and it's gone if cached is true -> return buffer and set cached is false if cached is false -> return scanner result and stores it in buffer

type Scanner

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

func NewScanner

func NewScanner(r io.Reader) *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan() (result TokenText)

type TokenText

type TokenText struct {
	Token token.Token
	Text  string
}

func (TokenText) String

func (tokText TokenText) String() string

Jump to

Keyboard shortcuts

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