parser

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse added in v0.18.1

func Parse(tokens []*tokenizer.Token) ([]ast.Node, error)

func ParseInline added in v0.18.1

func ParseInline(tokens []*tokenizer.Token) ([]ast.Node, error)

Types

type BaseParser added in v0.18.1

type BaseParser interface {
	Match(tokens []*tokenizer.Token) (int, bool)
	Parse(tokens []*tokenizer.Token) (ast.Node, error)
}

type BlockParser added in v0.18.1

type BlockParser interface {
	BaseParser
}

type BlockquoteParser added in v0.18.1

type BlockquoteParser struct{}

func NewBlockquoteParser added in v0.18.1

func NewBlockquoteParser() *BlockquoteParser

func (*BlockquoteParser) Match added in v0.18.1

func (*BlockquoteParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*BlockquoteParser) Parse added in v0.18.1

func (p *BlockquoteParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type BoldItalicParser added in v0.18.1

type BoldItalicParser struct{}

func (*BoldItalicParser) Match added in v0.18.1

func (*BoldItalicParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*BoldItalicParser) Parse added in v0.18.1

func (p *BoldItalicParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type BoldParser added in v0.13.1

type BoldParser struct{}

func (*BoldParser) Match added in v0.13.1

func (*BoldParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*BoldParser) Parse added in v0.18.1

func (p *BoldParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type CodeBlockParser added in v0.13.1

type CodeBlockParser struct {
	Language string
	Content  string
}

func NewCodeBlockParser added in v0.13.1

func NewCodeBlockParser() *CodeBlockParser

func (*CodeBlockParser) Match added in v0.13.1

func (*CodeBlockParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*CodeBlockParser) Parse added in v0.18.1

func (p *CodeBlockParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type CodeParser added in v0.13.1

type CodeParser struct{}

func NewCodeParser added in v0.13.1

func NewCodeParser() *CodeParser

func (*CodeParser) Match added in v0.13.1

func (*CodeParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*CodeParser) Parse added in v0.18.1

func (p *CodeParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type Context added in v0.18.1

type Context struct {
	BlockParsers  []BlockParser
	InlineParsers []InlineParser
}

type HeadingParser added in v0.13.1

type HeadingParser struct{}

func NewHeadingParser added in v0.13.1

func NewHeadingParser() *HeadingParser

func (*HeadingParser) Match added in v0.13.1

func (*HeadingParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*HeadingParser) Parse added in v0.18.1

func (p *HeadingParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type HorizontalRuleParser added in v0.18.1

type HorizontalRuleParser struct{}

func NewHorizontalRuleParser added in v0.18.1

func NewHorizontalRuleParser() *HorizontalRuleParser

func (*HorizontalRuleParser) Match added in v0.18.1

func (*HorizontalRuleParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*HorizontalRuleParser) Parse added in v0.18.1

func (p *HorizontalRuleParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type ImageParser added in v0.13.1

type ImageParser struct{}

func NewImageParser added in v0.13.1

func NewImageParser() *ImageParser

func (*ImageParser) Match added in v0.13.1

func (*ImageParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*ImageParser) Parse added in v0.18.1

func (p *ImageParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type InlineParser added in v0.18.1

type InlineParser interface {
	BaseParser
}

func NewBoldItalicParser added in v0.18.1

func NewBoldItalicParser() InlineParser

func NewBoldParser added in v0.13.1

func NewBoldParser() InlineParser

type ItalicParser added in v0.13.1

type ItalicParser struct {
	ContentTokens []*tokenizer.Token
}

func NewItalicParser added in v0.13.1

func NewItalicParser() *ItalicParser

func (*ItalicParser) Match added in v0.13.1

func (*ItalicParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*ItalicParser) Parse added in v0.18.1

func (p *ItalicParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type LineBreakParser added in v0.18.1

type LineBreakParser struct{}

func NewLineBreakParser added in v0.18.1

func NewLineBreakParser() *LineBreakParser

func (*LineBreakParser) Match added in v0.18.1

func (*LineBreakParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*LineBreakParser) Parse added in v0.18.1

func (p *LineBreakParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type LinkParser added in v0.13.1

type LinkParser struct{}

func NewLinkParser added in v0.13.1

func NewLinkParser() *LinkParser

func (*LinkParser) Match added in v0.13.1

func (*LinkParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*LinkParser) Parse added in v0.18.1

func (p *LinkParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type ParagraphParser added in v0.13.1

type ParagraphParser struct {
	ContentTokens []*tokenizer.Token
}

func NewParagraphParser added in v0.13.1

func NewParagraphParser() *ParagraphParser

func (*ParagraphParser) Match added in v0.13.1

func (*ParagraphParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*ParagraphParser) Parse added in v0.18.1

func (p *ParagraphParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type StrikethroughParser added in v0.18.1

type StrikethroughParser struct{}

func NewStrikethroughParser added in v0.18.1

func NewStrikethroughParser() *StrikethroughParser

func (*StrikethroughParser) Match added in v0.18.1

func (*StrikethroughParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*StrikethroughParser) Parse added in v0.18.1

func (p *StrikethroughParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type TagParser added in v0.13.1

type TagParser struct{}

func NewTagParser added in v0.13.1

func NewTagParser() *TagParser

func (*TagParser) Match added in v0.13.1

func (*TagParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*TagParser) Parse added in v0.18.1

func (p *TagParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

type TextParser added in v0.18.1

type TextParser struct {
	Content string
}

func NewTextParser added in v0.18.1

func NewTextParser() *TextParser

func (*TextParser) Match added in v0.18.1

func (*TextParser) Match(tokens []*tokenizer.Token) (int, bool)

func (*TextParser) Parse added in v0.18.1

func (*TextParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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