printer

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 6 Imported by: 47

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrintFunc

type PrintFunc func() *Property

PrintFunc returns property instance

type Printer

type Printer struct {
	LineNumber       bool
	LineNumberFormat func(num int) string
	MapKey           PrintFunc
	Anchor           PrintFunc
	Alias            PrintFunc
	Bool             PrintFunc
	String           PrintFunc
	Number           PrintFunc
	Comment          PrintFunc
}

Printer create text from token collection or ast

func (*Printer) PrintErrorMessage

func (p *Printer) PrintErrorMessage(msg string, isColored bool) string

func (*Printer) PrintErrorToken

func (p *Printer) PrintErrorToken(tk *token.Token, isColored bool) string

func (*Printer) PrintNode

func (p *Printer) PrintNode(node ast.Node) []byte

PrintNode create text from ast.Node

func (*Printer) PrintTokens

func (p *Printer) PrintTokens(tokens token.Tokens) string

PrintTokens create text from token collection

type Property

type Property struct {
	Prefix string
	Suffix string
}

Property additional property set for each the token

Jump to

Keyboard shortcuts

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