Documentation
¶
Index ¶
- Variables
- func Evaluate(startPos Pos, tree parser.IExpressionContext, data Scope) (any, error)
- func IsBool(input any) (bool, bool)
- func IsComplex(value any) (complex128, bool)
- func IsFloat(value any) (float64, bool)
- func IsInt(value any) (int64, bool)
- func IsNil(a any) bool
- func IsNull(a any) bool
- func IsString(input any) (string, bool)
- func NameOfFunction(f interface{}) string
- func NewErrorListener(start Pos) *errorListener
- func NewVisitor(pos Pos, s Scope) *visitor
- func NotNil(a any) bool
- func NotNull(a any) bool
- func ParseCode(input string, opts ...parseCodeOpt) (tree parser.IExpressionContext, err error)
- func ReflectConvert[T any](from any) (to T)
- func ToBytes(a any) (s []byte)
- func ToNumber[T Integer | Float](a any) (n T)
- func ToRunes(a any) (s []rune)
- func ToString(a any) string
- func TreesToString(tree parser.IExpressionContext) string
- func WithStartPos(pos Pos) parseCodeOpt
- type Complex
- type Float
- type Integer
- type Ordered
- type Pos
- type Scope
- type Signed
- type Unsigned
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInputTooLong = fmt.Errorf("input too long")
View Source
var ErrNoSuchValue = fmt.Errorf("no such value")
Functions ¶
func IsComplex ¶
func IsComplex(value any) (complex128, bool)
func NewErrorListener ¶
func NewErrorListener(start Pos) *errorListener
NewErrorListener 新建词法/语法分析错误监听器
func NewVisitor ¶
NewVisitor 创建一个 Visitor 实例 通过 Visitor 遍历语法树来对其求值
func ParseCode ¶
func ParseCode(input string, opts ...parseCodeOpt) (tree parser.IExpressionContext, err error)
ParseCode 解析代码为语法树
func ReflectConvert ¶
func TreesToString ¶
func TreesToString(tree parser.IExpressionContext) string
TreesToString 打印语法树的工具函数
Types ¶
type Complex ¶
type Complex interface { ~complex64 | ~complex128 }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.