parse

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: GPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayNode

type ArrayNode struct {
	NodeType
	Children []Node
}

type Node

type Node interface {
	Type() NodeType
}

func ParseFromString

func ParseFromString(j string) (Node, error)

type NodeType

type NodeType int
const (
	NodeTypeArray NodeType = iota
	NodeTypeObject
	NodeTypeString
	NodeTypeBool
	NodeTypeNil
	NodeTypeFloat
	NodeTypeInteger
)

func (NodeType) Type

func (t NodeType) Type() NodeType

type ObjectNode

type ObjectNode struct {
	NodeType
	// The JSON spec allows different types of values for the same key. Because of that, a simple `map[string]Node` is not enough.
	Children map[string][]Node
}

type Parser

type Parser struct {
	Lexer    *lex.Lexer
	Item     *lex.Item
	LastItem *lex.Item
}

type PrimitiveNode

type PrimitiveNode struct {
	NodeType
}

Jump to

Keyboard shortcuts

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