parser

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentExpression

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

func (AssignmentExpression) Eval

func (exp AssignmentExpression) Eval(ctx *Context) (ContextValue, error)

func (AssignmentExpression) String

func (exp AssignmentExpression) String() string

type BinaryExpression

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

func (BinaryExpression) Eval

func (exp BinaryExpression) Eval(ctx *Context) (ContextValue, error)

func (BinaryExpression) String

func (exp BinaryExpression) String() string

type ClosureContext added in v0.4.0

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

type Context

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

func NewContext

func NewContext() *Context

type ContextValue

type ContextValue struct {
	Val  Value
	Type Type
}

func (ContextValue) String

func (c ContextValue) String() string

type Expression

type Expression interface {
	Eval(*Context) (ContextValue, error)
}

func Parse

func Parse(tokens []token.Token) (Expression, error)

type FnCallExpression

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

func (FnCallExpression) Eval

func (exp FnCallExpression) Eval(ctx *Context) (ContextValue, error)

type FnDefExpression

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

func (FnDefExpression) Eval

func (exp FnDefExpression) Eval(ctx *Context) (ContextValue, error)

func (FnDefExpression) String added in v0.4.0

func (exp FnDefExpression) String() string

type IdentifierExpression

type IdentifierExpression string

func (IdentifierExpression) Eval

func (exp IdentifierExpression) Eval(ctx *Context) (ContextValue, error)

func (IdentifierExpression) String

func (id IdentifierExpression) String() string

type IntegerExpression

type IntegerExpression int

func (IntegerExpression) Eval

func (exp IntegerExpression) Eval(ctx *Context) (ContextValue, error)

func (IntegerExpression) String

func (i IntegerExpression) String() string

type TernaryExpression added in v0.4.0

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

func (TernaryExpression) Eval added in v0.4.0

func (exp TernaryExpression) Eval(ctx *Context) (ContextValue, error)

type Type

type Type int
const (
	Integer Type = iota
	Function
	Closure
)

type UnaryExpression

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

func (UnaryExpression) Eval

func (exp UnaryExpression) Eval(ctx *Context) (ContextValue, error)

func (UnaryExpression) String

func (exp UnaryExpression) String() string

type Value

type Value interface{}

Jump to

Keyboard shortcuts

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