richtext_internal

package
v0.0.0-...-e7326f8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

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

func NewBlock

func NewBlock(bType BlockType) Block

func (Block) GetType

func (b Block) GetType() BlockType

type BlockCommand

type BlockCommand struct {
	Block
	Command     string
	InnerBlocks []IBlock
}

func NewBlockCommand

func NewBlockCommand(command string, innerBlocks []IBlock) BlockCommand

type BlockHexColor

type BlockHexColor struct {
	Block
	Color       color.Color
	InnerBlocks []IBlock
}

func NewBlockHexColor

func NewBlockHexColor(color color.Color, innerBlocks []IBlock) BlockHexColor

type BlockText

type BlockText struct {
	Block
	Text string
}

func NewBlockText

func NewBlockText(text string) BlockText

type BlockType

type BlockType uint8
const (
	BCommand BlockType = iota
	BText
	BHexColor
)

type CommandDirection

type CommandDirection uint8
const (
	CDOpen CommandDirection = iota
	CDClose
)

type IBlock

type IBlock interface {
	GetType() BlockType
}

type IToken

type IToken interface {
	GetType() TokenType
}

type RichTextLexer

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

func NewRichTextLexer

func NewRichTextLexer(text string) *RichTextLexer

func (*RichTextLexer) Lex

func (l *RichTextLexer) Lex() []IToken

type RichTextParser

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

func NewRichTextParser

func NewRichTextParser(tokens []IToken) *RichTextParser

func (*RichTextParser) Parse

func (p *RichTextParser) Parse() IBlock

type Token

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

func NewToken

func NewToken(tokType TokenType) Token

func (Token) GetType

func (t Token) GetType() TokenType

type TokenCommand

type TokenCommand struct {
	Token
	Command   string
	Direction CommandDirection
}

func NewTokenCommand

func NewTokenCommand(cmd string, dir CommandDirection) TokenCommand

type TokenHexColor

type TokenHexColor struct {
	Token
	Color     color.Color
	Direction CommandDirection
}

func NewTokenHexColor

func NewTokenHexColor(clr color.Color, dir CommandDirection) TokenHexColor

type TokenText

type TokenText struct {
	Token
	// contains filtered or unexported fields
}

func NewTokenText

func NewTokenText(text string) TokenText

func (TokenText) GetText

func (t TokenText) GetText() string

type TokenType

type TokenType uint8
const (
	TText TokenType = iota
	TCommand
	THexColor
)

Jump to

Keyboard shortcuts

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