scanner

package
v0.0.0-...-d8b213e Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TSTRING = iota + 1
	TNUMBER
	TTRUE
	TFALSE
	TNULL
	TLBRACE
	TRBRACE
	TLBRACKET
	TRBRACKET
	TCOLON
	TCOMMA
)

Variables

This section is empty.

Functions

func TokenName

func TokenName(tok int) string

TokenName returns a human readable version of the token.

Types

type Scanner

type Scanner interface {
	Pos() int
	Scan() (int, []byte, error)
	Expect(token int) ([]byte, error)
	Unscan(tok int, b []byte)
	ReadString(target *string) error
	ReadInt(target *int) error
	ReadInt64(target *int64) error
	ReadUint(target *uint) error
	ReadUint64(target *uint64) error
	ReadFloat32(target *float32) error
	ReadFloat64(target *float64) error
	ReadBool(target *bool) error
	ReadMap(target *map[string]interface{}) error
	ReadArray(target *[]interface{}) error
}

Scanner is a tokenizer for JSON input from an io.Reader.

func NewScanner

func NewScanner(r io.Reader) Scanner

NewScanner initializes a new scanner with a given reader.

Jump to

Keyboard shortcuts

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