-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtypes.go
83 lines (73 loc) · 1.3 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package lua_debugger
import (
"github.com/edolphin-ydf/gopherlua-debugger/proto"
lua "github.com/yuin/gopher-lua"
)
const (
Lua_HookCall = iota
Lua_HookRet
Lua_HookLine
Lua_HookCount
)
const (
LUA_TNONE = iota - 1
LUA_TNIL
LUA_TBOOLEAN
LUA_TLIGHTUSERDATA
LUA_TNUMBER
LUA_TSTRING
LUA_TTABLE
LUA_TFUNCTION
LUA_TUSERDATA
LUA_TTHREAD
)
type Ar struct {
lua.Debug
Event int
}
type BreakPoint struct {
File string
Condition string
PathParts []string
Line int
}
type Variable struct {
Name string
NameType int
Value string
ValueType int
ValueTypeName string
Children []*Variable
CacheId int
}
func (v *Variable) toProto() *proto.Variable {
res := &proto.Variable{
Name: v.Name,
NameType: v.NameType,
Value: v.Value,
ValueType: v.ValueType,
ValueTypeName: v.ValueTypeName,
}
for _, c := range v.Children {
res.Children = append(res.Children, c.toProto())
}
return res
}
type Stack struct {
File string
FunctionName string
Level int
Line int
LocalVariables []*Variable
UpvalueVariables []*Variable
}
type EvalContext struct {
Expr string
Error string
Seq int
StackLevel int
Depth int
CacheId int
Result *Variable
Success bool
}