Documentation ¶
Index ¶
- Constants
- Variables
- func MinInt(a, b int) int
- func NewCodeReader(data []byte) *codeReader
- func PyArgs_Build(args ...PyObject)
- type Block
- type BlockStack
- type CodeFlags
- type Module
- type ModuleDict
- type ModuleFunc
- type PyArgs
- type PyBool
- type PyClass
- type PyCode
- type PyException
- type PyFrame
- type PyFunc
- type PyInt
- type PyList
- type PyModule
- type PyNone
- type PyObjStack
- type PyObject
- func NewPyBool(value bool) PyObject
- func NewPyCode(vm *VM) PyObject
- func NewPyException(name string) PyObject
- func NewPyFuncExternal(codeobj PyObject) PyObject
- func NewPyFuncInternal(module *Module, fn ModuleFunc, name *string) PyObject
- func NewPyInt(value int64) PyObject
- func NewPyList(items []PyObject) PyObject
- func NewPyModule(name *string) PyObject
- func NewPyNone() PyObject
- func NewPyString(value *string) PyObject
- func NewPyTuple(items []PyObject) PyObject
- type PyObjectData
- type PyString
- type PyTuple
- type Runtime
- type VM
Constants ¶
View Source
const ( CmpLT = iota CmpLTE CmpEQ CmpNE CmpGT CmpGTE CmpIN CmpNIN // not in CmpIS CmpISN // is not CmpEM // Exact match CmpBAD // Bad ???? )
View Source
const ( POP_TOP = 1 ROT_TWO = 2 BINARY_MULTIPLY = 20 BINARY_ADD = 23 BINARY_SUBTRACT = 24 BINARY_SUBSCR = 25 INPLACE_ADD = 55 INPLACE_MULTIPLY = 57 STORE_SUBSCR = 60 PRINT_ITEM = 71 PRINT_NEWLINE = 72 RETURN_VALUE = 83 POP_BLOCK = 87 STORE_NAME = 90 DELETE_NAME = 91 UNPACK_SEQUENCE = 92 FOR_ITER = 93 LOAD_CONST = 100 LOAD_NAME = 101 BUILD_TUPLE = 102 BUILD_LIST = 103 LOAD_ATTR = 106 COMPARE_OP = 107 IMPORT_NAME = 108 JUMP_ABSOLUTE = 113 POP_JUMP_IF_FALSE = 114 LOAD_GLOBAL = 116 SETUP_LOOP = 120 LOAD_FAST = 124 STORE_FAST = 125 CALL_FUNCTION = 131 MAKE_FUNCTION = 132 MAKE_CLOSURE = 134 LOAD_CLOSURE = 135 LOAD_DEREF = 136 STORE_DEREF = 137 )
View Source
const ( OpAdd = iota OpMultiply OpSubtract )
View Source
const ( PyFuncExternal = iota PyFuncInternal )
View Source
const HasArgLimes = 90
Variables ¶
View Source
var ModuleGopy = Module{ // contains filtered or unexported fields }
View Source
var ModuleTime = Module{ // contains filtered or unexported fields }
View Source
var Modules = map[string]Module{ "time": ModuleTime, "gopy": ModuleGopy, }
View Source
var PyAttributeError = NewPyException("AttributeError")
View Source
var PyBuiltInFuncMap = map[string]func(){}
View Source
var PyBuiltInTypeMap = map[string]PyObject{ "True": PyTrue, "False": PyFalse, }
View Source
var PyFalse = NewPyBool(false)
View Source
var PyIndexError = NewPyException("IndexError")
View Source
var PyNameError = NewPyException("NameError")
View Source
var PyNil = NewPyNone()
View Source
var PyTrue = NewPyBool(true)
View Source
var PyTypeError = NewPyException("TypeError")
Functions ¶
func NewCodeReader ¶
func NewCodeReader(data []byte) *codeReader
func PyArgs_Build ¶
func PyArgs_Build(args ...PyObject)
Types ¶
type BlockStack ¶
type BlockStack struct {
// contains filtered or unexported fields
}
func NewBlockStack ¶
func NewBlockStack(count uint64) *BlockStack
func (*BlockStack) Pop ¶
func (s *BlockStack) Pop() *Block
func (*BlockStack) Push ¶
func (s *BlockStack) Push(position, position2 int64)
type ModuleDict ¶
type ModuleDict map[string]ModuleFunc
type ModuleFunc ¶
type PyBool ¶
type PyBool struct { PyObjectData // contains filtered or unexported fields }
type PyClass ¶
type PyClass struct {
PyObjectData
}
type PyCode ¶
type PyCode struct { PyObjectData // contains filtered or unexported fields }
type PyException ¶
type PyException struct { PyObjectData // contains filtered or unexported fields }
type PyFunc ¶
type PyFunc struct { PyObjectData // contains filtered or unexported fields }
type PyInt ¶
type PyInt struct { PyObjectData // contains filtered or unexported fields }
type PyModule ¶
type PyModule struct { PyObjectData // contains filtered or unexported fields }
type PyNone ¶
type PyNone struct {
PyObjectData
}
type PyObjStack ¶
type PyObjStack struct {
// contains filtered or unexported fields
}
PyObjStack
func NewPyObjStack ¶
func NewPyObjStack(count uint64) *PyObjStack
func (*PyObjStack) Pop ¶
func (s *PyObjStack) Pop() PyObject
func (*PyObjStack) Push ¶
func (s *PyObjStack) Push(item PyObject)
type PyObject ¶
type PyObject interface {
// contains filtered or unexported methods
}
func NewPyException ¶
func NewPyFuncExternal ¶
func NewPyFuncInternal ¶
func NewPyFuncInternal(module *Module, fn ModuleFunc, name *string) PyObject
func NewPyModule ¶
func NewPyString ¶
func NewPyTuple ¶
type PyObjectData ¶
type PyObjectData struct {
// contains filtered or unexported fields
}
type PyString ¶
type PyString struct { PyObjectData // contains filtered or unexported fields }
type PyTuple ¶
type PyTuple struct { PyObjectData // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.