parser

package
v0.0.0-...-48b2ce1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package parser implements parsing of KeyValue values in text format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Parent   *Node
	Children []*Node
	Type     NodeType
	Key      string
	Value    string
}

Node is an AST node.

func (*Node) String

func (n *Node) String() string

type NodeType

type NodeType uint8

NodeType represents a Node's type.

const (
	Object NodeType = iota
	Field
)

Node types.

func (NodeType) String

func (t NodeType) String() string

type TextParser

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

TextParser is a parser for KeyValue in text format.

func NewTextParser

func NewTextParser(fname string, r io.Reader) *TextParser

NewTextParser creates a TextParser.

func (*TextParser) Parse

func (p *TextParser) Parse() (*Node, error)

Parse reads parses the text-encoded KeyValue values from the input stream, generating an AST tree.

Jump to

Keyboard shortcuts

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