parser

package
v0.0.0-...-08dbdac Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package parser contains all the code used to tokenize the input and parsing it. It is divided in the tokenizer.go, which tokenize the input from start to paragraphs, and parser.go which contains some usefull utils and hight level parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionsFromParagraphs

func OptionsFromParagraphs(paragraphs []token.ParagraphToken) (sMark.Options, []token.ParagraphToken)

OptionsFromParagraphs analyze the passed slice of paragraphs returning the final options contined in token.HeaderParagraphs. It return the optained options and a new list of paragraphs containing all the paragraphs but HeaderParagraphs

func ParseReader

func ParseReader(fl io.Reader) ([]token.ParagraphToken, error)

ParseReader parse a source file and returns the paragraphs

func TitleFromParagraph

func TitleFromParagraph(paragraph []token.ParagraphToken) string

TitleFromParagraph resolve a possible title from the passed paragraphs

func TokenToLine

func TokenToLine(tokens []token.Token) []token.LineToken

TokenToLine divide a slice of tokens in lines

func TokenToParagraph

func TokenToParagraph(lines []token.LineToken) []token.ParagraphToken

TokenToParagraph divide a slice of lines in paragraphs

func TokenToStructure

func TokenToStructure(tokens []token.Token) []token.Token

TokenToStructure checks the slice of tokens for multi-token tokens, like bold/italic text

func Tokenizer

func Tokenizer(reader io.Reader) ([]token.Token, error)

Tokenizer parse a io.Reader and return a slice of tokens or error

Types

This section is empty.

Jump to

Keyboard shortcuts

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