printer

package
Version: v0.0.0-...-bb5e832 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 6 Imported by: 0

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
}

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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL