mint

package module
v0.0.0-...-bc94210 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaler

type Evaler interface {
	Eval() float64
	Push(op Op, val float64) Evaler
	Dump() string
}

type Funcs

type Funcs interface {
	Eval(name string, vs ...float64) (float64, error)
	Contains(name string) bool
}

type Op

type Op int
const (
	OpPlus Op = iota
	OpTimes
	OpExp
)

func (Op) String

func (op Op) String() string

type Result

type Result string

type Stack

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

func NewStack

func NewStack(op Op, ev Evaler) *Stack

func (*Stack) Dump

func (s *Stack) Dump() string

func (*Stack) Eval

func (s *Stack) Eval() float64

func (*Stack) Push

func (s *Stack) Push(op Op, v float64) Evaler

type State

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

func NewState

func NewState() *State

func (*State) Eval

func (s *State) Eval(expr string) (Result, error)

type Value

type Value float64

func (Value) Dump

func (v Value) Dump() string

func (Value) Eval

func (v Value) Eval() float64

func (Value) Push

func (v Value) Push(op Op, val float64) Evaler

Directories

Path Synopsis
cmd
imint command

Jump to

Keyboard shortcuts

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