interpreter

package
v0.0.0-...-e5fbc35 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InsertSemis = &Options{ScanMode: tpl.InsertSemis}
)

Functions

func GetValue

func GetValue(t reflect.Type, lit string) (ret reflect.Value, err error)

func ParseFloat

func ParseFloat(lit string) (v float64, err error)

func ParseInt

func ParseInt(lit string) (v int64, err error)

Types

type Engine

type Engine struct {
	*tpl.CompileRet
	Interpreter interpreter.Interface
	// contains filtered or unexported fields
}

func New

func New(ipt interpreter.Interface, options *Options) (p *Engine, err error)

func (*Engine) EvalCode

func (p *Engine) EvalCode(fn interpreter.Interface, name string, src interface{}) error

func (*Engine) FileLine

func (p *Engine) FileLine(src interface{}) (f interpreter.FileLine)

func (*Engine) Source

func (p *Engine) Source(src interface{}) (text []byte)

type Options

type Options struct {
	Scanner  tpl.Tokener
	ScanMode tpl.ScanMode
}

type RuntimeError

type RuntimeError struct {
	Grammar tpl.Grammar
	Ctx     tpl.Context
	Err     error
	Src     []tpl.Token
}

func (*RuntimeError) Error

func (p *RuntimeError) Error() string

Jump to

Keyboard shortcuts

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