templates

package
v0.2.7-beta.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: ISC Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BODY_SUBSTITUTION = "%[...]"
View Source
const INLINE_CALL_PREFIX = "#~>"
View Source
const SNIPPET_FILENAME = "snippet.mcfunction"

Variables

This section is empty.

Functions

func IsInlineCall

func IsInlineCall(line string) bool

Types

type Buffer

type Buffer struct {
	Lines []string

	Indent string
	// contains filtered or unexported fields
}

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Reader

func (buffer *Buffer) Reader() io.Reader

func (*Buffer) Scan

func (buffer *Buffer) Scan() bool

func (*Buffer) SetIndent

func (buffer *Buffer) SetIndent(indent int)

func (*Buffer) Text

func (buffer *Buffer) Text() string

func (*Buffer) Write

func (buffer *Buffer) Write(data []byte) (n int, err error)

func (*Buffer) Writeln

func (buffer *Buffer) Writeln(line string)

type BufferedScanner

type BufferedScanner struct {
	Inner      *bufio.Scanner
	IsBuffered bool
	LineNumber uint
}

func NewBufferedScanner

func NewBufferedScanner(scanner *bufio.Scanner) *BufferedScanner

func (*BufferedScanner) Scan

func (scanner *BufferedScanner) Scan() bool

func (*BufferedScanner) Text

func (scanner *BufferedScanner) Text() string

func (*BufferedScanner) Unscan

func (scanner *BufferedScanner) Unscan()

type Collector

type Collector struct {
	Root      string
	Patterns  []string
	Collector string
}

func NewCollector

func NewCollector(root string, manifest *drive.JsonFile) (*Collector, error)

type Custom

type Custom struct {
	Root    string
	Program string
}

func NewCustom

func NewCustom(root string, manifest *drive.JsonFile) (*Custom, error)

type Definition

type Definition struct {
	File *drive.JsonFile
	Env  code.Env
}

type Generator

type Generator struct {
	Root        string
	Iterators   map[string]code.Rows
	Definitions map[string]Definition
}

func NewGenerator

func NewGenerator(root string, manifest *drive.JsonFile) (*Generator, error)

type Inline

type Inline struct {
	RequiredArgs []string
	Call         func(out Writer, in Scanner, args []string) error
}

func NewInline

func NewInline(dir string, manifest *drive.JsonFile) (*Inline, error)

func (*Inline) IsArgPassthrough

func (template *Inline) IsArgPassthrough() bool

type Scanner

type Scanner interface {
	Scan() bool
	Text() string
	Reader() io.Reader
}

type Writer

type Writer interface {
	io.Writer
	Writeln(line string)
}

Jump to

Keyboard shortcuts

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