plurals

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAntlr = fmt.Errorf("err antlr")

ErrAntlr is a error when antlr process fails

View Source
var ErrEmptyStack = errors.New("stack is empty")

ErrEmptyStack returned when call Pop on empty stack

Functions

func DebugCtx

func DebugCtx(ctx context.Context) context.Context

DebugCtx return a ctx that with a debug key, which may print how the exp calculates.

func Eval

func Eval(ctx context.Context, exp string, n int64) (result int64, err error)

Eval 传入复数表达式,返回 n 应该使用哪种复数形式

Types

type Int64Stack

type Int64Stack []int64

Int64Stack see antlr.IntStack

func (*Int64Stack) Pop

func (s *Int64Stack) Pop() (int64, error)

Pop pop a number from stack

func (*Int64Stack) Push

func (s *Int64Stack) Push(e int64)

Push push a number to stack

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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