token

package
v3.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package token holds the tokens generated my the minidown scanner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bullet

type Bullet struct {
	*cst.Leaf
}

Bullet represets a '*' non-adjacent to text.

func (Bullet) CST

func (t Bullet) CST() cst.Node

CST returns the cst.Node of this token.

type CloseBracket

type CloseBracket struct {
	*cst.Leaf
}

CloseBracket represents a ')', ']' or '}'.

func (CloseBracket) CST

func (t CloseBracket) CST() cst.Node

CST returns the cst.Node of this token.

func (CloseBracket) Is

func (t CloseBracket) Is(r rune) bool

Is returns true if the bracket is of the type r.

type Emphasis

type Emphasis struct {
	*cst.Leaf
}

Emphasis represets a '*', '_', '**' or '__' adjacent text.

func (Emphasis) CST

func (t Emphasis) CST() cst.Node

CST returns the cst.Node of this token.

type Heading

type Heading struct {
	*cst.Leaf
}

Heading represents a run of '#'

func (Heading) CST

func (t Heading) CST() cst.Node

CST returns the cst.Node of this token.

type NewLine

type NewLine struct {
	*cst.Leaf
}

NewLine represents a newline.

func (NewLine) CST

func (t NewLine) CST() cst.Node

CST returns the cst.Node of this token.

type OpenBracket

type OpenBracket struct {
	*cst.Leaf
}

OpenBracket represents a '(', '[' or '{'.

func (OpenBracket) CST

func (t OpenBracket) CST() cst.Node

CST returns the cst.Node of this token.

func (OpenBracket) Is

func (t OpenBracket) Is(r rune) bool

Is returns true if the bracket is of the type r.

type Tag

type Tag struct {
	*cst.Leaf
	Typed bool
}

Tag represents a alpha-numeric wrapped with double curly brackets. For example '{{person}}'.

func (Tag) CST

func (t Tag) CST() cst.Node

CST returns the cst.Node of this token.

type Text

type Text struct {
	*cst.Leaf
	Override string // If non-empty then the this should be used instead of the CST string.
}

Text represents regular text.

func (Text) CST

func (t Text) CST() cst.Node

CST returns the cst.Node of this token.

func (Text) String

func (t Text) String() string

type Token

type Token interface {
	CST() cst.Node
}

Token is the interface implemented by all tokens.

Jump to

Keyboard shortcuts

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