parser

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiLineOutputHandling

type MultiLineOutputHandling int
const (
	// MultilineToOneLine squashes output into a single line with `\n` characters instead of newline
	MultilineToOneLine MultiLineOutputHandling = iota
	// MultilinePreserved preservers output with no modifications
	MultilinePreserved
	// MultilineWithIndent preserves multiline output, but adds indentation, so all lines are the same (used for yaml)
	MultilineWithIndent
)

type OptionFunc

type OptionFunc func(p *Parser)

func WithMaxFunctionCount

func WithMaxFunctionCount(c int) OptionFunc

func WithMultilineOutputHandling

func WithMultilineOutputHandling(handling MultiLineOutputHandling) OptionFunc

type Parser

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

func NewParser

func NewParser(in io.Reader, out io.Writer, options ...OptionFunc) *Parser

func (*Parser) GetCurrentLine

func (p *Parser) GetCurrentLine() int

GetCurrentLine returns amount of lines parsed at the time of the call. If no errors are returned from Parse function, it will be equal to the line count of processed file.

func (*Parser) GetFunctionCalls

func (p *Parser) GetFunctionCalls() int

GetFunctionCalls returns amount of functions called at the time of the call. If no errors are returned from Parse function, it will be equal to the total amount of functions+modifiers in processed file.

func (*Parser) Parse

func (p *Parser) Parse(ctx context.Context) error

Jump to

Keyboard shortcuts

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