-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeclarations.go
77 lines (65 loc) · 1.88 KB
/
declarations.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
package klabels
type Analysis struct {
Labels []Label `json:"labels"`
Line int `json:"line"`
}
type Label struct {
Kind LabelKind `json:"kind"`
Data any `json:"data"`
Line int `json:"line"`
}
type FunctionDeclaration struct {
Name string `json:"name"`
Parameters []FunctionParameter `json:"parameters"`
Result []string `json:"result"`
}
type FunctionParameter struct {
Name string `json:"name"`
Type string `json:"type"`
}
type VariableDeclaration struct {
Name string `json:"name"`
Type *string `json:"type"`
Value *string `json:"value"`
Reassignment bool `json:"reassignment"`
}
type TypeDeclaration struct {
Name string `json:"name"`
Kind string `json:"kind"`
}
type FieldDeclaration struct {
Name string `json:"name"`
Type string `json:"type"`
Annotations string `json:"annotation"`
}
type ConstantDeclaration struct {
Name string `json:"name"`
Type string `json:"type"`
Value *string `json:"value"`
}
type PackageDeclaration struct {
Name string
}
type ReturnStatement struct {
Values []string
}
type LabelKind string
type TypeKind int
const (
FunctionKind LabelKind = "Function"
VariableKind = "Variable"
TypeDeclarationKind = "Type"
FieldDeclarationKind = "Field"
ConstDeclarationKind = "Const"
VarDeclarationKind = "Var"
UnknownKind = "Unknown"
CommentKind = "Comment"
PackageKind = "Package"
ReturnKind = "ReturnStatement"
ScopeBeginKind = "ScopeBegin"
ScopeEndKind = "ScopeEnd"
ConstScopeBeginKind = "ConstantScopeBegin"
VarScopeBeginKind = "VarScopeBegin"
ConstScopeEndKind = "ConstantScopeEnd"
VarScopeEndKind = "VarScopeEnd"
)