conf

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindSuitableOperatorOverload

func FindSuitableOperatorOverload(fns []string, types TypesTable, l, r reflect.Type) (reflect.Type, string, bool)

Types

type Config

type Config struct {
	MapEnv                  bool
	Types                   TypesTable
	CheckTypes              bool
	Operators               OperatorsTable
	Expect                  reflect.Kind
	Optimize                bool
	AllowUndefinedVariables bool
	UndefinedVariableType   reflect.Type
}

func New

func New(i interface{}) *Config

func (*Config) Check

func (c *Config) Check() error

Check validates the compiler configuration.

type OperatorsTable

type OperatorsTable map[string][]string

OperatorsTable maps binary operators to corresponding list of functions. Functions should be provided in the environment to allow operator overloading.

type Tag

type Tag struct {
	Type   reflect.Type
	Method bool
}

type TypesTable

type TypesTable map[string]Tag

func CreateTypesTable

func CreateTypesTable(i interface{}) TypesTable

CreateTypesTable creates types table for type checks during parsing. If struct is passed, all fields will be treated as variables, as well as all fields of embedded structs and struct itself.

If map is passed, all items will be treated as variables (key as name, value as type).

func FieldsFromStruct

func FieldsFromStruct(t reflect.Type) TypesTable

Jump to

Keyboard shortcuts

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