tracker

package
v2.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyTracker

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

KeyTracker is a tracker that keeps track of the current Key as the AST is walked.

func (*KeyTracker) Key

func (t *KeyTracker) Key() []string

Key returns the current key

func (*KeyTracker) Pop

func (t *KeyTracker) Pop(node ast.Node)

Pop key from stack.

func (*KeyTracker) Push

func (t *KeyTracker) Push(node ast.Node)

Push the given key on the stack.

func (*KeyTracker) UpdateArrayTable

func (t *KeyTracker) UpdateArrayTable(node ast.Node)

UpdateArrayTable sets the state of the tracker with the AST array table node.

func (*KeyTracker) UpdateTable

func (t *KeyTracker) UpdateTable(node ast.Node)

UpdateTable sets the state of the tracker with the AST table node.

type SeenTracker

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

SeenTracker tracks which keys have been seen with which TOML type to flag duplicates and mismatches according to the spec.

func (*SeenTracker) CheckExpression

func (s *SeenTracker) CheckExpression(node ast.Node) error

CheckExpression takes a top-level node and checks that it does not contain keys that have been seen in previous calls, and validates that types are consistent.

Jump to

Keyboard shortcuts

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