parser

package
v0.0.0-...-ea2a2fb Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 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 ChromaFormatter

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

func NewChromaFormatter

func NewChromaFormatter(style *chroma.Style, lexer chroma.Lexer) *ChromaFormatter

func (*ChromaFormatter) Lex

func (c *ChromaFormatter) Lex(input string, _ *input.Token) ([]FormatterToken, error)

type Formatter

type Formatter interface {
	Lex(input string, selectedToken *input.Token) ([]FormatterToken, error)
}

type FormatterToken

type FormatterToken struct {
	Value string
	Style lipgloss.Style
}

type Lexer

type Lexer interface {
	Lex(input string) ([]input.Token, error)
}

type Parser

type Parser[G any] interface {
	Lexer() Lexer
	Parse(input string) (*G, error)
}

type ParticipleLexer

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

func NewParticipleLexer

func NewParticipleLexer(definition lexer.Definition) *ParticipleLexer

func (*ParticipleLexer) Lex

func (p *ParticipleLexer) Lex(inputStr string) ([]input.Token, error)

type ParticipleParser

type ParticipleParser[G any] struct {
	// contains filtered or unexported fields
}

func NewParticipleParser

func NewParticipleParser[G any](
	parser *participle.Parser[G],
	parseOptions ...participle.ParseOption,
) *ParticipleParser[G]

func (*ParticipleParser[G]) Lexer

func (p *ParticipleParser[G]) Lexer() Lexer

func (*ParticipleParser[G]) Parse

func (p *ParticipleParser[G]) Parse(input string) (*G, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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