encoding

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Slash scanner.Position
	Text  string
}

func (*Comment) Pos

func (c *Comment) Pos() scanner.Position

type CommentGroup

type CommentGroup struct {
	List []*Comment
}

func (*CommentGroup) Pos

func (g *CommentGroup) Pos() scanner.Position

func (*CommentGroup) Text

func (g *CommentGroup) Text() string

type LiteralNode

type LiteralNode struct {
	Nodebase

	Value string
	// contains filtered or unexported fields
}

func NewLiteralNode

func NewLiteralNode(pos scanner.Position, kind NodeKind) LiteralNode

func (LiteralNode) Kind

func (n LiteralNode) Kind() NodeKind

type Node

type Node interface {
	// Pos returns position of node
	Pos() scanner.Position
	// Kind returns kind of node
	Kind() NodeKind
}

type NodeKind

type NodeKind int

NodeKind represents kind of json

const (
	InvalidNode NodeKind = iota
	IdentNode            // abc,true,false
	IntNode              // 1
	FloatNode            // 1.2
	CharNode             // 'c'
	StringNode           // "xyz"
	ObjectNode           // {}
	ArrayNode            // []
)

func (NodeKind) String

func (kind NodeKind) String() string

type Nodebase

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

func NewNodebase

func NewNodebase(pos scanner.Position) Nodebase

func (Nodebase) Pos

func (n Nodebase) Pos() scanner.Position

type Parser

type Parser struct {
	Pos scanner.Position
	Tok rune
	Lit string

	Comments    []*CommentGroup
	LeadComment *CommentGroup
	LineComment *CommentGroup
	// contains filtered or unexported fields
}

func (Parser) Err

func (p Parser) Err() error

func (*Parser) Init

func (p *Parser) Init(s *scanner.Scanner)

func (*Parser) Next

func (p *Parser) Next() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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