parser

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 4 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 ParseBlock added in v0.18.2

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

func ParseBlockWithParsers added in v0.18.2

func ParseBlockWithParsers(tokens []*tokenizer.Token, blockParsers []BlockParser) ([]ast.Node, error)

func ParseInline added in v0.18.1

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

func ParseInlineWithParsers added in v0.18.2

func ParseInlineWithParsers(tokens []*tokenizer.Token, inlineParsers []InlineParser) ([]ast.Node, error)

Types

type AutoLinkParser added in v0.18.2

type AutoLinkParser struct{}

func NewAutoLinkParser added in v0.18.2

func NewAutoLinkParser() *AutoLinkParser

func (*AutoLinkParser) Match added in v0.18.2

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

func (*AutoLinkParser) Parse added in v0.18.2

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

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 EscapingCharacterParser added in v0.18.2

type EscapingCharacterParser struct{}

func NewEscapingCharacterParser added in v0.18.2

func NewEscapingCharacterParser() *EscapingCharacterParser

func (*EscapingCharacterParser) Match added in v0.18.2

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

func (*EscapingCharacterParser) Parse added in v0.18.2

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

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 HighlightParser added in v0.18.2

type HighlightParser struct{}

func (*HighlightParser) Match added in v0.18.2

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

func (*HighlightParser) Parse added in v0.18.2

func (p *HighlightParser) 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

func NewHighlightParser added in v0.18.2

func NewHighlightParser() 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 MathBlockParser added in v0.18.2

type MathBlockParser struct{}

func NewMathBlockParser added in v0.18.2

func NewMathBlockParser() *MathBlockParser

func (*MathBlockParser) Match added in v0.18.2

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

func (*MathBlockParser) Parse added in v0.18.2

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

type MathParser added in v0.18.2

type MathParser struct{}

func NewMathParser added in v0.18.2

func NewMathParser() *MathParser

func (*MathParser) Match added in v0.18.2

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

func (*MathParser) Parse added in v0.18.2

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

type OrderedListParser added in v0.18.2

type OrderedListParser struct{}

func NewOrderedListParser added in v0.18.2

func NewOrderedListParser() *OrderedListParser

func (*OrderedListParser) Match added in v0.18.2

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

func (*OrderedListParser) Parse added in v0.18.2

func (p *OrderedListParser) 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 TableParser added in v0.18.2

type TableParser struct{}

func NewTableParser added in v0.18.2

func NewTableParser() *TableParser

func (*TableParser) Match added in v0.18.2

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

func (*TableParser) Parse added in v0.18.2

func (p *TableParser) 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 TaskListParser added in v0.18.2

type TaskListParser struct{}

func NewTaskListParser added in v0.18.2

func NewTaskListParser() *TaskListParser

func (*TaskListParser) Match added in v0.18.2

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

func (*TaskListParser) Parse added in v0.18.2

func (p *TaskListParser) 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)

type UnorderedListParser added in v0.18.2

type UnorderedListParser struct{}

func NewUnorderedListParser added in v0.18.2

func NewUnorderedListParser() *UnorderedListParser

func (*UnorderedListParser) Match added in v0.18.2

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

func (*UnorderedListParser) Parse added in v0.18.2

func (p *UnorderedListParser) 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