yaml

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindNode

func FindNode(n ast.Node, path string) ast.Node

func Print

func Print(file *ast.File, path string, lineNumber bool) (string, []ast.Node)

func Suggestions

func Suggestions(f *ast.File) []string

Types

type Printer

type Printer struct {
	DefaultProps     RenderProperties
	HighlightedProps RenderProperties
	LineNumberFormat func(n int, all int) string
}

func (*Printer) Print

func (p *Printer) Print(file *ast.File, path string, lineNumber bool) (string, []ast.Node)

func (*Printer) RenderFunc

func (p *Printer) RenderFunc(t *token.Token, highlighted bool) RenderFunc

type QueryResult

type QueryResult struct {
	Nodes         []ast.Node
	TokensMap     map[token.Position]*token.Token
	ParentNodeMap map[token.Position]ast.Node
}

func QueryTokens

func QueryTokens(file *ast.File, path string) QueryResult

type RenderFunc

type RenderFunc func(string) string

func ColorRenderFunc

func ColorRenderFunc(color *color.Color) RenderFunc

func EmptyRenderFunc

func EmptyRenderFunc() RenderFunc

type RenderProperties

type RenderProperties struct {
	MapKey    RenderFunc
	Anchor    RenderFunc
	Alias     RenderFunc
	Bool      RenderFunc
	String    RenderFunc
	Number    RenderFunc
	Null      RenderFunc
	Indicator RenderFunc
}

func (RenderProperties) RenderFunc

func (p RenderProperties) RenderFunc(t *token.Token) RenderFunc

Jump to

Keyboard shortcuts

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