Documentation
¶
Index ¶
- Constants
- Variables
- func AnysToOriginal(aryA []Object) []interface{}
- func ConvertFromObject(vA Object) interface{}
- func DownloadStringFromSSH(sshA string, filePathA string) string
- func FormatInstructions(b []byte, posOffset int) []string
- func FromStringObject(argA String) string
- func GetCfgString(fileNameA string) string
- func GetMagic(numberA int) string
- func GetSwitchFromObjects(argsA []Object, switchA string, defaultA string) string
- func IfSwitchExistsInObjects(argsA []Object, switchA string) bool
- func IsUndefInternal(o Object) bool
- func IterateInstructions(insts []byte, fn func(pos int, opcode Opcode, operands []int, offset int) bool)
- func MakeInstruction(buf []byte, op Opcode, args ...int) ([]byte, error)
- func NewChar(codeA string) (interface{}, error)
- func ObjectsToBytes(aryA []Object) []byte
- func ObjectsToI(aryA []Object) []interface{}
- func ObjectsToN(aryA []Object) []int
- func ObjectsToO(aryA []Object) []interface{}
- func ObjectsToS(aryA []Object) []string
- func QuickCompile(codeA string, compilerOptionsA ...*CompilerOptions) interface{}
- func QuickRun(codeA interface{}, globalsA map[string]interface{}, additionsA ...Object) interface{}
- func ReadOperands(numOperands []int, ins []byte, operands []int) ([]int, int)
- func RunAsFunc(codeA interface{}, argsA ...interface{}) interface{}
- func RunCharCode(codeA string, envA map[string]interface{}, paraMapA map[string]string, ...) (interface{}, error)
- func RunScriptOnHttp(codeA string, compilerOptionsA *CompilerOptions, res http.ResponseWriter, ...) (string, error)
- func SetCfgString(fileNameA string, strA string) string
- func ToFloatQuick(o Object) float64
- func ToGoBool(o Object) (v bool, ok bool)
- func ToGoByteSlice(o Object) (v []byte, ok bool)
- func ToGoFloat64(o Object) (v float64, ok bool)
- func ToGoInt(o Object) (v int, ok bool)
- func ToGoInt64(o Object) (v int64, ok bool)
- func ToGoIntWithDefault(o Object, defaultA int) int
- func ToGoRune(o Object) (v rune, ok bool)
- func ToGoString(o Object) (v string, ok bool)
- func ToGoUint64(o Object) (v uint64, ok bool)
- func ToIntQuick(o Object) int
- func ToInterface(o Object) (ret interface{})
- type Any
- func (o *Any) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*Any) Call(_ ...Object) (Object, error)
- func (o *Any) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Any) CallName(nameA string, c Call) (Object, error)
- func (*Any) CanCall() bool
- func (*Any) CanIterate() bool
- func (o *Any) Copy() Object
- func (o *Any) Equal(right Object) bool
- func (o *Any) GetMember(idxA string) Object
- func (o *Any) GetValue() Object
- func (o *Any) HasMemeber() bool
- func (o *Any) IndexGet(index Object) (Object, error)
- func (o *Any) IndexSet(index, value Object) error
- func (o *Any) IsFalsy() bool
- func (*Any) Iterate() Iterator
- func (o *Any) SetMember(idxA string, valueA Object) error
- func (o *Any) SetValue(valueA Object) error
- func (o *Any) String() string
- func (o *Any) TypeCode() int
- func (*Any) TypeName() string
- type Array
- func (o Array) BinaryOp(tok token.Token, right Object) (Object, error)
- func (Array) Call(...Object) (Object, error)
- func (o Array) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (Array) CanCall() bool
- func (Array) CanIterate() bool
- func (o Array) Copy() Object
- func (o Array) Equal(right Object) bool
- func (o Array) GetMember(idxA string) Object
- func (o Array) GetValue() Object
- func (o Array) HasMemeber() bool
- func (o Array) IndexGet(index Object) (Object, error)
- func (o Array) IndexSet(index, value Object) error
- func (o Array) IsFalsy() bool
- func (o Array) Iterate() Iterator
- func (o Array) Len() int
- func (o Array) SetMember(idxA string, valueA Object) error
- func (o Array) String() string
- func (Array) TypeCode() int
- func (Array) TypeName() string
- type ArrayIterator
- type BigFloat
- func (o *BigFloat) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *BigFloat) Call(_ ...Object) (Object, error)
- func (o *BigFloat) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *BigFloat) CanCall() bool
- func (*BigFloat) CanIterate() bool
- func (o *BigFloat) Equal(right Object) bool
- func (o *BigFloat) GetMember(idxA string) Object
- func (o *BigFloat) GetValue() Object
- func (o *BigFloat) HasMemeber() bool
- func (o *BigFloat) IndexGet(index Object) (Object, error)
- func (o *BigFloat) IndexSet(index, value Object) error
- func (o *BigFloat) IsFalsy() bool
- func (*BigFloat) Iterate() Iterator
- func (o *BigFloat) SetMember(idxA string, valueA Object) error
- func (o *BigFloat) SetValue(valueA Object) error
- func (o *BigFloat) String() string
- func (*BigFloat) TypeCode() int
- func (*BigFloat) TypeName() string
- type BigInt
- func (o *BigInt) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *BigInt) Call(_ ...Object) (Object, error)
- func (o *BigInt) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *BigInt) CanCall() bool
- func (*BigInt) CanIterate() bool
- func (o *BigInt) Equal(right Object) bool
- func (o *BigInt) GetMember(idxA string) Object
- func (o *BigInt) GetValue() Object
- func (o *BigInt) HasMemeber() bool
- func (o *BigInt) IndexGet(index Object) (Object, error)
- func (o *BigInt) IndexSet(index, value Object) error
- func (o *BigInt) IsFalsy() bool
- func (*BigInt) Iterate() Iterator
- func (o *BigInt) SetMember(idxA string, valueA Object) error
- func (o *BigInt) SetValue(valueA Object) error
- func (o *BigInt) String() string
- func (*BigInt) TypeCode() int
- func (*BigInt) TypeName() string
- type Bool
- func (o Bool) BinaryOp(tok token.Token, right Object) (Object, error)
- func (Bool) Call(_ ...Object) (Object, error)
- func (o Bool) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (Bool) CanCall() bool
- func (Bool) CanIterate() bool
- func (o Bool) Equal(right Object) bool
- func (o Bool) Format(s fmt.State, verb rune)
- func (o Bool) GetMember(idxA string) Object
- func (o Bool) GetValue() Object
- func (o Bool) HasMemeber() bool
- func (o Bool) IndexGet(index Object) (value Object, err error)
- func (Bool) IndexSet(index, value Object) error
- func (o Bool) IsFalsy() bool
- func (Bool) Iterate() Iterator
- func (o Bool) SetMember(idxA string, valueA Object) error
- func (o Bool) String() string
- func (Bool) TypeCode() int
- func (Bool) TypeName() string
- type BuiltinFunction
- func (o *BuiltinFunction) Call(args ...Object) (Object, error)
- func (o *BuiltinFunction) CallEx(c Call) (Object, error)
- func (o *BuiltinFunction) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*BuiltinFunction) CanCall() bool
- func (o *BuiltinFunction) Copy() Object
- func (o *BuiltinFunction) Equal(right Object) bool
- func (o *BuiltinFunction) GetMember(idxA string) Object
- func (o *BuiltinFunction) GetValue() Object
- func (o *BuiltinFunction) HasMemeber() bool
- func (o *BuiltinFunction) IndexGet(index Object) (Object, error)
- func (o *BuiltinFunction) IsFalsy() bool
- func (o *BuiltinFunction) SetMember(idxA string, valueA Object) error
- func (o *BuiltinFunction) String() string
- func (*BuiltinFunction) TypeCode() int
- func (*BuiltinFunction) TypeName() string
- type BuiltinModule
- type BuiltinType
- type Byte
- func (o Byte) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o Byte) Call(_ ...Object) (Object, error)
- func (o Byte) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o Byte) CanCall() bool
- func (Byte) CanIterate() bool
- func (o Byte) Equal(right Object) bool
- func (o Byte) Format(s fmt.State, verb rune)
- func (o Byte) GetMember(idxA string) Object
- func (o Byte) GetValue() Object
- func (o Byte) HasMemeber() bool
- func (o Byte) IndexGet(index Object) (Object, error)
- func (Byte) IndexSet(index, value Object) error
- func (o Byte) IsFalsy() bool
- func (Byte) Iterate() Iterator
- func (o Byte) SetMember(idxA string, valueA Object) error
- func (o Byte) String() string
- func (Byte) TypeCode() int
- func (Byte) TypeName() string
- type Bytecode
- type Bytes
- func (o Bytes) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o Bytes) Call(_ ...Object) (Object, error)
- func (o Bytes) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o Bytes) CanCall() bool
- func (Bytes) CanIterate() bool
- func (o Bytes) Copy() Object
- func (o Bytes) Equal(right Object) bool
- func (o Bytes) Format(s fmt.State, verb rune)
- func (o Bytes) GetMember(idxA string) Object
- func (o Bytes) GetValue() Object
- func (o Bytes) HasMemeber() bool
- func (o Bytes) IndexGet(index Object) (Object, error)
- func (o Bytes) IndexSet(index, value Object) error
- func (o Bytes) IsFalsy() bool
- func (o Bytes) Iterate() Iterator
- func (o Bytes) Len() int
- func (o Bytes) SetMember(idxA string, valueA Object) error
- func (o Bytes) String() string
- func (Bytes) TypeCode() int
- func (Bytes) TypeName() string
- type BytesBuffer
- func (o *BytesBuffer) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*BytesBuffer) Call(_ ...Object) (Object, error)
- func (o *BytesBuffer) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*BytesBuffer) CanCall() bool
- func (*BytesBuffer) CanIterate() bool
- func (o *BytesBuffer) Copy() Object
- func (o *BytesBuffer) Equal(right Object) bool
- func (o *BytesBuffer) GetMember(idxA string) Object
- func (o *BytesBuffer) GetValue() Object
- func (o *BytesBuffer) HasMemeber() bool
- func (o *BytesBuffer) IndexGet(index Object) (value Object, err error)
- func (o *BytesBuffer) IndexSet(index, value Object) error
- func (o *BytesBuffer) IsFalsy() bool
- func (*BytesBuffer) Iterate() Iterator
- func (o *BytesBuffer) SetMember(idxA string, valueA Object) error
- func (o *BytesBuffer) String() string
- func (o *BytesBuffer) TypeCode() int
- func (o *BytesBuffer) TypeName() string
- type BytesIterator
- type Call
- type CallableExFunc
- func FnAARAex(fn func(interface{}) interface{}) CallableExFunc
- func FnAARSex(fn func(interface{}) string) CallableExFunc
- func FnAARex(fn func(interface{})) CallableExFunc
- func FnAAVaRAex(fn func(interface{}, ...interface{}) interface{}) CallableExFunc
- func FnAAVaRSex(fn func(interface{}, ...interface{}) string) CallableExFunc
- func FnADSSVaRAex(fn func(*sql.DB, string, string, ...interface{}) interface{}) CallableExFunc
- func FnADSVaRAex(fn func(*sql.DB, string, ...interface{}) interface{}) CallableExFunc
- func FnAFRFex(fn func(float64) float64) CallableExFunc
- func FnAFRSex(fn func(float64) string) CallableExFunc
- func FnALbyLbyViRLLiex(fn func([]byte, []byte, ...int) [][]int) CallableExFunc
- func FnALbySREex(fn func([]byte, string) error) CallableExFunc
- func FnALsRLsex(fn func([]string) []string) CallableExFunc
- func FnALsSViRIex(fn func([]string, string, ...int) int) CallableExFunc
- func FnALyARBex(fn func([]byte, interface{}) bool) CallableExFunc
- func FnALyARIex(fn func([]byte, interface{}) int) CallableExFunc
- func FnALyRBex(fn func([]byte) bool) CallableExFunc
- func FnALyVsRAex(fn func([]byte, ...string) interface{}) CallableExFunc
- func FnALyVsRLyex(fn func([]byte, ...string) []byte) CallableExFunc
- func FnARAex(fn func() interface{}) CallableExFunc
- func FnARIex(fn func() int) CallableExFunc
- func FnARLsex(fn func() []string) CallableExFunc
- func FnARSWREex(fn func(io.Reader, string, io.Writer) error) CallableExFunc
- func FnARSex(fn func() string) CallableExFunc
- func FnARTex(fn func() time.Time) CallableExFunc
- func FnARex(fn func()) CallableExFunc
- func FnASARex(fn func(string, interface{})) CallableExFunc
- func FnASIRSex(fn func(string, int) string) CallableExFunc
- func FnASIVsRSex(fn func(string, int, ...string) string) CallableExFunc
- func FnASRAex(fn func(string) interface{}) CallableExFunc
- func FnASRBex(fn func(string) bool) CallableExFunc
- func FnASREex(fn func(string) error) CallableExFunc
- func FnASRIex(fn func(string) int) CallableExFunc
- func FnASRLbyex(fn func(string) []byte) CallableExFunc
- func FnASRLsex(fn func(string) []string) CallableExFunc
- func FnASRSEex(fn func(string) (string, error)) CallableExFunc
- func FnASRSex(fn func(string) string) CallableExFunc
- func FnASRex(fn func(string)) CallableExFunc
- func FnASSAVaRAex(fn func(string, string, interface{}, ...string) interface{}) CallableExFunc
- func FnASSIRLsex(fn func(string, string, int) []string) CallableExFunc
- func FnASSIRSex(fn func(string, string, int) string) CallableExFunc
- func FnASSRA2Iex(fn func(string, string) [][]int) CallableExFunc
- func FnASSRA2Nex(fn func(string, string) [][]int) CallableExFunc
- func FnASSRAex(fn func(string, string) interface{}) CallableExFunc
- func FnASSRBex(fn func(string, string) bool) CallableExFunc
- func FnASSREex(fn func(string, string) error) CallableExFunc
- func FnASSRFex(fn func(string, string) float64) CallableExFunc
- func FnASSRIex(fn func(string, string) int) CallableExFunc
- func FnASSRLlsex(fn func(string, string) [][]string) CallableExFunc
- func FnASSRLsex(fn func(string, string) []string) CallableExFunc
- func FnASSRSEex(fn func(string, string) (string, error)) CallableExFunc
- func FnASSRSex(fn func(string, string) string) CallableExFunc
- func FnASSSRSex(fn func(string, string, string) string) CallableExFunc
- func FnASSSVsRSex(fn func(string, string, string, ...string) string) CallableExFunc
- func FnASSVIRFex(fn func(string, string, ...int) float64) CallableExFunc
- func FnASSViRLsex(fn func(string, string, ...int) []string) CallableExFunc
- func FnASSVsRBex(fn func(string, string, ...string) bool) CallableExFunc
- func FnASSVsREex(fn func(string, string, ...string) error) CallableExFunc
- func FnASVaRAex(fn func(string, ...interface{}) interface{}) CallableExFunc
- func FnASVaREex(fn func(string, ...interface{}) error) CallableExFunc
- func FnASVaRIEex(fn func(string, ...interface{}) (int, error)) CallableExFunc
- func FnASVaRSex(fn func(string, ...interface{}) string) CallableExFunc
- func FnASVaRex(fn func(string, ...interface{})) CallableExFunc
- func FnASViRAex(fn func(string, ...int) interface{}) CallableExFunc
- func FnASViRIex(fn func(string, ...int) int) CallableExFunc
- func FnASVsRAex(fn func(string, ...string) interface{}) CallableExFunc
- func FnASVsRBex(fn func(string, ...string) bool) CallableExFunc
- func FnASVsRLmssex(fn func(string, ...string) []map[string]string) CallableExFunc
- func FnASVsRSex(fn func(string, ...string) string) CallableExFunc
- func FnATFRTex(fn func(time.Time, float64) time.Time) CallableExFunc
- func FnATIIIRTex(fn func(time.Time, int, int, int) time.Time) CallableExFunc
- func FnATRSex(fn func(time.Time) string) CallableExFunc
- func FnATVsRSex(fn func(time.Time, ...string) string) CallableExFunc
- func FnAVaRAex(fn func(...interface{}) interface{}) CallableExFunc
- func FnAVaRIEex(fn func(...interface{}) (int, error)) CallableExFunc
- func FnAVaRSex(fn func(...interface{}) string) CallableExFunc
- func FnAVaRex(fn func(...interface{})) CallableExFunc
- func FnAVsREex(fn func(...string) error) CallableExFunc
- func FnAVsRSex(fn func(...string) string) CallableExFunc
- func FnAWSVaRIEex(fn func(io.Writer, string, ...interface{}) (int, error)) CallableExFunc
- func FnAWtRdRI64Eex(fn func(io.Writer, io.Reader) (int64, error)) CallableExFunc
- type CallableFunc
- func CallExAdapter(fn CallableExFunc) CallableFunc
- func FnAAR(fn func(interface{})) CallableFunc
- func FnAARA(fn func(interface{}) interface{}) CallableFunc
- func FnAARS(fn func(interface{}) string) CallableFunc
- func FnAAVaRA(fn func(interface{}, ...interface{}) interface{}) CallableFunc
- func FnAAVaRS(fn func(interface{}, ...interface{}) string) CallableFunc
- func FnADSSVaRA(fn func(*sql.DB, string, string, ...interface{}) interface{}) CallableFunc
- func FnADSVaRA(fn func(*sql.DB, string, ...interface{}) interface{}) CallableFunc
- func FnAFRF(fn func(float64) float64) CallableFunc
- func FnAFRS(fn func(float64) string) CallableFunc
- func FnALbyLbyViRLLi(fn func([]byte, []byte, ...int) [][]int) CallableFunc
- func FnALbySRE(fn func([]byte, string) error) CallableFunc
- func FnALsRLs(fn func([]string) []string) CallableFunc
- func FnALsSViRI(fn func([]string, string, ...int) int) CallableFunc
- func FnALyARB(fn func([]byte, interface{}) bool) CallableFunc
- func FnALyARI(fn func([]byte, interface{}) int) CallableFunc
- func FnALyRB(fn func([]byte) bool) CallableFunc
- func FnALyVsRA(fn func([]byte, ...string) interface{}) CallableFunc
- func FnALyVsRLy(fn func([]byte, ...string) []byte) CallableFunc
- func FnAR(fn func()) CallableFunc
- func FnARA(fn func() interface{}) CallableFunc
- func FnARI(fn func() int) CallableFunc
- func FnARLs(fn func() []string) CallableFunc
- func FnARS(fn func() string) CallableFunc
- func FnARSWRE(fn func(io.Reader, string, io.Writer) error) CallableFunc
- func FnART(fn func() time.Time) CallableFunc
- func FnASAR(fn func(string, interface{})) CallableFunc
- func FnASIRS(fn func(string, int) string) CallableFunc
- func FnASIVsRS(fn func(string, int, ...string) string) CallableFunc
- func FnASR(fn func(string)) CallableFunc
- func FnASRA(fn func(string) interface{}) CallableFunc
- func FnASRB(fn func(string) bool) CallableFunc
- func FnASRE(fn func(string) error) CallableFunc
- func FnASRI(fn func(string) int) CallableFunc
- func FnASRLby(fn func(string) []byte) CallableFunc
- func FnASRLs(fn func(string) []string) CallableFunc
- func FnASRS(fn func(string) string) CallableFunc
- func FnASRSE(fn func(string) (string, error)) CallableFunc
- func FnASSAVaRA(fn func(string, string, interface{}, ...string) interface{}) CallableFunc
- func FnASSIRLs(fn func(string, string, int) []string) CallableFunc
- func FnASSIRS(fn func(string, string, int) string) CallableFunc
- func FnASSRA(fn func(string, string) interface{}) CallableFunc
- func FnASSRA2I(fn func(string, string) [][]int) CallableFunc
- func FnASSRA2N(fn func(string, string) [][]int) CallableFunc
- func FnASSRB(fn func(string, string) bool) CallableFunc
- func FnASSRE(fn func(string, string) error) CallableFunc
- func FnASSRF(fn func(string, string) float64) CallableFunc
- func FnASSRI(fn func(string, string) int) CallableFunc
- func FnASSRLls(fn func(string, string) [][]string) CallableFunc
- func FnASSRLs(fn func(string, string) []string) CallableFunc
- func FnASSRS(fn func(string, string) string) CallableFunc
- func FnASSRSE(fn func(string, string) (string, error)) CallableFunc
- func FnASSSRS(fn func(string, string, string) string) CallableFunc
- func FnASSSVsRS(fn func(string, string, string, ...string) string) CallableFunc
- func FnASSVIRF(fn func(string, string, ...int) float64) CallableFunc
- func FnASSViRLs(fn func(string, string, ...int) []string) CallableFunc
- func FnASSVsRB(fn func(string, string, ...string) bool) CallableFunc
- func FnASSVsRE(fn func(string, string, ...string) error) CallableFunc
- func FnASVaR(fn func(string, ...interface{})) CallableFunc
- func FnASVaRA(fn func(string, ...interface{}) interface{}) CallableFunc
- func FnASVaRE(fn func(string, ...interface{}) error) CallableFunc
- func FnASVaRS(fn func(string, ...interface{}) string) CallableFunc
- func FnASViRA(fn func(string, ...int) interface{}) CallableFunc
- func FnASViRI(fn func(string, ...int) int) CallableFunc
- func FnASVsRA(fn func(string, ...string) interface{}) CallableFunc
- func FnASVsRB(fn func(string, ...string) bool) CallableFunc
- func FnASVsRLmss(fn func(string, ...string) []map[string]string) CallableFunc
- func FnASVsRS(fn func(string, ...string) string) CallableFunc
- func FnATFRT(fn func(time.Time, float64) time.Time) CallableFunc
- func FnATIIIRT(fn func(time.Time, int, int, int) time.Time) CallableFunc
- func FnATRS(fn func(time.Time) string) CallableFunc
- func FnATVsRS(fn func(time.Time, ...string) string) CallableFunc
- func FnAVaR(fn func(...interface{})) CallableFunc
- func FnAVaRA(fn func(...interface{}) interface{}) CallableFunc
- func FnAVaRIE(fn func(...interface{}) (int, error)) CallableFunc
- func FnAVaRS(fn func(...interface{}) string) CallableFunc
- func FnAVsRE(fn func(...string) error) CallableFunc
- func FnAVsRS(fn func(...string) string) CallableFunc
- func FnAWSVaRIE(fn func(io.Writer, string, ...interface{}) (int, error)) CallableFunc
- func FnAWtRdRI64E(fn func(io.Writer, io.Reader) (int64, error)) CallableFunc
- type Char
- func (o Char) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o Char) Call(_ ...Object) (Object, error)
- func (o Char) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o Char) CanCall() bool
- func (Char) CanIterate() bool
- func (o Char) Equal(right Object) bool
- func (o Char) Format(s fmt.State, verb rune)
- func (o Char) GetMember(idxA string) Object
- func (o Char) GetValue() Object
- func (o Char) HasMemeber() bool
- func (o Char) IndexGet(index Object) (Object, error)
- func (Char) IndexSet(index, value Object) error
- func (o Char) IsFalsy() bool
- func (Char) Iterate() Iterator
- func (o Char) SetMember(idxA string, valueA Object) error
- func (o Char) String() string
- func (Char) TypeCode() int
- func (Char) TypeName() string
- type CharCode
- func (o *CharCode) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *CharCode) Call(argsA ...Object) (Object, error)
- func (o *CharCode) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *CharCode) CanCall() bool
- func (*CharCode) CanIterate() bool
- func (o *CharCode) Equal(right Object) bool
- func (o *CharCode) GetMember(idxA string) Object
- func (o *CharCode) GetValue() Object
- func (o *CharCode) HasMemeber() bool
- func (o *CharCode) IndexGet(index Object) (Object, error)
- func (o *CharCode) IndexSet(index, value Object) error
- func (o *CharCode) IsFalsy() bool
- func (o *CharCode) Iterate() Iterator
- func (o *CharCode) SetMember(idxA string, valueA Object) error
- func (o *CharCode) String() string
- func (*CharCode) TypeCode() int
- func (*CharCode) TypeName() string
- type Chars
- func (o Chars) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o Chars) Call(_ ...Object) (Object, error)
- func (o Chars) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o Chars) CanCall() bool
- func (Chars) CanIterate() bool
- func (o Chars) Copy() Object
- func (o Chars) Equal(right Object) bool
- func (o Chars) Format(s fmt.State, verb rune)
- func (o Chars) GetMember(idxA string) Object
- func (o Chars) GetValue() Object
- func (o Chars) HasMemeber() bool
- func (o Chars) IndexGet(index Object) (Object, error)
- func (o Chars) IndexSet(index, value Object) error
- func (o Chars) IsFalsy() bool
- func (o Chars) Iterate() Iterator
- func (o Chars) Len() int
- func (o Chars) SetMember(idxA string, valueA Object) error
- func (o Chars) String() string
- func (Chars) TypeCode() int
- func (Chars) TypeName() string
- type CharsIterator
- type CompiledFunction
- func (*CompiledFunction) BinaryOp(token.Token, Object) (Object, error)
- func (*CompiledFunction) Call(...Object) (Object, error)
- func (o *CompiledFunction) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*CompiledFunction) CanCall() bool
- func (*CompiledFunction) CanIterate() bool
- func (o *CompiledFunction) Copy() Object
- func (o *CompiledFunction) Equal(right Object) bool
- func (o *CompiledFunction) Fprint(w io.Writer)
- func (o *CompiledFunction) GetMember(idxA string) Object
- func (o *CompiledFunction) GetValue() Object
- func (o *CompiledFunction) HasMemeber() bool
- func (o *CompiledFunction) IndexGet(index Object) (Object, error)
- func (*CompiledFunction) IndexSet(index, value Object) error
- func (o *CompiledFunction) IsFalsy() bool
- func (*CompiledFunction) Iterate() Iterator
- func (o *CompiledFunction) SetMember(idxA string, valueA Object) error
- func (o *CompiledFunction) SourcePos(ip int) parser.Pos
- func (o *CompiledFunction) String() string
- func (*CompiledFunction) TypeCode() int
- func (*CompiledFunction) TypeName() string
- type Compiler
- type CompilerError
- type CompilerOptions
- type Copier
- type Database
- func (o *Database) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*Database) Call(_ ...Object) (Object, error)
- func (o *Database) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*Database) CanCall() bool
- func (*Database) CanIterate() bool
- func (o Database) Equal(right Object) bool
- func (o *Database) GetMember(idxA string) Object
- func (o *Database) GetValue() Object
- func (o *Database) HasMemeber() bool
- func (o *Database) IndexGet(index Object) (value Object, err error)
- func (o *Database) IndexSet(index, value Object) error
- func (o *Database) IsFalsy() bool
- func (*Database) Iterate() Iterator
- func (o *Database) SetMember(idxA string, valueA Object) error
- func (o *Database) String() string
- func (o *Database) TypeCode() int
- func (o *Database) TypeName() string
- type Delegate
- func (o *Delegate) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Delegate) Call(argsA ...Object) (Object, error)
- func (o *Delegate) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Delegate) CanCall() bool
- func (*Delegate) CanIterate() bool
- func (o *Delegate) Equal(right Object) bool
- func (o *Delegate) GetMember(idxA string) Object
- func (o *Delegate) GetValue() Object
- func (o *Delegate) HasMemeber() bool
- func (o *Delegate) IndexGet(index Object) (Object, error)
- func (o *Delegate) IndexSet(index, value Object) error
- func (o *Delegate) IsFalsy() bool
- func (*Delegate) Iterate() Iterator
- func (o *Delegate) SetMember(idxA string, valueA Object) error
- func (o *Delegate) SetValue(valueA Object) error
- func (o *Delegate) String() string
- func (*Delegate) TypeCode() int
- func (*Delegate) TypeName() string
- type Error
- func NewArgumentTypeError(pos, expectType, foundType string) *Error
- func NewCommonError(formatA string, argsA ...interface{}) *Error
- func NewCommonErrorWithPos(c Call, formatA string, argsA ...interface{}) *Error
- func NewError(nameA string, formatA string, argsA ...interface{}) *Error
- func NewFromError(errA error) *Error
- func NewIndexTypeError(expectType, foundType string) *Error
- func NewIndexValueTypeError(expectType, foundType string) *Error
- func NewOperandTypeError(token, leftType, rightType string) *Error
- func WrapError(errA error) *Error
- func (o *Error) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*Error) Call(_ ...Object) (Object, error)
- func (o *Error) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*Error) CanCall() bool
- func (*Error) CanIterate() bool
- func (o *Error) Copy() Object
- func (o *Error) Equal(right Object) bool
- func (o *Error) Error() string
- func (o *Error) GetMember(idxA string) Object
- func (o *Error) GetValue() Object
- func (o *Error) HasMemeber() bool
- func (o *Error) IndexGet(index Object) (Object, error)
- func (o *Error) IndexSet(index, value Object) error
- func (o *Error) IsFalsy() bool
- func (*Error) Iterate() Iterator
- func (o *Error) NewError(messages ...string) *Error
- func (o *Error) SetMember(idxA string, valueA Object) error
- func (o *Error) String() string
- func (*Error) TypeCode() int
- func (*Error) TypeName() string
- func (o *Error) Unwrap() error
- type Eval
- type EvalMachine
- func (o *EvalMachine) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *EvalMachine) Call(_ ...Object) (Object, error)
- func (o *EvalMachine) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *EvalMachine) CallName(nameA string, c Call) (Object, error)
- func (o *EvalMachine) CanCall() bool
- func (*EvalMachine) CanIterate() bool
- func (o *EvalMachine) Equal(right Object) bool
- func (o *EvalMachine) GetMember(idxA string) Object
- func (o *EvalMachine) GetValue() Object
- func (o *EvalMachine) HasMemeber() bool
- func (o *EvalMachine) IndexGet(index Object) (Object, error)
- func (o *EvalMachine) IndexSet(index, value Object) error
- func (o *EvalMachine) IsFalsy() bool
- func (*EvalMachine) Iterate() Iterator
- func (o *EvalMachine) SetMember(idxA string, valueA Object) error
- func (o *EvalMachine) SetValue(valueA Object) error
- func (o *EvalMachine) String() string
- func (*EvalMachine) TypeCode() int
- func (*EvalMachine) TypeName() string
- type ExCallerObject
- type Excel
- func (o *Excel) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Excel) Call(argsA ...Object) (Object, error)
- func (o *Excel) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Excel) CanCall() bool
- func (*Excel) CanIterate() bool
- func (o *Excel) Equal(right Object) bool
- func (o *Excel) GetMember(idxA string) Object
- func (o *Excel) GetValue() Object
- func (o *Excel) HasMemeber() bool
- func (o *Excel) IndexGet(index Object) (Object, error)
- func (o *Excel) IndexSet(index, value Object) error
- func (o *Excel) IsFalsy() bool
- func (*Excel) Iterate() Iterator
- func (o *Excel) SetMember(idxA string, valueA Object) error
- func (o *Excel) SetValue(valueA Object) error
- func (o *Excel) String() string
- func (*Excel) TypeCode() int
- func (*Excel) TypeName() string
- type ExtImporter
- type File
- func (o *File) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *File) Call(_ ...Object) (Object, error)
- func (o *File) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *File) CallName(name string, c Call) (Object, error)
- func (o *File) CanCall() bool
- func (*File) CanIterate() bool
- func (o *File) Close() error
- func (o *File) Equal(right Object) bool
- func (o *File) GetMember(idxA string) Object
- func (o *File) GetValue() Object
- func (o *File) HasMemeber() bool
- func (o *File) IndexGet(index Object) (Object, error)
- func (o *File) IndexSet(index, value Object) error
- func (o *File) IsFalsy() bool
- func (o *File) Iterate() Iterator
- func (o *File) Read(p []byte) (n int, err error)
- func (o *File) SetMember(idxA string, valueA Object) error
- func (o *File) String() string
- func (*File) TypeCode() int
- func (*File) TypeName() string
- func (o *File) Writer(p []byte) (n int, err error)
- type Float
- func (o Float) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o Float) Call(_ ...Object) (Object, error)
- func (o Float) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o Float) CanCall() bool
- func (Float) CanIterate() bool
- func (o Float) Equal(right Object) bool
- func (o Float) Format(s fmt.State, verb rune)
- func (o Float) GetMember(idxA string) Object
- func (o Float) GetValue() Object
- func (o Float) HasMemeber() bool
- func (o Float) IndexGet(index Object) (Object, error)
- func (Float) IndexSet(index, value Object) error
- func (o Float) IsFalsy() bool
- func (Float) Iterate() Iterator
- func (o Float) SetMember(idxA string, valueA Object) error
- func (o Float) String() string
- func (Float) TypeCode() int
- func (Float) TypeName() string
- type Function
- func (o *Function) Call(args ...Object) (Object, error)
- func (o *Function) CallEx(call Call) (Object, error)
- func (o *Function) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*Function) CanCall() bool
- func (o *Function) Copy() Object
- func (o *Function) Equal(right Object) bool
- func (o *Function) GetMember(idxA string) Object
- func (o *Function) GetValue() Object
- func (o *Function) HasMemeber() bool
- func (o *Function) IsFalsy() bool
- func (o *Function) SetMember(idxA string, valueA Object) error
- func (o *Function) String() string
- func (*Function) TypeCode() int
- func (*Function) TypeName() string
- type Gel
- func (o *Gel) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Gel) Call(_ ...Object) (Object, error)
- func (o *Gel) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Gel) CanCall() bool
- func (*Gel) CanIterate() bool
- func (o *Gel) Equal(right Object) bool
- func (o *Gel) GetMember(idxA string) Object
- func (o *Gel) GetValue() Object
- func (o *Gel) HasMemeber() bool
- func (o *Gel) IndexGet(index Object) (Object, error)
- func (o *Gel) IndexSet(index, value Object) error
- func (o *Gel) IsFalsy() bool
- func (o *Gel) Iterate() Iterator
- func (o *Gel) SetMember(idxA string, valueA Object) error
- func (o *Gel) String() string
- func (*Gel) TypeCode() int
- func (*Gel) TypeName() string
- type GlobalContext
- type HttpHandler
- func (o *HttpHandler) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *HttpHandler) Call(_ ...Object) (Object, error)
- func (o *HttpHandler) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *HttpHandler) CanCall() bool
- func (*HttpHandler) CanIterate() bool
- func (o *HttpHandler) Equal(right Object) bool
- func (o *HttpHandler) GetMember(idxA string) Object
- func (o *HttpHandler) GetValue() Object
- func (o *HttpHandler) HasMemeber() bool
- func (o *HttpHandler) IndexGet(index Object) (Object, error)
- func (o *HttpHandler) IndexSet(index, value Object) error
- func (o *HttpHandler) IsFalsy() bool
- func (o *HttpHandler) Iterate() Iterator
- func (o *HttpHandler) SetMember(idxA string, valueA Object) error
- func (o *HttpHandler) String() string
- func (*HttpHandler) TypeCode() int
- func (*HttpHandler) TypeName() string
- type HttpReq
- func (o *HttpReq) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *HttpReq) Call(_ ...Object) (Object, error)
- func (o *HttpReq) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *HttpReq) CanCall() bool
- func (*HttpReq) CanIterate() bool
- func (o *HttpReq) Equal(right Object) bool
- func (o *HttpReq) GetMember(idxA string) Object
- func (o *HttpReq) GetValue() Object
- func (o *HttpReq) HasMemeber() bool
- func (o *HttpReq) IndexGet(index Object) (Object, error)
- func (o *HttpReq) IndexSet(index, value Object) error
- func (o *HttpReq) IsFalsy() bool
- func (o *HttpReq) Iterate() Iterator
- func (o *HttpReq) SetMember(idxA string, valueA Object) error
- func (o *HttpReq) String() string
- func (*HttpReq) TypeCode() int
- func (*HttpReq) TypeName() string
- type HttpResp
- func (o *HttpResp) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *HttpResp) Call(_ ...Object) (Object, error)
- func (o *HttpResp) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *HttpResp) CanCall() bool
- func (*HttpResp) CanIterate() bool
- func (o *HttpResp) Equal(right Object) bool
- func (o *HttpResp) GetMember(idxA string) Object
- func (o *HttpResp) GetValue() Object
- func (o *HttpResp) HasMemeber() bool
- func (o *HttpResp) IndexGet(index Object) (Object, error)
- func (o *HttpResp) IndexSet(index, value Object) error
- func (o *HttpResp) IsFalsy() bool
- func (o *HttpResp) Iterate() Iterator
- func (o *HttpResp) SetMember(idxA string, valueA Object) error
- func (o *HttpResp) String() string
- func (*HttpResp) TypeCode() int
- func (*HttpResp) TypeName() string
- func (o *HttpResp) Write(p []byte) (n int, err error)
- type Image
- func (o *Image) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Image) Call(_ ...Object) (Object, error)
- func (o *Image) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Image) CanCall() bool
- func (*Image) CanIterate() bool
- func (o *Image) Equal(right Object) bool
- func (o *Image) GetMember(idxA string) Object
- func (o *Image) GetValue() Object
- func (o *Image) HasMemeber() bool
- func (o *Image) IndexGet(index Object) (Object, error)
- func (o *Image) IndexSet(index, value Object) error
- func (o *Image) IsFalsy() bool
- func (*Image) Iterate() Iterator
- func (o *Image) SetMember(idxA string, valueA Object) error
- func (o *Image) SetValue(valueA Object) error
- func (o *Image) String() string
- func (*Image) TypeCode() int
- func (*Image) TypeName() string
- type Importable
- type IndexDeleter
- type Int
- func (o Int) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o Int) Call(_ ...Object) (Object, error)
- func (o Int) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o Int) CanCall() bool
- func (Int) CanIterate() bool
- func (o Int) Equal(right Object) bool
- func (o Int) Format(s fmt.State, verb rune)
- func (o Int) GetMember(idxA string) Object
- func (o Int) GetValue() Object
- func (o Int) HasMemeber() bool
- func (o Int) IndexGet(index Object) (Object, error)
- func (Int) IndexSet(index, value Object) error
- func (o Int) IsFalsy() bool
- func (o Int) Iterate() Iterator
- func (o Int) SetMember(idxA string, valueA Object) error
- func (o Int) String() string
- func (Int) TypeCode() int
- func (Int) TypeName() string
- type IntIterator
- type Invoker
- type Iterator
- type LengthGetter
- type Location
- func (o *Location) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Location) Equal(right Object) bool
- func (o *Location) GetMember(idxA string) Object
- func (o *Location) GetValue() Object
- func (o *Location) HasMemeber() bool
- func (o *Location) IsFalsy() bool
- func (o *Location) SetMember(idxA string, valueA Object) error
- func (o *Location) String() string
- func (*Location) TypeCode() int
- func (*Location) TypeName() string
- type Map
- func (o Map) BinaryOp(tok token.Token, right Object) (Object, error)
- func (Map) Call(...Object) (Object, error)
- func (o Map) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o Map) CallName(nameA string, c Call) (Object, error)
- func (Map) CanCall() bool
- func (Map) CanIterate() bool
- func (o Map) Copy() Object
- func (o Map) Equal(right Object) bool
- func (o Map) GetMember(idxA string) Object
- func (o Map) GetValue() Object
- func (o Map) HasMemeber() bool
- func (o Map) IndexDelete(key Object) error
- func (o Map) IndexGet(index Object) (Object, error)
- func (o Map) IndexSet(index, value Object) error
- func (o Map) IsFalsy() bool
- func (o Map) Iterate() Iterator
- func (o Map) Len() int
- func (o Map) SetMember(idxA string, valueA Object) error
- func (o Map) String() string
- func (Map) TypeCode() int
- func (Map) TypeName() string
- type MapArray
- func (o *MapArray) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *MapArray) Call(_ ...Object) (Object, error)
- func (o *MapArray) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *MapArray) CallName(nameA string, c Call) (Object, error)
- func (o *MapArray) CanCall() bool
- func (*MapArray) CanIterate() bool
- func (o *MapArray) Equal(right Object) bool
- func (o *MapArray) GetMember(idxA string) Object
- func (o *MapArray) GetValue() Object
- func (o *MapArray) HasMemeber() bool
- func (o *MapArray) IndexGet(index Object) (Object, error)
- func (o *MapArray) IndexSet(index, value Object) error
- func (o *MapArray) IsFalsy() bool
- func (o *MapArray) Iterate() Iterator
- func (o *MapArray) Len() int
- func (o *MapArray) SetMember(idxA string, valueA Object) error
- func (o *MapArray) SetValue(valueA Object) error
- func (o *MapArray) String() string
- func (*MapArray) TypeCode() int
- func (*MapArray) TypeName() string
- type MapArrayIterator
- type MapIterator
- type ModuleMap
- func (m *ModuleMap) Add(name string, module Importable) *ModuleMap
- func (m *ModuleMap) AddBuiltinModule(name string, attrs map[string]Object) *ModuleMap
- func (m *ModuleMap) AddSourceModule(name string, src []byte) *ModuleMap
- func (m *ModuleMap) Copy() *ModuleMap
- func (m *ModuleMap) Fork(moduleName string) *ModuleMap
- func (m *ModuleMap) Get(name string) Importable
- func (m *ModuleMap) Remove(name string)
- func (m *ModuleMap) SetExtImporter(im ExtImporter) *ModuleMap
- type MutableString
- func (o *MutableString) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *MutableString) Call(_ ...Object) (Object, error)
- func (o *MutableString) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *MutableString) CanCall() bool
- func (*MutableString) CanIterate() bool
- func (o *MutableString) Equal(right Object) bool
- func (o *MutableString) Format(s fmt.State, verb rune)
- func (o *MutableString) GetMember(idxA string) Object
- func (o *MutableString) GetValue() Object
- func (o *MutableString) HasMemeber() bool
- func (o *MutableString) IndexGet(index Object) (Object, error)
- func (o *MutableString) IndexSet(index, value Object) error
- func (o *MutableString) IsFalsy() bool
- func (o *MutableString) Iterate() Iterator
- func (o *MutableString) Len() int
- func (o *MutableString) MarshalJSON() ([]byte, error)
- func (o *MutableString) SetMember(idxA string, valueA Object) error
- func (o *MutableString) SetValue(valueA Object) error
- func (o *MutableString) String() string
- func (*MutableString) TypeCode() int
- func (*MutableString) TypeName() string
- type MutableStringIterator
- type Mutex
- func (o *Mutex) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Mutex) Call(_ ...Object) (Object, error)
- func (o *Mutex) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Mutex) CanCall() bool
- func (*Mutex) CanIterate() bool
- func (o *Mutex) Equal(right Object) bool
- func (o *Mutex) GetMember(idxA string) Object
- func (o *Mutex) GetValue() Object
- func (o *Mutex) HasMemeber() bool
- func (o *Mutex) IndexGet(index Object) (Object, error)
- func (o *Mutex) IndexSet(index, value Object) error
- func (o *Mutex) IsFalsy() bool
- func (o *Mutex) Iterate() Iterator
- func (o *Mutex) SetMember(idxA string, valueA Object) error
- func (o *Mutex) String() string
- func (*Mutex) TypeCode() int
- func (*Mutex) TypeName() string
- type Mux
- func (o *Mux) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Mux) Call(_ ...Object) (Object, error)
- func (o *Mux) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Mux) CanCall() bool
- func (*Mux) CanIterate() bool
- func (o *Mux) Equal(right Object) bool
- func (o *Mux) GetMember(idxA string) Object
- func (o *Mux) GetValue() Object
- func (o *Mux) HasMemeber() bool
- func (o *Mux) IndexGet(index Object) (Object, error)
- func (o *Mux) IndexSet(index, value Object) error
- func (o *Mux) IsFalsy() bool
- func (o *Mux) Iterate() Iterator
- func (o *Mux) SetMember(idxA string, valueA Object) error
- func (o *Mux) String() string
- func (*Mux) TypeCode() int
- func (*Mux) TypeName() string
- type NameCallerObject
- type Object
- func BuiltinDbCloseFunc(c Call) (Object, error)
- func BuiltinDealStrFunc(c Call) (Object, error)
- func BuiltinDelegateFunc(c Call) (Object, error)
- func CallObjectMethodFunc(o Object, idxA string, argsA ...Object) (Object, error)
- func ConvertToObject(vA interface{}) Object
- func GenStatusResult(args ...Object) (Object, error)
- func GetObjectMethodFunc(o Object, idxA string) (Object, error)
- func NewBigFloat(c Call) (Object, error)
- func NewBigInt(c Call) (Object, error)
- func NewBytesBuffer(c Call) (Object, error)
- func NewDelegate(c Call) (Object, error)
- func NewEvalMachine(c Call) (Object, error)
- func NewExcel(c Call) (Object, error)
- func NewExternalDelegate(funcA func(...interface{}) interface{}) Object
- func NewFile(c Call) (Object, error)
- func NewGel(argsA ...Object) (Object, error)
- func NewHttpHandler(c Call) (Object, error)
- func NewHttpReq(c Call) (Object, error)
- func NewImage(c Call) (Object, error)
- func NewMapArray(c Call) (Object, error)
- func NewOrderedMap(argsA ...Object) (Object, error)
- func NewQueue(c Call) (Object, error)
- func NewReader(c Call) (Object, error)
- func NewStack(c Call) (Object, error)
- func NewWriter(c Call) (Object, error)
- func ToObject(v interface{}) (ret Object, err error)
- func ToObjectAlt(v interface{}) (ret Object, err error)
- type ObjectImpl
- func (ObjectImpl) BinaryOp(_ token.Token, _ Object) (Object, error)
- func (ObjectImpl) Call(_ ...Object) (Object, error)
- func (o ObjectImpl) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (ObjectImpl) CanCall() bool
- func (ObjectImpl) CanIterate() bool
- func (ObjectImpl) Equal(Object) bool
- func (o ObjectImpl) GetMember(idxA string) Object
- func (o ObjectImpl) GetValue() Object
- func (o ObjectImpl) HasMemeber() bool
- func (o ObjectImpl) IndexGet(index Object) (value Object, err error)
- func (o ObjectImpl) IndexSet(index, value Object) error
- func (ObjectImpl) IsFalsy() bool
- func (ObjectImpl) Iterate() Iterator
- func (o ObjectImpl) SetMember(idxA string, valueA Object) error
- func (o ObjectImpl) String() string
- func (ObjectImpl) TypeCode() int
- func (ObjectImpl) TypeName() string
- type ObjectPtr
- func (o *ObjectPtr) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *ObjectPtr) Call(args ...Object) (Object, error)
- func (o *ObjectPtr) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *ObjectPtr) CanCall() bool
- func (o *ObjectPtr) Copy() Object
- func (o *ObjectPtr) Equal(x Object) bool
- func (o *ObjectPtr) GetMember(idxA string) Object
- func (o *ObjectPtr) GetValue() Object
- func (o *ObjectPtr) HasMemeber() bool
- func (o *ObjectPtr) IsFalsy() bool
- func (o *ObjectPtr) SetMember(idxA string, valueA Object) error
- func (o *ObjectPtr) String() string
- func (o *ObjectPtr) TypeCode() int
- func (o *ObjectPtr) TypeName() string
- type ObjectRef
- func (o *ObjectRef) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *ObjectRef) Call(args ...Object) (Object, error)
- func (o *ObjectRef) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *ObjectRef) CanCall() bool
- func (o *ObjectRef) Copy() Object
- func (o *ObjectRef) Equal(x Object) bool
- func (o *ObjectRef) GetMember(idxA string) Object
- func (o *ObjectRef) GetValue() Object
- func (o *ObjectRef) HasMemeber() bool
- func (o *ObjectRef) IsFalsy() bool
- func (o *ObjectRef) SetMember(idxA string, valueA Object) error
- func (o *ObjectRef) String() string
- func (o *ObjectRef) TypeCode() int
- func (o *ObjectRef) TypeName() string
- type Opcode
- type OptimizerError
- type OrderedMap
- func (o *OrderedMap) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*OrderedMap) Call(...Object) (Object, error)
- func (o *OrderedMap) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*OrderedMap) CanCall() bool
- func (*OrderedMap) CanIterate() bool
- func (o *OrderedMap) Copy() Object
- func (o *OrderedMap) Equal(right Object) bool
- func (o *OrderedMap) GetMember(idxA string) Object
- func (o *OrderedMap) GetValue() Object
- func (o *OrderedMap) HasMemeber() bool
- func (o *OrderedMap) IndexDelete(key Object) error
- func (o *OrderedMap) IndexGet(index Object) (Object, error)
- func (o *OrderedMap) IndexSet(index, value Object) error
- func (o *OrderedMap) IsFalsy() bool
- func (o *OrderedMap) Iterate() Iterator
- func (o *OrderedMap) Len() int
- func (o *OrderedMap) SetMember(idxA string, valueA Object) error
- func (o *OrderedMap) String() string
- func (*OrderedMap) TypeCode() int
- func (*OrderedMap) TypeName() string
- type OrderedMapIterator
- type Queue
- func (o *Queue) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*Queue) Call(...Object) (Object, error)
- func (o *Queue) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*Queue) CanCall() bool
- func (*Queue) CanIterate() bool
- func (o *Queue) GetMember(idxA string) Object
- func (o *Queue) GetValue() Object
- func (o *Queue) HasMemeber() bool
- func (o *Queue) IndexGet(index Object) (Object, error)
- func (o *Queue) IndexSet(index, value Object) error
- func (o *Queue) IsFalsy() bool
- func (o *Queue) Iterate() Iterator
- func (o *Queue) Len() int
- func (o *Queue) SetMember(idxA string, valueA Object) error
- func (o *Queue) String() string
- func (*Queue) TypeCode() int
- func (*Queue) TypeName() string
- type QueueIterator
- type Reader
- func (o *Reader) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Reader) Call(_ ...Object) (Object, error)
- func (o *Reader) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Reader) CanCall() bool
- func (*Reader) CanIterate() bool
- func (o *Reader) Close() error
- func (o *Reader) Equal(right Object) bool
- func (o *Reader) GetMember(idxA string) Object
- func (o *Reader) GetValue() Object
- func (o *Reader) HasMemeber() bool
- func (o *Reader) IndexGet(index Object) (Object, error)
- func (o *Reader) IndexSet(index, value Object) error
- func (o *Reader) IsFalsy() bool
- func (o *Reader) Iterate() Iterator
- func (o *Reader) Read(p []byte) (n int, err error)
- func (o *Reader) SetMember(idxA string, valueA Object) error
- func (o *Reader) String() string
- func (*Reader) TypeCode() int
- func (*Reader) TypeName() string
- type RuntimeError
- func (o *RuntimeError) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*RuntimeError) Call(_ ...Object) (Object, error)
- func (o *RuntimeError) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*RuntimeError) CanCall() bool
- func (*RuntimeError) CanIterate() bool
- func (o *RuntimeError) Copy() Object
- func (o *RuntimeError) Equal(right Object) bool
- func (o *RuntimeError) Error() string
- func (o *RuntimeError) Format(s fmt.State, verb rune)
- func (o *RuntimeError) GetMember(idxA string) Object
- func (o *RuntimeError) GetValue() Object
- func (o *RuntimeError) HasMemeber() bool
- func (o *RuntimeError) IndexGet(index Object) (Object, error)
- func (o *RuntimeError) IndexSet(index, value Object) error
- func (o *RuntimeError) IsFalsy() bool
- func (*RuntimeError) Iterate() Iterator
- func (o *RuntimeError) NewError(messages ...string) *RuntimeError
- func (o *RuntimeError) SetMember(idxA string, valueA Object) error
- func (o *RuntimeError) StackTrace() StackTrace
- func (o *RuntimeError) String() string
- func (*RuntimeError) TypeCode() int
- func (*RuntimeError) TypeName() string
- func (o *RuntimeError) Unwrap() error
- type Seq
- func (o *Seq) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Seq) Call(_ ...Object) (Object, error)
- func (o *Seq) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Seq) CanCall() bool
- func (*Seq) CanIterate() bool
- func (o *Seq) Equal(right Object) bool
- func (o *Seq) GetMember(idxA string) Object
- func (o *Seq) GetValue() Object
- func (o *Seq) HasMemeber() bool
- func (o *Seq) IndexGet(index Object) (Object, error)
- func (o *Seq) IndexSet(index, value Object) error
- func (o *Seq) IsFalsy() bool
- func (o *Seq) Iterate() Iterator
- func (o *Seq) SetMember(idxA string, valueA Object) error
- func (o *Seq) SetValue(valueA Object) error
- func (o *Seq) String() string
- func (*Seq) TypeCode() int
- func (*Seq) TypeName() string
- type SimpleOptimizer
- type SourceModule
- type Stack
- func (o *Stack) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*Stack) Call(...Object) (Object, error)
- func (o *Stack) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*Stack) CanCall() bool
- func (*Stack) CanIterate() bool
- func (o *Stack) Equal(right Object) bool
- func (o *Stack) GetMember(idxA string) Object
- func (o *Stack) GetValue() Object
- func (o *Stack) HasMemeber() bool
- func (o *Stack) IndexGet(index Object) (Object, error)
- func (o *Stack) IndexSet(index, value Object) error
- func (o *Stack) IsFalsy() bool
- func (o *Stack) Iterate() Iterator
- func (o *Stack) Len() int
- func (o *Stack) Queue(right Object) bool
- func (o *Stack) SetMember(idxA string, valueA Object) error
- func (o *Stack) String() string
- func (*Stack) TypeCode() int
- func (*Stack) TypeName() string
- type StackIterator
- type StackTrace
- type StatusResult
- func (o *StatusResult) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*StatusResult) Call(_ ...Object) (Object, error)
- func (o *StatusResult) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *StatusResult) Equal(right Object) bool
- func (o *StatusResult) GetMember(idxA string) Object
- func (o *StatusResult) GetValue() Object
- func (o *StatusResult) HasMemeber() bool
- func (o *StatusResult) IndexGet(index Object) (Object, error)
- func (o *StatusResult) IndexSet(key, value Object) error
- func (o *StatusResult) SetMember(idxA string, valueA Object) error
- func (o *StatusResult) String() string
- func (o *StatusResult) TypeCode() int
- func (o *StatusResult) TypeName() string
- type String
- func (o String) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o String) Call(_ ...Object) (Object, error)
- func (o String) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o String) CanCall() bool
- func (String) CanIterate() bool
- func (o String) Copy() Object
- func (o String) Equal(right Object) bool
- func (o String) Format(s fmt.State, verb rune)
- func (o String) GetMember(idxA string) Object
- func (o String) GetValue() Object
- func (o String) HasMemeber() bool
- func (o String) IndexGet(index Object) (Object, error)
- func (o String) IndexSet(index, value Object) error
- func (o String) IsFalsy() bool
- func (o String) Iterate() Iterator
- func (o String) Len() int
- func (o String) MarshalJSON() ([]byte, error)
- func (o String) SetMember(idxA string, valueA Object) error
- func (o String) String() string
- func (String) TypeCode() int
- func (String) TypeName() string
- type StringBuilder
- func (o *StringBuilder) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*StringBuilder) Call(_ ...Object) (Object, error)
- func (o *StringBuilder) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *StringBuilder) CallName(nameA string, c Call) (Object, error)
- func (*StringBuilder) CanCall() bool
- func (*StringBuilder) CanIterate() bool
- func (o *StringBuilder) Copy() Object
- func (o *StringBuilder) Equal(right Object) bool
- func (o *StringBuilder) GetMember(idxA string) Object
- func (o *StringBuilder) GetValue() Object
- func (o *StringBuilder) HasMemeber() bool
- func (o *StringBuilder) IndexGet(index Object) (value Object, err error)
- func (o *StringBuilder) IndexSet(index, value Object) error
- func (o *StringBuilder) IsFalsy() bool
- func (*StringBuilder) Iterate() Iterator
- func (o *StringBuilder) SetMember(idxA string, valueA Object) error
- func (o *StringBuilder) String() string
- func (o *StringBuilder) TypeCode() int
- func (o *StringBuilder) TypeName() string
- type StringIterator
- type Symbol
- type SymbolScope
- type SymbolTable
- func (st *SymbolTable) DefineGlobal(name string) (*Symbol, error)
- func (st *SymbolTable) DefineLocal(name string) (*Symbol, bool)
- func (st *SymbolTable) DisableBuiltin(names ...string) *SymbolTable
- func (st *SymbolTable) DisabledBuiltins() []string
- func (st *SymbolTable) EnableParams(v bool) *SymbolTable
- func (st *SymbolTable) Fork(block bool) *SymbolTable
- func (st *SymbolTable) FreeSymbols() []*Symbol
- func (st *SymbolTable) InBlock() bool
- func (st *SymbolTable) MaxSymbols() int
- func (st *SymbolTable) NextIndex() int
- func (st *SymbolTable) NumParams() int
- func (st *SymbolTable) Parent(skipBlock bool) *SymbolTable
- func (st *SymbolTable) Resolve(name string) (symbol *Symbol, ok bool)
- func (st *SymbolTable) SetParams(params ...string) error
- func (st *SymbolTable) ShadowedBuiltins() []string
- func (st *SymbolTable) Symbols() []*Symbol
- type SyncIterator
- type SyncMap
- func (o *SyncMap) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*SyncMap) Call(...Object) (Object, error)
- func (o *SyncMap) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (*SyncMap) CanCall() bool
- func (o *SyncMap) CanIterate() bool
- func (o *SyncMap) Copy() Object
- func (o *SyncMap) Equal(right Object) bool
- func (o *SyncMap) Get(index string) (value Object, exists bool)
- func (o *SyncMap) GetMember(idxA string) Object
- func (o *SyncMap) GetValue() Object
- func (o *SyncMap) HasMemeber() bool
- func (o *SyncMap) IndexDelete(key Object) error
- func (o *SyncMap) IndexGet(index Object) (Object, error)
- func (o *SyncMap) IndexSet(index, value Object) error
- func (o *SyncMap) IsFalsy() bool
- func (o *SyncMap) Iterate() Iterator
- func (o *SyncMap) Len() int
- func (o *SyncMap) Lock()
- func (o *SyncMap) RLock()
- func (o *SyncMap) RUnlock()
- func (o *SyncMap) SetMember(idxA string, valueA Object) error
- func (o *SyncMap) String() string
- func (*SyncMap) TypeCode() int
- func (*SyncMap) TypeName() string
- func (o *SyncMap) Unlock()
- type Time
- func (o *Time) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*Time) Call(args ...Object) (Object, error)
- func (o *Time) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Time) CallName(name string, c Call) (Object, error)
- func (*Time) CanCall() bool
- func (*Time) CanIterate() bool
- func (o *Time) Equal(right Object) bool
- func (o *Time) GetMember(idxA string) Object
- func (o *Time) GetValue() Object
- func (o *Time) HasMemeber() bool
- func (o *Time) IndexGet(index Object) (Object, error)
- func (o *Time) IndexSet(index, value Object) error
- func (o *Time) IsFalsy() bool
- func (*Time) Iterate() Iterator
- func (o *Time) MarshalBinary() ([]byte, error)
- func (o *Time) MarshalJSON() ([]byte, error)
- func (o *Time) SetMember(idxA string, valueA Object) error
- func (o *Time) String() string
- func (*Time) TypeCode() int
- func (*Time) TypeName() string
- func (o *Time) UnmarshalBinary(data []byte) error
- func (o *Time) UnmarshalJSON(data []byte) error
- type Uint
- func (o Uint) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o Uint) Call(_ ...Object) (Object, error)
- func (o Uint) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o Uint) CanCall() bool
- func (Uint) CanIterate() bool
- func (o Uint) Equal(right Object) bool
- func (o Uint) Format(s fmt.State, verb rune)
- func (o Uint) GetMember(idxA string) Object
- func (o Uint) GetValue() Object
- func (o Uint) HasMemeber() bool
- func (o Uint) IndexGet(index Object) (Object, error)
- func (Uint) IndexSet(index, value Object) error
- func (o Uint) IsFalsy() bool
- func (Uint) Iterate() Iterator
- func (o Uint) SetMember(idxA string, valueA Object) error
- func (o Uint) String() string
- func (Uint) TypeCode() int
- func (Uint) TypeName() string
- type UndefinedType
- func (o *UndefinedType) BinaryOp(tok token.Token, right Object) (Object, error)
- func (*UndefinedType) Call(_ ...Object) (Object, error)
- func (o *UndefinedType) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *UndefinedType) Equal(right Object) bool
- func (o *UndefinedType) GetMember(idxA string) Object
- func (o *UndefinedType) GetValue() Object
- func (o *UndefinedType) HasMemeber() bool
- func (*UndefinedType) IndexGet(key Object) (Object, error)
- func (*UndefinedType) IndexSet(key, value Object) error
- func (o *UndefinedType) SetMember(idxA string, valueA Object) error
- func (o *UndefinedType) String() string
- func (o *UndefinedType) TypeCode() int
- func (o *UndefinedType) TypeName() string
- type VM
- func (vm *VM) Abort()
- func (vm *VM) Aborted() bool
- func (vm *VM) Clear() *VM
- func (vm *VM) GetBytecode() *Bytecode
- func (vm *VM) GetBytecodeInfo() string
- func (vm *VM) GetCompilerOptions() *CompilerOptions
- func (vm *VM) GetCurFunc() Object
- func (vm *VM) GetCurInstr() Object
- func (vm *VM) GetGlobals() Object
- func (vm *VM) GetLocals(locals []Object) []Object
- func (vm *VM) GetLocalsQuick() []Object
- func (vm *VM) GetSrcPos() parser.Pos
- func (vm *VM) Run(globals Object, args ...Object) (Object, error)
- func (vm *VM) RunCompiledFunction(f *CompiledFunction, globals Object, args ...Object) (Object, error)
- func (vm *VM) SetBytecode(bc *Bytecode) *VM
- func (vm *VM) SetRecover(v bool) *VM
- type ValueSetter
- type Writer
- func (o *Writer) BinaryOp(tok token.Token, right Object) (Object, error)
- func (o *Writer) Call(_ ...Object) (Object, error)
- func (o *Writer) CallMethod(nameA string, argsA ...Object) (Object, error)
- func (o *Writer) CanCall() bool
- func (*Writer) CanIterate() bool
- func (o *Writer) Close() error
- func (o *Writer) Equal(right Object) bool
- func (o *Writer) GetMember(idxA string) Object
- func (o *Writer) GetValue() Object
- func (o *Writer) HasMemeber() bool
- func (o *Writer) IndexGet(index Object) (Object, error)
- func (o *Writer) IndexSet(index, value Object) error
- func (o *Writer) IsFalsy() bool
- func (o *Writer) Iterate() Iterator
- func (o *Writer) SetMember(idxA string, valueA Object) error
- func (o *Writer) String() string
- func (*Writer) TypeCode() int
- func (*Writer) TypeName() string
- func (o *Writer) Write(p []byte) (n int, err error)
Constants ¶
const ( // True represents a true value. True = Bool(true) // False represents a false value. False = Bool(false) )
const ( // AttrModuleName is a special attribute injected into modules to identify // the modules by name. AttrModuleName = "__module_name__" )
Variables ¶
var ( // DefaultCompilerOptions holds default Compiler options. DefaultCompilerOptions = CompilerOptions{ OptimizerMaxCycle: 100, OptimizeConst: true, OptimizeExpr: true, } // TraceCompilerOptions holds Compiler options to print trace output // to stdout for Parser, Optimizer, Compiler. TraceCompilerOptions = CompilerOptions{ Trace: os.Stdout, TraceParser: true, TraceCompiler: true, TraceOptimizer: true, OptimizerMaxCycle: 1<<8 - 1, OptimizeConst: true, OptimizeExpr: true, } )
var ( // ErrSymbolLimit represents a symbol limit error which is returned by // Compiler when number of local symbols exceeds the symbo limit for // a function that is 256. ErrSymbolLimit = &Error{ Name: "SymbolLimitError", Message: "number of local symbols exceeds the limit", } // ErrStackOverflow represents a stack overflow error. ErrStackOverflow = &Error{Name: "StackOverflowError"} // ErrVMAborted represents a VM aborted error. ErrVMAborted = &Error{Name: "VMAbortedError"} // ErrWrongNumArguments represents a wrong number of arguments error. ErrWrongNumArguments = &Error{Name: "WrongNumberOfArgumentsError"} // ErrInvalidOperator represents an error for invalid operator usage. ErrInvalidOperator = &Error{Name: "InvalidOperatorError"} // ErrIndexOutOfBounds represents an out of bounds index error. ErrIndexOutOfBounds = &Error{Name: "IndexOutOfBoundsError"} // ErrInvalidIndex represents an invalid index error. ErrInvalidIndex = &Error{Name: "InvalidIndexError"} // ErrNotIterable is an error where an Object is not iterable. ErrNotIterable = &Error{Name: "NotIterableError"} // ErrNotIndexable is an error where an Object is not indexable. ErrNotIndexable = &Error{Name: "NotIndexableError"} // ErrNotIndexAssignable is an error where an Object is not index assignable. ErrNotIndexAssignable = &Error{Name: "NotIndexAssignableError"} // ErrNotCallable is an error where Object is not callable. ErrNotCallable = &Error{Name: "NotCallableError"} // ErrNotImplemented is an error where an Object has not implemented a required method. ErrNotImplemented = &Error{Name: "NotImplementedError"} // ErrZeroDivision is an error where divisor is zero. ErrZeroDivision = &Error{Name: "ZeroDivisionError"} // ErrType represents a type error. ErrType = &Error{Name: "TypeError"} )
var BigFloatZero = big.NewFloat(0)
var BigIntZero = big.NewInt(0)
var BuiltinCharCodeFunc = builtinCharCodeFunc
var BuiltinObjects = [...]Object{}/* 481 elements not displayed */
BuiltinObjects is list of builtins, exported for REPL.
var BuiltinsMap = map[string]BuiltinType{}/* 535 elements not displayed */
BuiltinsMap is list of builtin types, exported for REPL.
var CodeTextG = ""
var DebugModeG = false
var ErrCommon = &Error{Name: "error"}
var OpcodeNames = [...]string{ OpNoOp: "NOOP", OpConstant: "CONSTANT", OpCall: "CALL", OpGetGlobal: "GETGLOBAL", OpSetGlobal: "SETGLOBAL", OpGetLocal: "GETLOCAL", OpSetLocal: "SETLOCAL", OpGetBuiltin: "GETBUILTIN", OpBinaryOp: "BINARYOP", OpUnary: "UNARY", OpEqual: "EQUAL", OpNotEqual: "NOTEQUAL", OpJump: "JUMP", OpJumpFalsy: "JUMPFALSY", OpAndJump: "ANDJUMP", OpOrJump: "ORJUMP", OpMap: "MAP", OpArray: "ARRAY", OpSliceIndex: "SLICEINDEX", OpGetIndex: "GETINDEX", OpSetIndex: "SETINDEX", OpNull: "NULL", OpPop: "POP", OpGetFree: "GETFREE", OpSetFree: "SETFREE", OpGetLocalPtr: "GETLOCALPTR", OpGetFreePtr: "GETFREEPTR", OpClosure: "CLOSURE", OpIterInit: "ITERINIT", OpIterNext: "ITERNEXT", OpIterKey: "ITERKEY", OpIterValue: "ITERVALUE", OpLoadModule: "LOADMODULE", OpStoreModule: "STOREMODULE", OpReturn: "RETURN", OpSetupTry: "SETUPTRY", OpSetupCatch: "SETUPCATCH", OpSetupFinally: "SETUPFINALLY", OpThrow: "THROW", OpFinalizer: "FINALIZER", OpDefineLocal: "DEFINELOCAL", OpTrue: "TRUE", OpFalse: "FALSE", OpCallName: "CALLNAME", }
OpcodeNames are string representation of opcodes.
var OpcodeOperands = [...][]int{ OpNoOp: {}, OpConstant: {2}, OpCall: {1, 1}, OpGetGlobal: {2}, OpSetGlobal: {2}, OpGetLocal: {1}, OpSetLocal: {1}, OpGetBuiltin: {2}, OpBinaryOp: {1}, OpUnary: {1}, OpEqual: {}, OpNotEqual: {}, OpJump: {2}, OpJumpFalsy: {2}, OpAndJump: {2}, OpOrJump: {2}, OpMap: {2}, OpArray: {2}, OpSliceIndex: {}, OpGetIndex: {1}, OpSetIndex: {}, OpNull: {}, OpPop: {}, OpGetFree: {1}, OpSetFree: {1}, OpGetLocalPtr: {1}, OpGetFreePtr: {1}, OpClosure: {2, 1}, OpIterInit: {}, OpIterNext: {}, OpIterKey: {}, OpIterValue: {}, OpLoadModule: {2, 2}, OpStoreModule: {2}, OpReturn: {1}, OpSetupTry: {2, 2}, OpSetupCatch: {}, OpSetupFinally: {}, OpThrow: {1}, OpFinalizer: {1}, OpDefineLocal: {1}, OpTrue: {}, OpFalse: {}, OpCallName: {1, 1}, }
OpcodeOperands is the number of operands.
var ( // PrintWriter is the default writer for printf and println builtins. PrintWriter io.Writer = os.Stdout )
var RandomGeneratorG *tk.RandomX = nil
var RegiCountG int = 30
var ServerModeG = false
var StatusResultFail = StatusResult{Status: "fail", Value: ""}
var StatusResultInvalid = StatusResult{Status: "", Value: ""}
var StatusResultSuccess = StatusResult{Status: "success", Value: ""}
var VerboseG = false
var VersionG = "1.7.9"
global vars
Functions ¶
func AnysToOriginal ¶
func AnysToOriginal(aryA []Object) []interface{}
func ConvertFromObject ¶
func ConvertFromObject(vA Object) interface{}
func DownloadStringFromSSH ¶
func FormatInstructions ¶
FormatInstructions returns string representation of bytecode instructions.
func FromStringObject ¶
func GetCfgString ¶
func GetSwitchFromObjects ¶
func IfSwitchExistsInObjects ¶
func IsUndefInternal ¶
func IterateInstructions ¶
func IterateInstructions(insts []byte, fn func(pos int, opcode Opcode, operands []int, offset int) bool)
IterateInstructions iterate instructions and call given function for each instruction. Note: Do not use operands slice in callback, it is reused for less allocation.
func MakeInstruction ¶
MakeInstruction returns a bytecode for an Opcode and the operands.
Provide "buf" slice which is a returning value to reduce allocation or nil to create new byte slice. This is implemented to reduce compilation allocation that resulted in -15% allocation, +2% speed in compiler. It takes ~8ns/op with zero allocation.
Returning error is required to identify bugs faster when VM and Opcodes are under heavy development.
Warning: Unknown Opcode causes panic!
func ObjectsToBytes ¶
func ObjectsToI ¶
func ObjectsToI(aryA []Object) []interface{}
func ObjectsToN ¶
func ObjectsToO ¶
func ObjectsToO(aryA []Object) []interface{}
func ObjectsToS ¶
func QuickCompile ¶
func QuickCompile(codeA string, compilerOptionsA ...*CompilerOptions) interface{}
func ReadOperands ¶
ReadOperands reads operands from the bytecode. Given operands slice is used to fill operands and is returned to allocate less.
func RunCharCode ¶
func RunScriptOnHttp ¶
func SetCfgString ¶
func ToFloatQuick ¶
func ToGoByteSlice ¶
ToGoByteSlice will try to convert an Object to Go byte slice.
func ToGoFloat64 ¶
ToGoFloat64 will try to convert a numeric, bool or string Object to Go float64 value.
func ToGoIntWithDefault ¶
func ToGoString ¶
ToGoString will try to convert an Object to Go string value.
func ToGoUint64 ¶
ToGoUint64 will try to convert a numeric, bool or string Object to Go uint64 value.
func ToIntQuick ¶
func ToInterface ¶
func ToInterface(o Object) (ret interface{})
ToInterface tries to convert an Object o to an interface{} value.
Types ¶
type Any ¶
type Any struct { ObjectImpl Value interface{} OriginalType string OriginalCode int Members map[string]Object `json:"-"` }
Any represents container object and implements the Object interfaces. Any is used to hold some data which is not an Object in Charlang, such as structured data from Golang function call
func (*Any) HasMemeber ¶
type Array ¶
type Array []Object
Array represents array of objects and implements Object interface.
func (Array) HasMemeber ¶
type ArrayIterator ¶
type ArrayIterator struct { V Array // contains filtered or unexported fields }
ArrayIterator represents an iterator for the array.
func (*ArrayIterator) Key ¶
func (it *ArrayIterator) Key() Object
Key implements Iterator interface.
func (*ArrayIterator) Next ¶
func (it *ArrayIterator) Next() bool
Next implements Iterator interface.
func (*ArrayIterator) Value ¶
func (it *ArrayIterator) Value() Object
Value implements Iterator interface.
type BigFloat ¶
BigFloat represents large signed float values and implements Object interface.
func (*BigFloat) CallMethod ¶
func (*BigFloat) CanIterate ¶
func (*BigFloat) HasMemeber ¶
type BigInt ¶
BigInt represents large signed integer values and implements Object interface.
func (*BigInt) CallMethod ¶
func (*BigInt) CanIterate ¶
func (*BigInt) HasMemeber ¶
type Bool ¶
type Bool bool
Bool represents boolean values and implements Object interface.
func (Bool) HasMemeber ¶
type BuiltinFunction ¶
type BuiltinFunction struct { ObjectImpl Name string Value func(args ...Object) (Object, error) ValueEx func(Call) (Object, error) Members map[string]Object `json:"-"` Methods map[string]*Function Remark string }
BuiltinFunction represents a builtin function object and implements Object interface.
func (*BuiltinFunction) Call ¶
func (o *BuiltinFunction) Call(args ...Object) (Object, error)
Call implements Object interface.
func (*BuiltinFunction) CallMethod ¶
func (o *BuiltinFunction) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*BuiltinFunction) CanCall ¶
func (*BuiltinFunction) CanCall() bool
CanCall implements Object interface.
func (*BuiltinFunction) Copy ¶
func (o *BuiltinFunction) Copy() Object
Copy implements Copier interface.
func (*BuiltinFunction) Equal ¶
func (o *BuiltinFunction) Equal(right Object) bool
Equal implements Object interface.
func (*BuiltinFunction) GetMember ¶
func (o *BuiltinFunction) GetMember(idxA string) Object
func (*BuiltinFunction) GetValue ¶
func (o *BuiltinFunction) GetValue() Object
func (*BuiltinFunction) HasMemeber ¶
func (o *BuiltinFunction) HasMemeber() bool
func (*BuiltinFunction) IsFalsy ¶
func (o *BuiltinFunction) IsFalsy() bool
IsFalsy implements Object interface.
func (*BuiltinFunction) SetMember ¶
func (o *BuiltinFunction) SetMember(idxA string, valueA Object) error
func (*BuiltinFunction) String ¶
func (o *BuiltinFunction) String() string
String implements Object interface.
func (*BuiltinFunction) TypeCode ¶
func (*BuiltinFunction) TypeCode() int
func (*BuiltinFunction) TypeName ¶
func (*BuiltinFunction) TypeName() string
TypeName implements Object interface.
type BuiltinModule ¶
BuiltinModule is an importable module that's written in Go.
func (*BuiltinModule) Import ¶
func (m *BuiltinModule) Import(moduleName string) (interface{}, error)
Import returns an immutable map for the module.
type BuiltinType ¶
type BuiltinType int
BuiltinType represents a builtin type
const ( BuiltinAppend BuiltinType = iota BuiltinReset BuiltinStatusToStr BuiltinStatusToMap BuiltinDocxToStrs BuiltinGuiServerCommand BuiltinGetMapItem BuiltinSetMapItem BuiltinSendMail BuiltinGetTextSimilarity BuiltinLeSshInfo BuiltinStack BuiltinQueue BuiltinMapArray BuiltinPlotClearConsole BuiltinPlotDataToStr BuiltinPlotDataToImage BuiltinPlotLoadFont BuiltinResizeImage BuiltinImageToAscii BuiltinLoadImageFromFile BuiltinSaveImageToFile BuiltinGetImageInfo BuiltinStrToRgba BuiltinEncodeImage BuiltinEncodeBytesInImage BuiltinDecodeBytesFromImage BuiltinDrawImageOnImage BuiltinDrawTextWrappedOnImage BuiltinGenQr BuiltinSaveImageToBytes BuiltinClose BuiltinRegSplit BuiltinReadCsv BuiltinExcelNew BuiltinExcelOpen BuiltinExcelOpenFile BuiltinExcelSaveAs BuiltinExcelWriteTo BuiltinExcelClose BuiltinExcelNewSheet BuiltinExcelReadAll BuiltinExcelGetSheetCount BuiltinExcelGetSheetList BuiltinExcelGetSheetName BuiltinExcelReadSheet BuiltinExcelReadCell BuiltinExcelWriteSheet BuiltinExcelWriteCell BuiltinWriteCsv BuiltinRemovePath BuiltinRemoveDir BuiltinGetInput BuiltinGetInputf BuiltinGetChar BuiltinSetStdin BuiltinSetStdout BuiltinSetStderr BuiltinGetPipe BuiltinRegCount BuiltinStrRepeat BuiltinRegMatch BuiltinRegContains BuiltinRegContainsIn BuiltinLePrint BuiltinLeFindLines BuiltinLeFind BuiltinLeFindAll BuiltinLeReplace BuiltinLeLoadFromSsh BuiltinLeSaveToSsh BuiltinLeRemoveLine BuiltinLeRemoveLines BuiltinLeInsertLine BuiltinLeAppendLine BuiltinLeGetLine BuiltinLeSetLine BuiltinLeSetLines BuiltinLeConvertToUtf8 BuiltinLeSort BuiltinLeViewAll BuiltinLeViewLine BuiltinLeViewLines BuiltinLeLoadFromUrl BuiltinLeLoadFromClip BuiltinLeSaveToClip BuiltinLeAppendFromFile BuiltinLeAppendToFile BuiltinLeLoadFromFile BuiltinLeSaveToFile BuiltinLeLoadFromStr BuiltinLeSaveToStr BuiltinLeGetList BuiltinLeAppendFromStr BuiltinLeClear BuiltinS3GetObjectBytes BuiltinS3GetObjectText BuiltinS3PutObject BuiltinS3GetObjectToFile BuiltinS3GetObjectReader BuiltinS3GetObjectUrl BuiltinS3GetObjectTags BuiltinS3GetObjectStat BuiltinS3StatObject BuiltinS3CopyObject BuiltinS3MoveObject BuiltinS3RemoveObject BuiltinS3ListObjects BuiltinAwsSign BuiltinNow BuiltinTimeToTick BuiltinFormatTime BuiltinTimeAddSecs BuiltinTimeAddDate BuiltinTimeBefore BuiltinGetNowTimeStamp BuiltinBase64Encode BuiltinBase64Decode BuiltinXmlGetNodeStr BuiltinStrXmlEncode BuiltinFromXml BuiltinFormatXml BuiltinMd5 BuiltinPostRequest BuiltinHttpRedirect BuiltinReader BuiltinWriter BuiltinFile BuiltinBytesBuffer BuiltinImage BuiltinLoadImageFromBytes BuiltinThumbImage BuiltinBytesStartsWith BuiltinBytesEndsWith BuiltinBytesContains BuiltinBytesIndex BuiltinIsEncrypted BuiltinEncryptData BuiltinDecryptData BuiltinEncryptStream BuiltinDecryptStream BuiltinSimpleEncode BuiltinSimpleDecode BuiltinToPinYin BuiltinKanjiToKana BuiltinKanaToRomaji BuiltinKanjiToRomaji BuiltinIsHttps BuiltinCopyFile BuiltinRenameFile BuiltinStrJoin BuiltinStrCount BuiltinStrPad BuiltinStrRuneLen BuiltinStrIn BuiltinStrGetLastComponent BuiltinEnsureMakeDirs BuiltinExtractFileDir BuiltinExtractFileName BuiltinCheckToken BuiltinGetOtpCode BuiltinCheckOtpCode BuiltinEncryptText BuiltinDecryptText BuiltinEncryptTextByTXTE BuiltinDecryptTextByTXTE BuiltinAesEncrypt BuiltinAesDecrypt BuiltinHtmlEncode BuiltinHtmlDecode BuiltinServeFile BuiltinGetFileInfo BuiltinGetFileAbs BuiltinGetFileRel BuiltinGetFileExt BuiltinGetMimeType BuiltinStartSocksServer BuiltinStartSocksClient BuiltinStartTransparentProxy BuiltinStartTransparentProxyEx BuiltinRenderMarkdown BuiltinReplaceHtmlByMap BuiltinProcessHtmlTemplate BuiltinIsDir BuiltinStrStartsWith BuiltinStrEndsWith BuiltinStrSplit BuiltinStrSplitN BuiltinGenToken BuiltinStrContains BuiltinStrContainsAny BuiltinStrContainsIn BuiltinStrIndex BuiltinGetNowStr BuiltinGetNowStrCompact BuiltinLock BuiltinUnlock BuiltinTryLock BuiltinRLock BuiltinRUnlock BuiltinTryRLock BuiltinToKMG BuiltinFloatToStr BuiltinGetFileList BuiltinMathAbs BuiltinMathSqrt BuiltinMathPow BuiltinMathExp BuiltinMathLog BuiltinMathLog10 BuiltinMathMin BuiltinMathMax BuiltinMathCeil BuiltinMathFloor BuiltinMathRound BuiltinFlexEval BuiltinAdjustFloat BuiltinBigInt BuiltinBigFloat BuiltinToOrderedMap BuiltinUnhex BuiltinHexToStr BuiltinBitNot BuiltinToUpper BuiltinToLower BuiltinSscanf BuiltinStrQuote BuiltinStrUnquote BuiltinStrToInt BuiltinStrToTime BuiltinDealStr BuiltinToInt BuiltinToBool BuiltinToBoolWithDefault BuiltinToFloat BuiltinToHex BuiltinCompareBytes BuiltinLoadBytes BuiltinLoadBytesFromFile BuiltinSaveBytes BuiltinOpenFile BuiltinCloseFile BuiltinCompressData BuiltinCompressStr BuiltinUncompressData BuiltinUncompressStr BuiltinUrlEncode BuiltinUrlEncode1 BuiltinUrlDecode BuiltinOrderedMap BuiltinExcel BuiltinArrayContains BuiltinSortArray // BuiltinSortByFunc BuiltinLimitStr BuiltinStrFindDiffPos BuiltinStrFindAllSub BuiltinRemoveItems BuiltinAppendList BuiltinGetRandomInt BuiltinGetRandomFloat BuiltinGetRandomStr BuiltinFormatSQLValue BuiltinDbClose BuiltinDbQuery BuiltinDbQueryOrdered BuiltinDbQueryRecs BuiltinDbQueryMap BuiltinDbQueryMapArray BuiltinDbQueryCount BuiltinDbQueryFloat BuiltinDbQueryString BuiltinDbExec BuiltinRemoveFile BuiltinFileExists BuiltinGenJSONResp BuiltinUrlExists BuiltinParseUrl BuiltinParseQuery BuiltinErrStrf BuiltinErrf BuiltinCharCode BuiltinEvalMachine BuiltinGel BuiltinDelegate BuiltinGetReqBody BuiltinGetReqHeader BuiltinWriteRespHeader BuiltinSetRespHeader BuiltinParseReqForm BuiltinParseReqFormEx BuiltinWriteResp BuiltinMux BuiltinMutex BuiltinHttpHandler BuiltinHttpReq BuiltinFatalf BuiltinSeq BuiltinIsNil BuiltinIsNilOrEmpty BuiltinIsNilOrErr BuiltinGetValue BuiltinSetValue BuiltinGetMember BuiltinSetMember BuiltinCallMethod BuiltinDumpVar BuiltinDebugInfo BuiltinMake BuiltinDatabase BuiltinStatusResult BuiltinUnref BuiltinSetValueByRef BuiltinGetWeb BuiltinGetWebBytes BuiltinGetWebBytesWithHeaders BuiltinGetWebRespBody BuiltinRegFindFirstGroups BuiltinReadAllStr BuiltinReadAllBytes BuiltinReadBytes BuiltinWriteStr BuiltinWriteBytes BuiltinWriteBytesAt BuiltinIoCopy BuiltinStrSplitLines BuiltinNew BuiltinStringBuilder BuiltinStrReplace BuiltinGetErrStrX BuiltinFtpList BuiltinFtpCreateDir BuiltinFtpSize BuiltinFtpUpload BuiltinFtpUploadFromReader BuiltinSshUpload BuiltinSshUploadBytes BuiltinSshDownload BuiltinSshRun BuiltinArchiveFilesToZip BuiltinGetOSName BuiltinGetOSArch BuiltinGetOSArgs BuiltinGetAppDir BuiltinGetCurDir BuiltinGetHomeDir BuiltinGetTempDir BuiltinChangeDir BuiltinLookPath BuiltinGetClipText BuiltinSetClipText BuiltinRegQuote BuiltinRegReplace BuiltinAny BuiltinTrim BuiltinStrTrim BuiltinStrTrimStart BuiltinStrTrimEnd BuiltinStrTrimLeft BuiltinStrTrimRight BuiltinRegFindFirst BuiltinRegFindAll BuiltinRegFindAllIndex BuiltinRegFindAllGroups BuiltinCheckErrX BuiltinCheckEmpty BuiltinLoadText BuiltinSaveText BuiltinAppendText BuiltinJoinPath BuiltinGetEnv BuiltinSetEnv BuiltinTypeOfAny BuiltinToStr BuiltinCallNamedFunc BuiltinCallInternalFunc BuiltinGetProcessVar BuiltinSetProcessVar BuiltinDeleteProcessVar BuiltinGetNamedValue BuiltinNewEx BuiltinCallMethodEx BuiltinToTime // BuiltinNewAny BuiltinTime BuiltinSleep BuiltinExit BuiltinSystemCmd BuiltinSystemCmdDetached BuiltinSystemStart BuiltinIsErrX BuiltinIsErrStr BuiltinToJSON BuiltinFromJSON BuiltinFormatJson BuiltinCompactJson BuiltinGetJsonNodeStr BuiltinGetJsonNodeStrs BuiltinStrsToJson BuiltinPlo BuiltinPlt BuiltinPlErr BuiltinGetParam BuiltinGetParams BuiltinGetSwitch BuiltinGetSwitches BuiltinGetIntSwitch BuiltinIfSwitchExists BuiltinTypeCode BuiltinTypeName BuiltinPl BuiltinPr BuiltinPrf BuiltinFprf BuiltinPlNow BuiltinPln BuiltinPlv BuiltinSpr BuiltinSpln BuiltinTestByText BuiltinTestByStartsWith BuiltinTestByEndsWith BuiltinTestByContains BuiltinTestByRegContains BuiltinTestByReg BuiltinGetSeq BuiltinMagic BuiltinGetUuid BuiltinPass BuiltinDelete BuiltinGetArrayItem BuiltinCopy BuiltinCopyBytes BuiltinRepeat BuiltinContains BuiltinLen BuiltinSort BuiltinSortReverse BuiltinError BuiltinBool BuiltinInt BuiltinUint BuiltinFloat BuiltinChar BuiltinByte BuiltinString BuiltinMutableString BuiltinBytes BuiltinBytesWithSize BuiltinBytesWithCap BuiltinChars BuiltinPrintf BuiltinPrintln BuiltinSprintf BuiltinGlobals BuiltinIsError BuiltinIsInt BuiltinIsUint BuiltinIsFloat BuiltinIsChar BuiltinIsByte BuiltinIsBool BuiltinIsString BuiltinIsBytes BuiltinIsChars BuiltinIsMap BuiltinIsSyncMap BuiltinIsArray BuiltinIsUndefined BuiltinIsFunction BuiltinIsCallable BuiltinIsIterable BuiltinWrongNumArgumentsError BuiltinInvalidOperatorError BuiltinIndexOutOfBoundsError BuiltinNotIterableError BuiltinNotIndexableError BuiltinNotIndexAssignableError BuiltinNotCallableError BuiltinNotImplementedError BuiltinZeroDivisionError BuiltinTypeError BuiltinMakeArray BuiltinCap )
Builtins
type Byte ¶
type Byte byte
func (Byte) HasMemeber ¶
type Bytecode ¶
type Bytecode struct { FileSet *parser.SourceFileSet Main *CompiledFunction Constants []Object NumModules int CompilerOptionsM *CompilerOptions }
Bytecode holds the compiled functions and constants.
func Compile ¶
func Compile(script []byte, opts *CompilerOptions) (*Bytecode, error)
Compile compiles given script to Bytecode.
type Bytes ¶
type Bytes []byte
Bytes represents byte slice and implements Object interface.
func (Bytes) HasMemeber ¶
type BytesBuffer ¶
type BytesBuffer struct { ObjectImpl Value *bytes.Buffer Members map[string]Object `json:"-"` }
func (*BytesBuffer) CallMethod ¶
func (o *BytesBuffer) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*BytesBuffer) CanCall ¶
func (*BytesBuffer) CanCall() bool
func (*BytesBuffer) CanIterate ¶
func (*BytesBuffer) CanIterate() bool
func (*BytesBuffer) Copy ¶
func (o *BytesBuffer) Copy() Object
func (*BytesBuffer) Equal ¶
func (o *BytesBuffer) Equal(right Object) bool
func (*BytesBuffer) GetMember ¶
func (o *BytesBuffer) GetMember(idxA string) Object
func (*BytesBuffer) GetValue ¶
func (o *BytesBuffer) GetValue() Object
func (*BytesBuffer) HasMemeber ¶
func (o *BytesBuffer) HasMemeber() bool
func (*BytesBuffer) IndexGet ¶
func (o *BytesBuffer) IndexGet(index Object) (value Object, err error)
func (*BytesBuffer) IndexSet ¶
func (o *BytesBuffer) IndexSet(index, value Object) error
func (*BytesBuffer) IsFalsy ¶
func (o *BytesBuffer) IsFalsy() bool
func (*BytesBuffer) Iterate ¶
func (*BytesBuffer) Iterate() Iterator
func (*BytesBuffer) String ¶
func (o *BytesBuffer) String() string
func (*BytesBuffer) TypeCode ¶
func (o *BytesBuffer) TypeCode() int
func (*BytesBuffer) TypeName ¶
func (o *BytesBuffer) TypeName() string
type BytesIterator ¶
type BytesIterator struct { V Bytes // contains filtered or unexported fields }
BytesIterator represents an iterator for the bytes.
func (*BytesIterator) Key ¶
func (it *BytesIterator) Key() Object
Key implements Iterator interface.
func (*BytesIterator) Next ¶
func (it *BytesIterator) Next() bool
Next implements Iterator interface.
func (*BytesIterator) Value ¶
func (it *BytesIterator) Value() Object
Value implements Iterator interface.
type Call ¶
Call is a struct to pass arguments to CallEx and CallName methods. It provides VM for various purposes.
Call struct intentionally does not provide access to normal and variadic arguments directly. Using Len() and Get() methods is preferred. It is safe to create Call with a nil VM as long as VM is not required by the callee.
func (*Call) CheckLen ¶
CheckLen checks the number of arguments and variadic arguments. If the number of arguments is not equal to n, it returns an error.
func (*Call) Get ¶
Get returns the nth argument. If n is greater than the number of arguments, it returns the nth variadic argument. If n is greater than the number of arguments and variadic arguments, it panics!
type CallableExFunc ¶
CallableExFunc is a function signature for a callable function that accepts a Call struct.
func FnAARAex ¶
func FnAARAex(fn func(interface{}) interface{}) CallableExFunc
func FnAARSex ¶
func FnAARSex(fn func(interface{}) string) CallableExFunc
func FnAARex ¶
func FnAARex(fn func(interface{})) CallableExFunc
func FnAAVaRAex ¶
func FnAAVaRAex(fn func(interface{}, ...interface{}) interface{}) CallableExFunc
func FnAAVaRSex ¶
func FnAAVaRSex(fn func(interface{}, ...interface{}) string) CallableExFunc
func FnADSSVaRAex ¶
func FnADSSVaRAex(fn func(*sql.DB, string, string, ...interface{}) interface{}) CallableExFunc
func FnADSVaRAex ¶
func FnADSVaRAex(fn func(*sql.DB, string, ...interface{}) interface{}) CallableExFunc
func FnAFRFex ¶
func FnAFRFex(fn func(float64) float64) CallableExFunc
func FnAFRSex ¶
func FnAFRSex(fn func(float64) string) CallableExFunc
func FnALbyLbyViRLLiex ¶
func FnALbyLbyViRLLiex(fn func([]byte, []byte, ...int) [][]int) CallableExFunc
func FnALbySREex ¶
func FnALbySREex(fn func([]byte, string) error) CallableExFunc
func FnALsRLsex ¶
func FnALsRLsex(fn func([]string) []string) CallableExFunc
func FnALsSViRIex ¶
func FnALsSViRIex(fn func([]string, string, ...int) int) CallableExFunc
func FnALyARBex ¶
func FnALyARBex(fn func([]byte, interface{}) bool) CallableExFunc
func FnALyARIex ¶
func FnALyARIex(fn func([]byte, interface{}) int) CallableExFunc
func FnALyRBex ¶
func FnALyRBex(fn func([]byte) bool) CallableExFunc
func FnALyVsRAex ¶
func FnALyVsRAex(fn func([]byte, ...string) interface{}) CallableExFunc
func FnALyVsRLyex ¶
func FnALyVsRLyex(fn func([]byte, ...string) []byte) CallableExFunc
func FnARAex ¶
func FnARAex(fn func() interface{}) CallableExFunc
func FnARIex ¶
func FnARIex(fn func() int) CallableExFunc
func FnARLsex ¶
func FnARLsex(fn func() []string) CallableExFunc
func FnARSWREex ¶
func FnARSex ¶
func FnARSex(fn func() string) CallableExFunc
func FnARTex ¶
func FnARTex(fn func() time.Time) CallableExFunc
func FnARex ¶
func FnARex(fn func()) CallableExFunc
func FnASARex ¶
func FnASARex(fn func(string, interface{})) CallableExFunc
func FnASIVsRSex ¶
func FnASIVsRSex(fn func(string, int, ...string) string) CallableExFunc
func FnASRAex ¶
func FnASRAex(fn func(string) interface{}) CallableExFunc
func FnASRBex ¶
func FnASRBex(fn func(string) bool) CallableExFunc
func FnASREex ¶
func FnASREex(fn func(string) error) CallableExFunc
func FnASRIex ¶
func FnASRIex(fn func(string) int) CallableExFunc
func FnASRLbyex ¶
func FnASRLbyex(fn func(string) []byte) CallableExFunc
func FnASRLsex ¶
func FnASRLsex(fn func(string) []string) CallableExFunc
func FnASRSex ¶
func FnASRSex(fn func(string) string) CallableExFunc
func FnASRex ¶
func FnASRex(fn func(string)) CallableExFunc
func FnASSAVaRAex ¶
func FnASSAVaRAex(fn func(string, string, interface{}, ...string) interface{}) CallableExFunc
func FnASSIRLsex ¶
func FnASSIRLsex(fn func(string, string, int) []string) CallableExFunc
func FnASSIRSex ¶
func FnASSIRSex(fn func(string, string, int) string) CallableExFunc
func FnASSRA2Iex ¶
func FnASSRA2Iex(fn func(string, string) [][]int) CallableExFunc
func FnASSRA2Nex ¶
func FnASSRA2Nex(fn func(string, string) [][]int) CallableExFunc
func FnASSRAex ¶
func FnASSRAex(fn func(string, string) interface{}) CallableExFunc
func FnASSRLlsex ¶
func FnASSRLlsex(fn func(string, string) [][]string) CallableExFunc
func FnASSRLsex ¶
func FnASSRLsex(fn func(string, string) []string) CallableExFunc
func FnASSRSEex ¶
func FnASSRSEex(fn func(string, string) (string, error)) CallableExFunc
func FnASSSRSex ¶
func FnASSSRSex(fn func(string, string, string) string) CallableExFunc
func FnASSSVsRSex ¶
func FnASSVIRFex ¶
func FnASSVIRFex(fn func(string, string, ...int) float64) CallableExFunc
func FnASSViRLsex ¶
func FnASSViRLsex(fn func(string, string, ...int) []string) CallableExFunc
func FnASSVsRBex ¶
func FnASSVsRBex(fn func(string, string, ...string) bool) CallableExFunc
func FnASSVsREex ¶
func FnASSVsREex(fn func(string, string, ...string) error) CallableExFunc
func FnASVaRAex ¶
func FnASVaRAex(fn func(string, ...interface{}) interface{}) CallableExFunc
func FnASVaREex ¶
func FnASVaREex(fn func(string, ...interface{}) error) CallableExFunc
func FnASVaRIEex ¶
func FnASVaRIEex(fn func(string, ...interface{}) (int, error)) CallableExFunc
like fmt.printf
func FnASVaRSex ¶
func FnASVaRSex(fn func(string, ...interface{}) string) CallableExFunc
func FnASVaRex ¶
func FnASVaRex(fn func(string, ...interface{})) CallableExFunc
func FnASViRAex ¶
func FnASViRAex(fn func(string, ...int) interface{}) CallableExFunc
func FnASViRIex ¶
func FnASViRIex(fn func(string, ...int) int) CallableExFunc
func FnASVsRAex ¶
func FnASVsRAex(fn func(string, ...string) interface{}) CallableExFunc
func FnASVsRBex ¶
func FnASVsRBex(fn func(string, ...string) bool) CallableExFunc
func FnASVsRLmssex ¶
func FnASVsRLmssex(fn func(string, ...string) []map[string]string) CallableExFunc
func FnASVsRSex ¶
func FnASVsRSex(fn func(string, ...string) string) CallableExFunc
func FnATIIIRTex ¶
func FnATVsRSex ¶
func FnATVsRSex(fn func(time.Time, ...string) string) CallableExFunc
func FnAVaRAex ¶
func FnAVaRAex(fn func(...interface{}) interface{}) CallableExFunc
func FnAVaRIEex ¶
func FnAVaRIEex(fn func(...interface{}) (int, error)) CallableExFunc
func FnAVaRSex ¶
func FnAVaRSex(fn func(...interface{}) string) CallableExFunc
func FnAVaRex ¶
func FnAVaRex(fn func(...interface{})) CallableExFunc
func FnAVsREex ¶
func FnAVsREex(fn func(...string) error) CallableExFunc
func FnAVsRSex ¶
func FnAVsRSex(fn func(...string) string) CallableExFunc
func FnAWSVaRIEex ¶
func FnAWtRdRI64Eex ¶
type CallableFunc ¶
CallableFunc is a function signature for a callable function.
func CallExAdapter ¶
func CallExAdapter(fn CallableExFunc) CallableFunc
func FnAAVaRA ¶
func FnAAVaRA(fn func(interface{}, ...interface{}) interface{}) CallableFunc
like tk.Compress
func FnAAVaRS ¶
func FnAAVaRS(fn func(interface{}, ...interface{}) string) CallableFunc
like tk.ErrStrf
func FnADSSVaRA ¶
func FnADSSVaRA(fn func(*sql.DB, string, string, ...interface{}) interface{}) CallableFunc
like sqltk.QueryDBMapX
func FnADSVaRA ¶
func FnADSVaRA(fn func(*sql.DB, string, ...interface{}) interface{}) CallableFunc
like sqltk.ExecDBX
func FnALbyLbyViRLLi ¶
func FnALbyLbyViRLLi(fn func([]byte, []byte, ...int) [][]int) CallableFunc
like tk.CompareBytes(func([]byte, []byte, ...int) [][]int)
func FnALbySRE ¶
func FnALbySRE(fn func([]byte, string) error) CallableFunc
like tk.SaveBytesToFileE(func(bytesA []byte, fileA string) error)
func FnALsSViRI ¶
func FnALsSViRI(fn func([]string, string, ...int) int) CallableFunc
like tk.GetSwitchWithDefaultIntValue
func FnALyARB ¶
func FnALyARB(fn func([]byte, interface{}) bool) CallableFunc
like tk.BytesStartsWith
func FnALyVsRA ¶
func FnALyVsRA(fn func([]byte, ...string) interface{}) CallableFunc
like tk.LoadImageFromBytes
func FnALyVsRLy ¶
func FnALyVsRLy(fn func([]byte, ...string) []byte) CallableFunc
like tk.EncryptDataByTXDEF
func FnASIVsRS ¶
func FnASIVsRS(fn func(string, int, ...string) string) CallableFunc
like tk.LimitString
func FnASRSE ¶
func FnASRSE(fn func(string) (string, error)) CallableFunc
like kanjikana.ConvertKanjiToRomaji
func FnASSAVaRA ¶
func FnASSAVaRA(fn func(string, string, interface{}, ...string) interface{}) CallableFunc
like tk.ProcessHtmlTemplate
func FnASSIRLs ¶
func FnASSIRLs(fn func(string, string, int) []string) CallableFunc
like tk.RegFindAllX
func FnASSIRS ¶
func FnASSIRS(fn func(string, string, int) string) CallableFunc
like tk.RegFindFirstX
func FnASSRA ¶
func FnASSRA(fn func(string, string) interface{}) CallableFunc
like tk.GetJSONNodeStrings
func FnASSRA2I ¶
func FnASSRA2I(fn func(string, string) [][]int) CallableFunc
like tk.FindSubStringAll
func FnASSRA2N ¶
func FnASSRA2N(fn func(string, string) [][]int) CallableFunc
like tk.RegFindAllIndexX
func FnASSRI ¶
func FnASSRI(fn func(string, string) int) CallableFunc
like tk.FindFirstDiffPosInStrs
func FnASSRLls ¶
func FnASSRLls(fn func(string, string) [][]string) CallableFunc
like tk.RegFindAllGroupsX
func FnASSRLs ¶
func FnASSRLs(fn func(string, string) []string) CallableFunc
like tk.RegFindFirstGroupsX
func FnASSRSE ¶
func FnASSRSE(fn func(string, string) (string, error)) CallableFunc
like filepath.Rel
func FnASSSRS ¶
func FnASSSRS(fn func(string, string, string) string) CallableFunc
like tk.RegReplaceX
func FnASSSVsRS ¶
like tk.GenerateToken
func FnASSVIRF ¶
func FnASSVIRF(fn func(string, string, ...int) float64) CallableFunc
like tk.GetTextSimilarity
func FnASSViRLs ¶
func FnASSViRLs(fn func(string, string, ...int) []string) CallableFunc
like tk.RegSplitX
func FnASSVsRB ¶
func FnASSVsRB(fn func(string, string, ...string) bool) CallableFunc
like tk.ValidateOtpCode
func FnASSVsRE ¶
func FnASSVsRE(fn func(string, string, ...string) error) CallableFunc
like tk.RenameFile
func FnASVaRA ¶
func FnASVaRA(fn func(string, ...interface{}) interface{}) CallableFunc
like tk.GetWeb
func FnASViRA ¶
func FnASViRA(fn func(string, ...int) interface{}) CallableFunc
like tk.LoadBytesFromFile
func FnASViRI ¶
func FnASViRI(fn func(string, ...int) int) CallableFunc
like tk.StrToIntWithDefaultValue
func FnASVsRLmss ¶
func FnASVsRLmss(fn func(string, ...string) []map[string]string) CallableFunc
like tk.GetFileList
func FnAWSVaRIE ¶
like fmt.Printf
func FnAWtRdRI64E ¶
like io.Copy
type Char ¶
type Char rune
Char represents a rune and implements Object interface.
func (Char) HasMemeber ¶
type CharCode ¶
type CharCode struct { ObjectImpl Source string Value *Bytecode CompilerOptions *CompilerOptions LastError string Members map[string]Object `json:"-"` }
CharCode object is used for represent thent io.Reader type value
func NewCharCode ¶
func NewCharCode(srcA string, optsA ...*CompilerOptions) *CharCode
func (*CharCode) CallMethod ¶
func (*CharCode) CanIterate ¶
func (*CharCode) HasMemeber ¶
type Chars ¶
type Chars []rune
Chars represents byte slice and implements Object interface.
func (Chars) HasMemeber ¶
type CharsIterator ¶
type CharsIterator struct { V Chars // contains filtered or unexported fields }
CharsIterator represents an iterator for the chars.
func (*CharsIterator) Key ¶
func (it *CharsIterator) Key() Object
Key implements Iterator interface.
func (*CharsIterator) Next ¶
func (it *CharsIterator) Next() bool
Next implements Iterator interface.
func (*CharsIterator) Value ¶
func (it *CharsIterator) Value() Object
Value implements Iterator interface.
type CompiledFunction ¶
type CompiledFunction struct { // number of parameters NumParams int // number of local variabls including parameters NumLocals>=NumParams NumLocals int Instructions []byte Variadic bool Free []*ObjectPtr // SourceMap holds the index of instruction and token's position. SourceMap map[int]int Members map[string]Object `json:"-"` }
CompiledFunction holds the constants and instructions to pass VM.
func (*CompiledFunction) Call ¶
func (*CompiledFunction) Call(...Object) (Object, error)
Call implements Object interface. CompiledFunction is not directly callable. You should use Invoker to call it with a Virtual Machine. Because of this, it always returns an error.
func (*CompiledFunction) CallMethod ¶
func (o *CompiledFunction) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*CompiledFunction) CanCall ¶
func (*CompiledFunction) CanCall() bool
CanCall implements Object interface.
func (*CompiledFunction) CanIterate ¶
func (*CompiledFunction) CanIterate() bool
CanIterate implements Object interface.
func (*CompiledFunction) Copy ¶
func (o *CompiledFunction) Copy() Object
Copy implements the Copier interface.
func (*CompiledFunction) Equal ¶
func (o *CompiledFunction) Equal(right Object) bool
Equal implements Object interface.
func (*CompiledFunction) Fprint ¶
func (o *CompiledFunction) Fprint(w io.Writer)
Fprint writes constants and instructions to given Writer in a human readable form.
func (*CompiledFunction) GetMember ¶
func (o *CompiledFunction) GetMember(idxA string) Object
func (*CompiledFunction) GetValue ¶
func (o *CompiledFunction) GetValue() Object
func (*CompiledFunction) HasMemeber ¶
func (o *CompiledFunction) HasMemeber() bool
func (*CompiledFunction) IndexGet ¶
func (o *CompiledFunction) IndexGet(index Object) (Object, error)
IndexGet represents string values and implements Object interface.
func (*CompiledFunction) IndexSet ¶
func (*CompiledFunction) IndexSet(index, value Object) error
IndexSet implements Object interface.
func (*CompiledFunction) IsFalsy ¶
func (o *CompiledFunction) IsFalsy() bool
IsFalsy implements Object interface.
func (*CompiledFunction) Iterate ¶
func (*CompiledFunction) Iterate() Iterator
Iterate implements Object interface.
func (*CompiledFunction) SetMember ¶
func (o *CompiledFunction) SetMember(idxA string, valueA Object) error
func (*CompiledFunction) SourcePos ¶
func (o *CompiledFunction) SourcePos(ip int) parser.Pos
SourcePos returns the source position of the instruction at ip.
func (*CompiledFunction) String ¶
func (o *CompiledFunction) String() string
func (*CompiledFunction) TypeCode ¶
func (*CompiledFunction) TypeCode() int
func (*CompiledFunction) TypeName ¶
func (*CompiledFunction) TypeName() string
TypeName implements Object interface
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler compiles the AST into a bytecode.
func NewCompiler ¶
func NewCompiler(file *parser.SourceFile, opts CompilerOptions) *Compiler
NewCompiler creates a new Compiler object.
func (*Compiler) SetGlobalSymbolsIndex ¶
func (c *Compiler) SetGlobalSymbolsIndex()
SetGlobalSymbolsIndex sets index of a global symbol. This is only required when a global symbol is defined in SymbolTable and provided to compiler. Otherwise, caller needs to append the constant to Constants, set the symbol index and provide it to the Compiler. This should be called before Compiler.Compile call.
type CompilerError ¶
type CompilerError struct { FileSet *parser.SourceFileSet Node parser.Node Err error }
CompilerError represents a compiler error.
func (*CompilerError) Error ¶
func (e *CompilerError) Error() string
func (*CompilerError) Unwrap ¶
func (e *CompilerError) Unwrap() error
type CompilerOptions ¶
type CompilerOptions struct { ModuleMap *ModuleMap ModulePath string Constants []Object SymbolTable *SymbolTable Trace io.Writer TraceParser bool TraceCompiler bool TraceOptimizer bool OptimizerMaxCycle int OptimizeConst bool OptimizeExpr bool // contains filtered or unexported fields }
CompilerOptions represents customizable options for Compile().
var MainCompilerOptions *CompilerOptions = nil
type Copier ¶
type Copier interface {
Copy() Object
}
Copier wraps the Copy method to create a deep copy of the object.
type Database ¶
type Database struct { ObjectImpl Value *sql.DB DBType string DBConnectString string Members map[string]Object `json:"-"` Methods map[string]*Function `json:"-"` }
func (*Database) CallMethod ¶
func (*Database) CanIterate ¶
func (*Database) HasMemeber ¶
type Delegate ¶
type Delegate struct { // ObjectImpl Code *CharCode Value tk.QuickVarDelegate Members map[string]Object `json:"-"` }
Delegate represents an function caller and implements Object interface.
func (*Delegate) CallMethod ¶
func (*Delegate) CanIterate ¶
func (*Delegate) HasMemeber ¶
type Error ¶
Error represents Error Object and implements error and Object interfaces.
func NewArgumentTypeError ¶
NewArgumentTypeError creates a new Error from ErrType.
func NewCommonError ¶
func NewCommonErrorWithPos ¶
func NewFromError ¶
func NewIndexTypeError ¶
NewIndexTypeError creates a new Error from ErrType.
func NewIndexValueTypeError ¶
NewIndexValueTypeError creates a new Error from ErrType.
func NewOperandTypeError ¶
NewOperandTypeError creates a new Error from ErrType.
func (*Error) CallMethod ¶
func (*Error) HasMemeber ¶
type Eval ¶
type Eval struct { Locals []Object Globals Object Opts CompilerOptions VM *VM ModulesCache []Object }
Eval compiles and runs scripts within same scope. If executed script's return statement has no value to return or return is omitted, it returns last value on stack. Warning: Eval is not safe to use concurrently.
func NewEval ¶
func NewEval(opts CompilerOptions, globals Object, args ...Object) *Eval
NewEval returns new Eval object.
func NewEvalQuick ¶
func NewEvalQuick(globalsA map[string]interface{}, optsA *CompilerOptions, localsA ...Object) *Eval
type EvalMachine ¶
EvalMachine represents an Charlang Virtual Machine could run script once or more
func (*EvalMachine) CallMethod ¶
func (o *EvalMachine) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*EvalMachine) CanCall ¶
func (o *EvalMachine) CanCall() bool
func (*EvalMachine) CanIterate ¶
func (*EvalMachine) CanIterate() bool
func (*EvalMachine) Equal ¶
func (o *EvalMachine) Equal(right Object) bool
func (*EvalMachine) GetMember ¶
func (o *EvalMachine) GetMember(idxA string) Object
func (*EvalMachine) GetValue ¶
func (o *EvalMachine) GetValue() Object
func (*EvalMachine) HasMemeber ¶
func (o *EvalMachine) HasMemeber() bool
func (*EvalMachine) IndexSet ¶
func (o *EvalMachine) IndexSet(index, value Object) error
func (*EvalMachine) IsFalsy ¶
func (o *EvalMachine) IsFalsy() bool
func (*EvalMachine) Iterate ¶
func (*EvalMachine) Iterate() Iterator
func (*EvalMachine) SetValue ¶
func (o *EvalMachine) SetValue(valueA Object) error
func (*EvalMachine) String ¶
func (o *EvalMachine) String() string
func (*EvalMachine) TypeCode ¶
func (*EvalMachine) TypeCode() int
func (*EvalMachine) TypeName ¶
func (*EvalMachine) TypeName() string
type ExCallerObject ¶
ExCallerObject is an interface for objects that can be called with CallEx method. It is an extended version of the Call method that can be used to call an object with a Call struct. Objects implementing this interface is called with CallEx method instead of Call method. Note that CanCall() should return true for objects implementing this interface.
type Excel ¶
Excel represents an Excel(or compatible) file and implements Object interface.
func (*Excel) CallMethod ¶
func (*Excel) CanIterate ¶
func (*Excel) HasMemeber ¶
type ExtImporter ¶
type ExtImporter interface { Importable // Get returns Extimporter instance which will import a module. Get(moduleName string) ExtImporter // Name returns the full name of the module e.g. absoule path of a file. // Import names are generally relative, this overwrites module name and used // as unique key for compiler module cache. Name() string // Fork returns an ExtImporter instance which will be used to import the // modules. Fork will get the result of Name() if it is not empty, otherwise // module name will be same with the Get call. Fork(moduleName string) ExtImporter }
ExtImporter wraps methods for a module which will be imported dynamically like a file.
type File ¶
type File struct { ObjectImpl Value *os.File Members map[string]Object `json:"-"` }
File object is used for represent os.File type value
func (*File) CanIterate ¶
func (*File) HasMemeber ¶
type Float ¶
type Float float64
Float represents float values and implements Object interface.
func (Float) HasMemeber ¶
type Function ¶
type Function struct { ObjectImpl Name string Value func(args ...Object) (Object, error) ValueEx func(Call) (Object, error) Members map[string]Object `json:"-"` }
Function represents a function object and implements Object interface.
func (*Function) CallMethod ¶
func (*Function) HasMemeber ¶
type Gel ¶
type Gel struct { ObjectImpl // Source string Value *CharCode Members map[string]Object `json:"-"` }
Gel object is like modules based on CharCode object
func (*Gel) CanIterate ¶
func (*Gel) HasMemeber ¶
type GlobalContext ¶
type GlobalContext struct { SyncMap tk.SyncMap SyncQueue tk.SyncQueue SyncStack tk.SyncStack SyncSeq tk.Seq Vars map[string]interface{} Regs []interface{} VerboseLevel int }
var GlobalsG *GlobalContext
type HttpHandler ¶
type HttpHandler struct { // ObjectImpl Value func(http.ResponseWriter, *http.Request) Members map[string]Object `json:"-"` }
HttpHandler object is used to represent the http response
func (*HttpHandler) CallMethod ¶
func (o *HttpHandler) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*HttpHandler) CanCall ¶
func (o *HttpHandler) CanCall() bool
func (*HttpHandler) CanIterate ¶
func (*HttpHandler) CanIterate() bool
func (*HttpHandler) Equal ¶
func (o *HttpHandler) Equal(right Object) bool
func (*HttpHandler) GetMember ¶
func (o *HttpHandler) GetMember(idxA string) Object
func (*HttpHandler) GetValue ¶
func (o *HttpHandler) GetValue() Object
func (*HttpHandler) HasMemeber ¶
func (o *HttpHandler) HasMemeber() bool
func (*HttpHandler) IndexSet ¶
func (o *HttpHandler) IndexSet(index, value Object) error
func (*HttpHandler) IsFalsy ¶
func (o *HttpHandler) IsFalsy() bool
func (*HttpHandler) Iterate ¶
func (o *HttpHandler) Iterate() Iterator
func (*HttpHandler) String ¶
func (o *HttpHandler) String() string
func (*HttpHandler) TypeCode ¶
func (*HttpHandler) TypeCode() int
func (*HttpHandler) TypeName ¶
func (*HttpHandler) TypeName() string
TypeName implements Object interface.
type HttpReq ¶
type HttpReq struct { ObjectImpl Value *http.Request Members map[string]Object `json:"-"` }
HttpReq object is used to represent the http request
func (*HttpReq) CallMethod ¶
func (*HttpReq) CanIterate ¶
func (*HttpReq) HasMemeber ¶
type HttpResp ¶
type HttpResp struct { ObjectImpl Value http.ResponseWriter Members map[string]Object `json:"-"` }
HttpResp object is used to represent the http response
func (*HttpResp) CallMethod ¶
func (*HttpResp) CanIterate ¶
func (*HttpResp) HasMemeber ¶
type Image ¶
Image represents an image and implements Object interface.
func (*Image) CallMethod ¶
func (*Image) CanIterate ¶
func (*Image) HasMemeber ¶
type Importable ¶
type Importable interface { // Import should return either an Object or module source code ([]byte). Import(moduleName string) (interface{}, error) }
Importable interface represents importable module instance.
type IndexDeleter ¶
IndexDeleter wraps the IndexDelete method to delete an index of an object.
type Int ¶
type Int int64
Int represents signed integer values and implements Object interface.
func ToIntObject ¶
func (Int) HasMemeber ¶
type IntIterator ¶
type IntIterator struct { V Int // contains filtered or unexported fields }
IntIterator represents an iterator for the Int.
func (*IntIterator) Value ¶
func (it *IntIterator) Value() Object
Value implements Iterator interface.
type Invoker ¶
type Invoker struct {
// contains filtered or unexported fields
}
Invoker invokes a given callee object (either a CompiledFunction or any other callable object) with the given arguments.
Invoker creates a new VM instance if the callee is a CompiledFunction, otherwise it runs the callee directly. Every Invoker call checks if the VM is aborted. If it is, it returns ErrVMAborted.
Invoker is not safe for concurrent use by multiple goroutines.
Acquire and Release methods are used to acquire and release a VM from the pool. So it is possible to reuse a VM instance for multiple Invoke calls. This is useful when you want to execute multiple functions in a single VM. For example, you can use Acquire and Release to execute multiple functions in a single VM instance. Note that you should call Release after Acquire, if you want to reuse the VM. If you don't want to use the pool, you can just call Invoke method. It is unsafe to hold a reference to the VM after Release is called. Using VM pool is about three times faster than creating a new VM for each Invoke call.
func NewInvoker ¶
NewInvoker creates a new Invoker object.
type Iterator ¶
type Iterator interface { // Next returns true if there are more elements to iterate. Next() bool // Key returns the key or index value of the current element. Key() Object // Value returns the value of the current element. Value() Object }
Iterator wraps the methods required to iterate Objects in VM.
type LengthGetter ¶
type LengthGetter interface {
Len() int
}
LengthGetter wraps the Len method to get the number of elements of an object.
type Location ¶
type Location struct { ObjectImpl Value *time.Location Members map[string]Object `json:"-"` }
Location represents location values and implements Object interface.
func ToLocation ¶
ToLocation will try to convert given Object to *Location value.
func (*Location) CallMethod ¶
func (*Location) HasMemeber ¶
type Map ¶
Map represents map of objects and implements Object interface.
func NewBaseEnv ¶
func (Map) HasMemeber ¶
func (Map) IndexDelete ¶
IndexDelete tries to delete the string value of key from the map. IndexDelete implements IndexDeleter interface.
type MapArray ¶
type MapArray struct {
Value *tk.SimpleFlexObject
}
MapArray represents an SimpleFlexObject which is an array with some items have keys
func (*MapArray) CallMethod ¶
func (*MapArray) CanIterate ¶
func (*MapArray) HasMemeber ¶
type MapArrayIterator ¶
type MapArrayIterator struct { V *MapArray // contains filtered or unexported fields }
MapArrayIterator represents an iterator for the array.
func (*MapArrayIterator) Key ¶
func (it *MapArrayIterator) Key() Object
Key implements Iterator interface.
func (*MapArrayIterator) Next ¶
func (it *MapArrayIterator) Next() bool
Next implements Iterator interface.
func (*MapArrayIterator) Value ¶
func (it *MapArrayIterator) Value() Object
Value implements Iterator interface.
type MapIterator ¶
type MapIterator struct { V Map // contains filtered or unexported fields }
MapIterator represents an iterator for the map.
func (*MapIterator) Value ¶
func (it *MapIterator) Value() Object
Value implements Iterator interface.
type ModuleMap ¶
type ModuleMap struct {
// contains filtered or unexported fields
}
ModuleMap represents a set of named modules. Use NewModuleMap to create a new module map.
func (*ModuleMap) Add ¶
func (m *ModuleMap) Add(name string, module Importable) *ModuleMap
Add adds an importable module.
func (*ModuleMap) AddBuiltinModule ¶
AddBuiltinModule adds a builtin module.
func (*ModuleMap) AddSourceModule ¶
AddSourceModule adds a source module.
func (*ModuleMap) Fork ¶
Fork creates a new ModuleMap instance if ModuleMap has an ExtImporter to make ExtImporter preseve state.
func (*ModuleMap) Get ¶
func (m *ModuleMap) Get(name string) Importable
Get returns an import module identified by name. It returns nil if the name is not found.
func (*ModuleMap) SetExtImporter ¶
func (m *ModuleMap) SetExtImporter(im ExtImporter) *ModuleMap
SetExtImporter sets an ExtImporter to ModuleMap, which will be used to import modules dynamically.
type MutableString ¶
type MutableString struct { ObjectImpl Value string Members map[string]Object `json:"-"` }
MutableString represents string values and implements Object interface, compare to String, it supports setValue method.
func ToMutableStringObject ¶
func ToMutableStringObject(argA interface{}) *MutableString
func (*MutableString) Call ¶
func (o *MutableString) Call(_ ...Object) (Object, error)
Call implements Object interface.
func (*MutableString) CallMethod ¶
func (o *MutableString) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*MutableString) CanCall ¶
func (o *MutableString) CanCall() bool
CanCall implements Object interface.
func (*MutableString) CanIterate ¶
func (*MutableString) CanIterate() bool
CanIterate implements Object interface.
func (*MutableString) Equal ¶
func (o *MutableString) Equal(right Object) bool
Equal implements Object interface.
func (*MutableString) Format ¶
func (o *MutableString) Format(s fmt.State, verb rune)
Format implements fmt.Formatter interface.
func (*MutableString) GetMember ¶
func (o *MutableString) GetMember(idxA string) Object
func (*MutableString) GetValue ¶
func (o *MutableString) GetValue() Object
func (*MutableString) HasMemeber ¶
func (o *MutableString) HasMemeber() bool
func (*MutableString) IndexGet ¶
func (o *MutableString) IndexGet(index Object) (Object, error)
IndexGet represents string values and implements Object interface.
func (*MutableString) IndexSet ¶
func (o *MutableString) IndexSet(index, value Object) error
IndexSet implements Object interface.
func (*MutableString) IsFalsy ¶
func (o *MutableString) IsFalsy() bool
IsFalsy implements Object interface.
func (*MutableString) Iterate ¶
func (o *MutableString) Iterate() Iterator
Iterate implements Object interface.
func (*MutableString) Len ¶
func (o *MutableString) Len() int
Len implements LengthGetter interface.
func (*MutableString) MarshalJSON ¶
func (o *MutableString) MarshalJSON() ([]byte, error)
func (*MutableString) SetMember ¶
func (o *MutableString) SetMember(idxA string, valueA Object) error
func (*MutableString) SetValue ¶
func (o *MutableString) SetValue(valueA Object) error
func (*MutableString) String ¶
func (o *MutableString) String() string
func (*MutableString) TypeCode ¶
func (*MutableString) TypeCode() int
func (*MutableString) TypeName ¶
func (*MutableString) TypeName() string
TypeName implements Object interface.
type MutableStringIterator ¶
type MutableStringIterator struct { V *MutableString // contains filtered or unexported fields }
MutableStringIterator represents an iterator for the string.
func (*MutableStringIterator) Key ¶
func (it *MutableStringIterator) Key() Object
Key implements Iterator interface.
func (*MutableStringIterator) Next ¶
func (it *MutableStringIterator) Next() bool
Next implements Iterator interface.
func (*MutableStringIterator) Value ¶
func (it *MutableStringIterator) Value() Object
Value implements Iterator interface.
type Mutex ¶
type Mutex struct { ObjectImpl Value *(sync.RWMutex) Members map[string]Object `json:"-"` }
Mutex object is used for thread-safe actions note that the members set/get operations are not thread-safe
func (*Mutex) CallMethod ¶
func (*Mutex) CanIterate ¶
func (*Mutex) HasMemeber ¶
type Mux ¶
type Mux struct { ObjectImpl Value *http.ServeMux Members map[string]Object `json:"-"` }
Mux object is used for http handlers
func (*Mux) CanIterate ¶
func (*Mux) HasMemeber ¶
type NameCallerObject ¶
NameCallerObject is an interface for objects that can be called with CallName method to call a method of an object. Objects implementing this interface can reduce allocations by not creating a callable object for each method call.
type Object ¶
type Object interface { // TypeName should return the name of the type. TypeName() string // TypeCode should return the code of the type. TypeCode() int // String should return a string of the type's value. String() string // BinaryOp handles +,-,*,/,%,<<,>>,<=,>=,<,> operators. // Returned error stops VM execution if not handled with an error handler // and VM.Run returns the same error as wrapped. BinaryOp(tok token.Token, right Object) (Object, error) // IsFalsy returns true if value is falsy otherwise false. IsFalsy() bool // Equal checks equality of objects. Equal(right Object) bool // Call is called from VM if CanCall() returns true. Check the number of // arguments provided and their types in the method. Returned error stops VM // execution if not handled with an error handler and VM.Run returns the // same error as wrapped. Call(args ...Object) (Object, error) // CanCall returns true if type can be called with Call() method. // VM returns an error if one tries to call a noncallable object. CanCall() bool // Iterate should return an Iterator for the type. Iterate() Iterator // CanIterate should return whether the Object can be Iterated. CanIterate() bool // IndexGet should take an index Object and return a result Object or an // error for indexable objects. Indexable is an object that can take an // index and return an object. Returned error stops VM execution if not // handled with an error handler and VM.Run returns the same error as // wrapped. If Object is not indexable, ErrNotIndexable should be returned // as error. IndexGet(index Object) (value Object, err error) // IndexSet should take an index Object and a value Object for index // assignable objects. Index assignable is an object that can take an index // and a value on the left-hand side of the assignment statement. If Object // is not index assignable, ErrNotIndexAssignable should be returned as // error. Returned error stops VM execution if not handled with an error // handler and VM.Run returns the same error as wrapped. IndexSet(index, value Object) error GetValue() Object HasMemeber() bool GetMember(string) Object SetMember(string, Object) error CallMethod(string, ...Object) (Object, error) }
Object represents an object in the VM.
var ( // Undefined represents undefined value. Undefined Object = &UndefinedType{} )
func BuiltinDbCloseFunc ¶
func BuiltinDealStrFunc ¶
func BuiltinDelegateFunc ¶
func CallObjectMethodFunc ¶
func ConvertToObject ¶
func ConvertToObject(vA interface{}) Object
func GenStatusResult ¶
func NewBigFloat ¶
func NewBytesBuffer ¶
func NewDelegate ¶
func NewEvalMachine ¶
func NewExternalDelegate ¶
func NewExternalDelegate(funcA func(...interface{}) interface{}) Object
func NewHttpHandler ¶
func NewHttpReq ¶
func NewMapArray ¶
func NewOrderedMap ¶
func ToObjectAlt ¶
ToObjectAlt is analogous to ToObject but it will always convert signed integers to Int and unsigned integers to Uint. It is an alternative to ToObject. Note that, this function is subject to change in the future.
type ObjectImpl ¶
type ObjectImpl struct { }
ObjectImpl is the basic Object implementation and it does not nothing, and helps to implement Object interface by embedding and overriding methods in custom implementations. String and TypeName must be implemented otherwise calling these methods causes panic.
func (ObjectImpl) Call ¶
func (ObjectImpl) Call(_ ...Object) (Object, error)
Call implements Object interface.
func (ObjectImpl) CallMethod ¶
func (o ObjectImpl) CallMethod(nameA string, argsA ...Object) (Object, error)
func (ObjectImpl) CanIterate ¶
func (ObjectImpl) CanIterate() bool
CanIterate implements Object interface.
func (ObjectImpl) GetMember ¶
func (o ObjectImpl) GetMember(idxA string) Object
func (ObjectImpl) GetValue ¶
func (o ObjectImpl) GetValue() Object
func (ObjectImpl) HasMemeber ¶
func (o ObjectImpl) HasMemeber() bool
func (ObjectImpl) IndexGet ¶
func (o ObjectImpl) IndexGet(index Object) (value Object, err error)
IndexGet implements Object interface.
func (ObjectImpl) IndexSet ¶
func (o ObjectImpl) IndexSet(index, value Object) error
IndexSet implements Object interface.
func (ObjectImpl) Iterate ¶
func (ObjectImpl) Iterate() Iterator
Iterate implements Object interface.
func (ObjectImpl) TypeCode ¶
func (ObjectImpl) TypeCode() int
func (ObjectImpl) TypeName ¶
func (ObjectImpl) TypeName() string
TypeName implements Object interface.
type ObjectPtr ¶
type ObjectPtr struct { ObjectImpl Value *Object Members map[string]Object `json:"-"` }
ObjectPtr represents a pointer variable. this class is for internal use only, for common purpose, use ObjectRef instead
func (*ObjectPtr) CallMethod ¶
func (*ObjectPtr) HasMemeber ¶
type ObjectRef ¶
type ObjectRef struct { ObjectImpl Value *Object Members map[string]Object `json:"-"` }
ObjectRef represents a reference variable. always refer to an Object(i.e. *Object)
func (*ObjectRef) CallMethod ¶
func (*ObjectRef) HasMemeber ¶
type Opcode ¶
type Opcode = byte
Opcode represents a single byte operation code.
const ( OpNoOp Opcode = iota OpConstant OpCall OpGetGlobal OpSetGlobal OpGetLocal OpSetLocal OpGetBuiltin OpBinaryOp OpUnary OpEqual OpNotEqual OpJump OpJumpFalsy OpAndJump OpOrJump OpMap OpArray OpSliceIndex OpGetIndex OpSetIndex OpNull OpPop OpGetFree OpSetFree OpGetLocalPtr OpGetFreePtr OpClosure OpIterInit OpIterNext OpIterKey OpIterValue OpLoadModule OpStoreModule OpSetupTry OpSetupCatch OpSetupFinally OpThrow OpFinalizer OpReturn OpDefineLocal OpTrue OpFalse OpCallName )
List of opcodes
type OptimizerError ¶
type OptimizerError struct { FilePos parser.SourceFilePos Node parser.Node Err error }
OptimizerError represents an optimizer error.
func (*OptimizerError) Error ¶
func (e *OptimizerError) Error() string
func (*OptimizerError) Unwrap ¶
func (e *OptimizerError) Unwrap() error
type OrderedMap ¶
type OrderedMap struct { ObjectImpl Value *tk.OrderedMap }
OrderedMap represents map of objects but has order(in the order of push-in) and implements Object interface.
func (*OrderedMap) Call ¶
func (*OrderedMap) Call(...Object) (Object, error)
Call implements Object interface.
func (*OrderedMap) CallMethod ¶
func (o *OrderedMap) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*OrderedMap) CanIterate ¶
func (*OrderedMap) CanIterate() bool
CanIterate implements Object interface.
func (*OrderedMap) Equal ¶
func (o *OrderedMap) Equal(right Object) bool
Equal implements Object interface.
func (*OrderedMap) GetMember ¶
func (o *OrderedMap) GetMember(idxA string) Object
func (*OrderedMap) GetValue ¶
func (o *OrderedMap) GetValue() Object
func (*OrderedMap) HasMemeber ¶
func (o *OrderedMap) HasMemeber() bool
func (*OrderedMap) IndexDelete ¶
func (o *OrderedMap) IndexDelete(key Object) error
IndexDelete tries to delete the string value of key from the map. IndexDelete implements IndexDeleter interface.
func (*OrderedMap) IndexGet ¶
func (o *OrderedMap) IndexGet(index Object) (Object, error)
IndexGet implements Object interface.
func (*OrderedMap) IndexSet ¶
func (o *OrderedMap) IndexSet(index, value Object) error
IndexSet implements Object interface.
func (*OrderedMap) IsFalsy ¶
func (o *OrderedMap) IsFalsy() bool
IsFalsy implements Object interface.
func (*OrderedMap) Iterate ¶
func (o *OrderedMap) Iterate() Iterator
Iterate implements Iterable interface.
func (*OrderedMap) String ¶
func (o *OrderedMap) String() string
String implements Object interface.
func (*OrderedMap) TypeCode ¶
func (*OrderedMap) TypeCode() int
func (*OrderedMap) TypeName ¶
func (*OrderedMap) TypeName() string
TypeName implements Object interface.
type OrderedMapIterator ¶
type OrderedMapIterator struct { V *OrderedMap // contains filtered or unexported fields }
OrderedMapIterator represents an iterator for the map.
func (*OrderedMapIterator) Key ¶
func (it *OrderedMapIterator) Key() Object
Key implements Iterator interface.
func (*OrderedMapIterator) Next ¶
func (it *OrderedMapIterator) Next() bool
Next implements Iterator interface.
func (*OrderedMapIterator) Value ¶
func (it *OrderedMapIterator) Value() Object
Value implements Iterator interface.
type Queue ¶
type Queue struct { ObjectImpl Value *tk.AnyQueue Members map[string]Object `json:"-"` }
Queue represents a generic FIFO queue object and implements Object interface.
func (*Queue) CallMethod ¶
func (*Queue) HasMemeber ¶
type QueueIterator ¶
type QueueIterator struct { V *Queue // contains filtered or unexported fields }
QueueIterator represents an iterator for the Queue.
func (*QueueIterator) Key ¶
func (it *QueueIterator) Key() Object
Key implements Iterator interface.
func (*QueueIterator) Next ¶
func (it *QueueIterator) Next() bool
Next implements Iterator interface.
func (*QueueIterator) Value ¶
func (it *QueueIterator) Value() Object
Value implements Iterator interface.
type Reader ¶
type Reader struct { ObjectImpl Value io.Reader Members map[string]Object `json:"-"` }
Reader object is used for represent io.Reader type value
func (*Reader) CallMethod ¶
func (*Reader) CanIterate ¶
func (*Reader) HasMemeber ¶
type RuntimeError ¶
type RuntimeError struct { Err *Error Trace []parser.Pos Members map[string]Object `json:"-"` // contains filtered or unexported fields }
RuntimeError represents a runtime error that wraps Error and includes trace information.
func (*RuntimeError) Call ¶
func (*RuntimeError) Call(_ ...Object) (Object, error)
Call implements Object interface.
func (*RuntimeError) CallMethod ¶
func (o *RuntimeError) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*RuntimeError) CanCall ¶
func (*RuntimeError) CanCall() bool
CanCall implements Object interface.
func (*RuntimeError) CanIterate ¶
func (*RuntimeError) CanIterate() bool
CanIterate implements Object interface.
func (*RuntimeError) Equal ¶
func (o *RuntimeError) Equal(right Object) bool
Equal implements Object interface.
func (*RuntimeError) Error ¶
func (o *RuntimeError) Error() string
Error implements error interface.
func (*RuntimeError) Format ¶
func (o *RuntimeError) Format(s fmt.State, verb rune)
Format implements fmt.Formater interface.
func (*RuntimeError) GetMember ¶
func (o *RuntimeError) GetMember(idxA string) Object
func (*RuntimeError) GetValue ¶
func (o *RuntimeError) GetValue() Object
func (*RuntimeError) HasMemeber ¶
func (o *RuntimeError) HasMemeber() bool
func (*RuntimeError) IndexGet ¶
func (o *RuntimeError) IndexGet(index Object) (Object, error)
IndexGet implements Object interface.
func (*RuntimeError) IndexSet ¶
func (o *RuntimeError) IndexSet(index, value Object) error
IndexSet implements Object interface.
func (*RuntimeError) IsFalsy ¶
func (o *RuntimeError) IsFalsy() bool
IsFalsy implements Object interface.
func (*RuntimeError) Iterate ¶
func (*RuntimeError) Iterate() Iterator
Iterate implements Object interface.
func (*RuntimeError) NewError ¶
func (o *RuntimeError) NewError(messages ...string) *RuntimeError
NewError creates a new Error and sets original Error as its cause which can be unwrapped.
func (*RuntimeError) StackTrace ¶
func (o *RuntimeError) StackTrace() StackTrace
StackTrace returns stack trace if set otherwise returns nil.
func (*RuntimeError) String ¶
func (o *RuntimeError) String() string
String implements Object interface.
func (*RuntimeError) TypeCode ¶
func (*RuntimeError) TypeCode() int
func (*RuntimeError) TypeName ¶
func (*RuntimeError) TypeName() string
TypeName implements Object interface.
func (*RuntimeError) Unwrap ¶
func (o *RuntimeError) Unwrap() error
type Seq ¶
type Seq struct { ObjectImpl Value *(tk.Seq) Members map[string]Object `json:"-"` }
Seq object is used for generate unique sequence number(integer)
func (*Seq) CanIterate ¶
func (*Seq) HasMemeber ¶
type SimpleOptimizer ¶
type SimpleOptimizer struct {
// contains filtered or unexported fields
}
SimpleOptimizer optimizes given parsed file by evaluating constants and expressions. It is not safe to call methods concurrently.
func NewOptimizer ¶
func NewOptimizer( file *parser.File, base *SymbolTable, opts CompilerOptions, ) *SimpleOptimizer
NewOptimizer creates an Optimizer object.
func (*SimpleOptimizer) Optimize ¶
func (so *SimpleOptimizer) Optimize() error
Optimize optimizes ast tree by simple constant folding and evaluating simple expressions.
func (*SimpleOptimizer) Total ¶
func (so *SimpleOptimizer) Total() int
Total returns total number of evaluated constants and expressions.
type SourceModule ¶
type SourceModule struct {
Src []byte
}
SourceModule is an importable module that's written in Charlang.
func (*SourceModule) Import ¶
func (m *SourceModule) Import(_ string) (interface{}, error)
Import returns a module source code.
type Stack ¶
type Stack struct { ObjectImpl Value *tk.SimpleStack Members map[string]Object `json:"-"` }
Stack represents a generic stack object and implements Object interface.
func (*Stack) CallMethod ¶
func (*Stack) HasMemeber ¶
type StackIterator ¶
type StackIterator struct { V *Stack // contains filtered or unexported fields }
StackIterator represents an iterator for the Stack.
func (*StackIterator) Key ¶
func (it *StackIterator) Key() Object
Key implements Iterator interface.
func (*StackIterator) Next ¶
func (it *StackIterator) Next() bool
Next implements Iterator interface.
func (*StackIterator) Value ¶
func (it *StackIterator) Value() Object
Value implements Iterator interface.
type StackTrace ¶
type StackTrace []parser.SourceFilePos
StackTrace is the stack of source file positions.
type StatusResult ¶
type StatusResult struct { ObjectImpl Status string Value string Objects interface{} Members map[string]Object `json:"-"` Methods map[string]*Function `json:"-"` }
func (*StatusResult) CallMethod ¶
func (o *StatusResult) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*StatusResult) Equal ¶
func (o *StatusResult) Equal(right Object) bool
func (*StatusResult) GetMember ¶
func (o *StatusResult) GetMember(idxA string) Object
func (*StatusResult) GetValue ¶
func (o *StatusResult) GetValue() Object
func (*StatusResult) HasMemeber ¶
func (o *StatusResult) HasMemeber() bool
func (*StatusResult) IndexSet ¶
func (o *StatusResult) IndexSet(key, value Object) error
func (*StatusResult) String ¶
func (o *StatusResult) String() string
func (*StatusResult) TypeCode ¶
func (o *StatusResult) TypeCode() int
func (*StatusResult) TypeName ¶
func (o *StatusResult) TypeName() string
type String ¶
type String struct { ObjectImpl Value string Members map[string]Object `json:"-"` }
String represents string values and implements Object interface.
func ToStringObject ¶
func ToStringObject(argA interface{}) String
func (String) CallMethod ¶
func (String) HasMemeber ¶
func (String) MarshalJSON ¶
type StringBuilder ¶
type StringBuilder struct { ObjectImpl Value *strings.Builder Members map[string]Object `json:"-"` }
func (*StringBuilder) CallMethod ¶
func (o *StringBuilder) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*StringBuilder) CallName ¶
func (o *StringBuilder) CallName(nameA string, c Call) (Object, error)
func (*StringBuilder) CanCall ¶
func (*StringBuilder) CanCall() bool
func (*StringBuilder) CanIterate ¶
func (*StringBuilder) CanIterate() bool
func (*StringBuilder) Copy ¶
func (o *StringBuilder) Copy() Object
func (*StringBuilder) Equal ¶
func (o *StringBuilder) Equal(right Object) bool
func (*StringBuilder) GetMember ¶
func (o *StringBuilder) GetMember(idxA string) Object
func (*StringBuilder) GetValue ¶
func (o *StringBuilder) GetValue() Object
func (*StringBuilder) HasMemeber ¶
func (o *StringBuilder) HasMemeber() bool
func (*StringBuilder) IndexGet ¶
func (o *StringBuilder) IndexGet(index Object) (value Object, err error)
func (*StringBuilder) IndexSet ¶
func (o *StringBuilder) IndexSet(index, value Object) error
func (*StringBuilder) IsFalsy ¶
func (o *StringBuilder) IsFalsy() bool
func (*StringBuilder) Iterate ¶
func (*StringBuilder) Iterate() Iterator
func (*StringBuilder) SetMember ¶
func (o *StringBuilder) SetMember(idxA string, valueA Object) error
func (*StringBuilder) String ¶
func (o *StringBuilder) String() string
func (*StringBuilder) TypeCode ¶
func (o *StringBuilder) TypeCode() int
func (*StringBuilder) TypeName ¶
func (o *StringBuilder) TypeName() string
type StringIterator ¶
type StringIterator struct { V String // contains filtered or unexported fields }
StringIterator represents an iterator for the string.
func (*StringIterator) Key ¶
func (it *StringIterator) Key() Object
Key implements Iterator interface.
func (*StringIterator) Next ¶
func (it *StringIterator) Next() bool
Next implements Iterator interface.
func (*StringIterator) Value ¶
func (it *StringIterator) Value() Object
Value implements Iterator interface.
type Symbol ¶
type Symbol struct { Name string Index int Scope SymbolScope Assigned bool Constant bool Original *Symbol }
Symbol represents a symbol in the symbol table.
type SymbolScope ¶
type SymbolScope string
SymbolScope represents a symbol scope.
const ( ScopeGlobal SymbolScope = "GLOBAL" ScopeLocal SymbolScope = "LOCAL" ScopeBuiltin SymbolScope = "BUILTIN" ScopeFree SymbolScope = "FREE" )
List of symbol scopes
type SymbolTable ¶
type SymbolTable struct {
// contains filtered or unexported fields
}
SymbolTable represents a symbol table.
func NewSymbolTable ¶
func NewSymbolTable() *SymbolTable
NewSymbolTable creates new symbol table object.
func (*SymbolTable) DefineGlobal ¶
func (st *SymbolTable) DefineGlobal(name string) (*Symbol, error)
DefineGlobal adds a new symbol with ScopeGlobal in the current scope.
func (*SymbolTable) DefineLocal ¶
func (st *SymbolTable) DefineLocal(name string) (*Symbol, bool)
DefineLocal adds a new symbol with ScopeLocal in the current scope.
func (*SymbolTable) DisableBuiltin ¶
func (st *SymbolTable) DisableBuiltin(names ...string) *SymbolTable
DisableBuiltin disables given builtin name(s). Compiler returns `Compile Error: unresolved reference "builtin name"` if a disabled builtin is used.
func (*SymbolTable) DisabledBuiltins ¶
func (st *SymbolTable) DisabledBuiltins() []string
DisabledBuiltins returns disabled builtin names.
func (*SymbolTable) EnableParams ¶
func (st *SymbolTable) EnableParams(v bool) *SymbolTable
EnableParams enables or disables definition of parameters.
func (*SymbolTable) Fork ¶
func (st *SymbolTable) Fork(block bool) *SymbolTable
Fork creates a new symbol table for a new scope.
func (*SymbolTable) FreeSymbols ¶
func (st *SymbolTable) FreeSymbols() []*Symbol
FreeSymbols returns registered free symbols for the scope.
func (*SymbolTable) InBlock ¶
func (st *SymbolTable) InBlock() bool
InBlock returns true if symbol table belongs to a block.
func (*SymbolTable) MaxSymbols ¶
func (st *SymbolTable) MaxSymbols() int
MaxSymbols returns the total number of symbols defined in the scope.
func (*SymbolTable) NextIndex ¶
func (st *SymbolTable) NextIndex() int
NextIndex returns the next symbol index.
func (*SymbolTable) NumParams ¶
func (st *SymbolTable) NumParams() int
NumParams returns number of parameters for the scope.
func (*SymbolTable) Parent ¶
func (st *SymbolTable) Parent(skipBlock bool) *SymbolTable
Parent returns the outer scope of the current symbol table.
func (*SymbolTable) Resolve ¶
func (st *SymbolTable) Resolve(name string) (symbol *Symbol, ok bool)
Resolve resolves a symbol with a given name.
func (*SymbolTable) SetParams ¶
func (st *SymbolTable) SetParams(params ...string) error
SetParams sets parameters defined in the scope. This can be called only once.
func (*SymbolTable) ShadowedBuiltins ¶
func (st *SymbolTable) ShadowedBuiltins() []string
ShadowedBuiltins returns all shadowed builtin names including parent symbol tables'. Returing slice may contain duplicate names.
func (*SymbolTable) Symbols ¶
func (st *SymbolTable) Symbols() []*Symbol
Symbols returns registered symbols for the scope.
type SyncIterator ¶
type SyncIterator struct { Iterator // contains filtered or unexported fields }
SyncIterator represents an iterator for the SyncMap.
func (*SyncIterator) Value ¶
func (it *SyncIterator) Value() Object
Value implements Iterator interface.
type SyncMap ¶
type SyncMap struct { Value Map Members map[string]Object `json:"-"` // contains filtered or unexported fields }
SyncMap represents map of objects and implements Object interface.
func (*SyncMap) CallMethod ¶
func (*SyncMap) CanIterate ¶
CanIterate implements Object interface.
func (*SyncMap) HasMemeber ¶
func (*SyncMap) IndexDelete ¶
IndexDelete tries to delete the string value of key from the map.
func (*SyncMap) Len ¶
Len returns the number of items in the map. Len implements LengthGetter interface.
type Time ¶
Time represents time values and implements Object interface.
func (*Time) HasMemeber ¶
func (*Time) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler interface.
func (*Time) MarshalJSON ¶
MarshalJSON implements json.JSONMarshaler interface.
func (*Time) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler interface.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements json.JSONUnmarshaler interface.
type Uint ¶
type Uint uint64
Uint represents unsigned integer values and implements Object interface.
func (Uint) HasMemeber ¶
type UndefinedType ¶
type UndefinedType struct {
ObjectImpl
}
UndefinedType represents the type of global Undefined Object. One should use the UndefinedType in type switches only.
func (*UndefinedType) Call ¶
func (*UndefinedType) Call(_ ...Object) (Object, error)
Call implements Object interface.
func (*UndefinedType) CallMethod ¶
func (o *UndefinedType) CallMethod(nameA string, argsA ...Object) (Object, error)
func (*UndefinedType) Equal ¶
func (o *UndefinedType) Equal(right Object) bool
Equal implements Object interface.
func (*UndefinedType) GetMember ¶
func (o *UndefinedType) GetMember(idxA string) Object
func (*UndefinedType) GetValue ¶
func (o *UndefinedType) GetValue() Object
func (*UndefinedType) HasMemeber ¶
func (o *UndefinedType) HasMemeber() bool
func (*UndefinedType) IndexGet ¶
func (*UndefinedType) IndexGet(key Object) (Object, error)
IndexGet implements Object interface.
func (*UndefinedType) IndexSet ¶
func (*UndefinedType) IndexSet(key, value Object) error
IndexSet implements Object interface.
func (*UndefinedType) SetMember ¶
func (o *UndefinedType) SetMember(idxA string, valueA Object) error
func (*UndefinedType) String ¶
func (o *UndefinedType) String() string
String implements Object interface.
func (*UndefinedType) TypeCode ¶
func (o *UndefinedType) TypeCode() int
func (*UndefinedType) TypeName ¶
func (o *UndefinedType) TypeName() string
TypeName implements Object interface.
type VM ¶
type VM struct { LeBuf []string LeSshInfo map[string]string // contains filtered or unexported fields }
VM executes the instructions in Bytecode.
func (*VM) Abort ¶
func (vm *VM) Abort()
Abort aborts the VM execution. It is safe to call this method from another goroutine.
func (*VM) Aborted ¶
Aborted reports whether VM is aborted. It is safe to call this method from another goroutine.
func (*VM) GetBytecode ¶
func (*VM) GetBytecodeInfo ¶
func (*VM) GetCompilerOptions ¶
func (vm *VM) GetCompilerOptions() *CompilerOptions
func (*VM) GetCurFunc ¶
func (*VM) GetCurInstr ¶
func (*VM) GetLocals ¶
GetLocals returns variables from stack up to the NumLocals of given Bytecode. This must be called after Run() before Clear().
func (*VM) GetLocalsQuick ¶
func (*VM) RunCompiledFunction ¶
func (vm *VM) RunCompiledFunction( f *CompiledFunction, globals Object, args ...Object, ) (Object, error)
RunCompiledFunction runs given CompiledFunction as if it is Main function. Bytecode must be set before calling this method, because Fileset and Constants are copied.
func (*VM) SetBytecode ¶
SetBytecode enables to set a new Bytecode.
func (*VM) SetRecover ¶
SetRecover recovers panic when Run panics and returns panic as an error. If error handler is present `try-catch-finally`, VM continues to run from catch/finally.
type ValueSetter ¶
type Writer ¶
type Writer struct { ObjectImpl Value io.Writer Members map[string]Object `json:"-"` }
Writer object is used for represent io.Writer type value
func (*Writer) CallMethod ¶
func (*Writer) CanIterate ¶
func (*Writer) HasMemeber ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
char
Module
|
|
dll
module
|
|
internal
|
|
ex
Package ex provides ex module implementing some extra functions.
|
Package ex provides ex module implementing some extra functions. |
strings
Package strings provides strings module implementing simple functions to manipulate UTF-8 encoded strings for Charlang script language.
|
Package strings provides strings module implementing simple functions to manipulate UTF-8 encoded strings for Charlang script language. |
time
Package time provides time module for measuring and displaying time for Charlang script language.
|
Package time provides time module for measuring and displaying time for Charlang script language. |
test1
module
|
|