signature

package
v0.0.0-...-c04ea6e Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasSignature

func HasSignature(key interface{}, params ...typing.Typing) bool

func ResultTyping

func ResultTyping(key interface{}, params ...typing.Typing) typing.Typing

Types

type Mapping

type Mapping map[interface{}][]*Signature

Mapping is from key to signatures. The key can only be an operator or a string.

type Operator

type Operator int
const (
	ADD Operator = iota
	SUBTRACT
	MULTIPLY
	DIVIDE
	MODULO
	EXPONENTIATE
	LOGIC_AND
	LOGIC_NOT
	LOGIC_OR
	IF_ELSE // ? :
	GREATER
	GREATER_OR_EQUAL
	LESS
	LESS_OR_EQUAL
	SHALLOW_EQUAL
	DEEP_EQUAL
	SHALLOW_NOT_EQUAL
	DEEP_NOT_EQUAL
	VOID_OPERATOR
	ERROR_OPERATOR
)

func GetOperator

func GetOperator(tok *token.Token) Operator

func (Operator) String

func (operator Operator) String() string

type Signature

type Signature struct {
	Params []typing.Typing
	Result typing.Typing
}

func CreateSignature

func CreateSignature(result typing.Typing, params ...typing.Typing) *Signature

func (*Signature) Accepts

func (signature *Signature) Accepts(params ...typing.Typing) bool

Jump to

Keyboard shortcuts

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