template

package
v0.0.0-...-20b307e Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HolderNeverClosed       = "holder at line %d (index = %d) definition never finished"
	InvalidHolderDefinition = "invalid holder definition at line %d (index = %d)"
	HolderNotFound          = "holder \"%s\" not found"
)
View Source
const (
	EOF = iota
	Raw
	Holder
	PlasmaCodeHolder
	GoCodeHolder
)
View Source
const (
	OpenParentheses  rune = '('
	CloseParentheses rune = ')'
	OpenBrace        rune = '{'
	CloseBrace       rune = '}'
	OpenSquare       rune = '['
	CloseSquare      rune = ']'
	WhiteSpace       rune = ' '
	NewLine          rune = '\n'
	Return           rune = '\r'
	Tab              rune = '\t'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

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

func NewLexer

func NewLexer(scanner *scanner.Scanner) *Lexer

func (*Lexer) HasNext

func (lexer *Lexer) HasNext() bool

func (*Lexer) Next

func (lexer *Lexer) Next() (*Token, error)

type Template

type Template struct {
	RawReplace map[string]string
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate(reader io.Reader, rawReplace map[string]string) *Template

func NewTemplateCustomVM

func NewTemplateCustomVM(reader io.Reader, rawReplace map[string]string, plasmaReplace map[string]string, vm *gplasma.VirtualMachine) *Template

func (*Template) Compile

func (template *Template) Compile() ([]byte, error)

type Token

type Token struct {
	DirectValue uint
	String      string
	Position    scanner.Position
	Length      int
}

Jump to

Keyboard shortcuts

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