Ai
3 Star 0 Fork 0

mirrors_go-python/gpython

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vm.go 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
Nick Craig-Wood 提交于 2018-08-22 03:56 +08:00 . Add copyright headers to all files
// Copyright 2018 The go-python Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Python virtual machine
package vm
import (
"github.com/go-python/gpython/py"
)
//go:generate stringer -type=vmStatus,OpCode -output stringer.go
// VM status code
type vmStatus byte
// VM Status code for main loop (reason for stack unwind)
const (
whyNot vmStatus = iota // No error
whyException // Exception occurred
whyReturn // 'return' statement
whyBreak // 'break' statement
whyContinue // 'continue' statement
whyYield // 'yield' operator
whySilenced // Exception silenced by 'with'
)
// Virtual machine state
type Vm struct {
// Current frame
frame *py.Frame
// Whether ext should be added to the next arg
extended bool
// 16 bit extension for argument for next opcode
ext int32
// Return value
retval py.Object
// VM Status code for main loop
why vmStatus
// Current Pending exception type, value and traceback
curexc py.ExceptionInfo
// Previous exception type, value and traceback
exc py.ExceptionInfo
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_go-python/gpython.git
git@gitee.com:mirrors_go-python/gpython.git
mirrors_go-python
gpython
gpython
v0.0.2

搜索帮助