-
Notifications
You must be signed in to change notification settings - Fork 1
/
stmt.go
135 lines (112 loc) · 3.74 KB
/
stmt.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
package astp
import "go/ast"
// IsStmt reports whether a given ast.Node is a statement(ast.Stmt).
func IsStmt(node ast.Node) bool {
_, ok := node.(ast.Stmt)
return ok
}
// IsBadStmt reports whether a given ast.Node is a bad statement(*ast.BadStmt)
func IsBadStmt(node ast.Node) bool {
_, ok := node.(*ast.BadStmt)
return ok
}
// IsDeclStmt reports whether a given ast.Node is a declaration statement(*ast.DeclStmt)
func IsDeclStmt(node ast.Node) bool {
_, ok := node.(*ast.DeclStmt)
return ok
}
// IsEmptyStmt reports whether a given ast.Node is an empty statement(*ast.EmptyStmt)
func IsEmptyStmt(node ast.Node) bool {
_, ok := node.(*ast.EmptyStmt)
return ok
}
// IsLabeledStmt reports whether a given ast.Node is a label statement(*ast.LabeledStmt)
func IsLabeledStmt(node ast.Node) bool {
_, ok := node.(*ast.LabeledStmt)
return ok
}
// IsExprStmt reports whether a given ast.Node is an expression statement(*ast.ExprStmt)
func IsExprStmt(node ast.Node) bool {
_, ok := node.(*ast.ExprStmt)
return ok
}
// IsSendStmt reports whether a given ast.Node is a send to chan statement(*ast.SendStmt)
func IsSendStmt(node ast.Node) bool {
_, ok := node.(*ast.SendStmt)
return ok
}
// IsIncDecStmt reports whether a given ast.Node is a increment/decrement statement(*ast.IncDecStmt)
func IsIncDecStmt(node ast.Node) bool {
_, ok := node.(*ast.IncDecStmt)
return ok
}
// IsAssignStmt reports whether a given ast.Node is an assignment statement(*ast.AssignStmt)
func IsAssignStmt(node ast.Node) bool {
_, ok := node.(*ast.AssignStmt)
return ok
}
// IsGoStmt reports whether a given ast.Node is a go statement(*ast.GoStmt)
func IsGoStmt(node ast.Node) bool {
_, ok := node.(*ast.GoStmt)
return ok
}
// IsDeferStmt reports whether a given ast.Node is a defer statement(*ast.DeferStmt)
func IsDeferStmt(node ast.Node) bool {
_, ok := node.(*ast.DeferStmt)
return ok
}
// IsReturnStmt reports whether a given ast.Node is a return statement(*ast.ReturnStmt)
func IsReturnStmt(node ast.Node) bool {
_, ok := node.(*ast.ReturnStmt)
return ok
}
// IsBranchStmt reports whether a given ast.Node is a branch(goto/continue/break/fallthrough)statement(*ast.BranchStmt)
func IsBranchStmt(node ast.Node) bool {
_, ok := node.(*ast.BranchStmt)
return ok
}
// IsBlockStmt reports whether a given ast.Node is a block statement(*ast.BlockStmt)
func IsBlockStmt(node ast.Node) bool {
_, ok := node.(*ast.BlockStmt)
return ok
}
// IsIfStmt reports whether a given ast.Node is an if statement(*ast.IfStmt)
func IsIfStmt(node ast.Node) bool {
_, ok := node.(*ast.IfStmt)
return ok
}
// IsCaseClause reports whether a given ast.Node is a case statement(*ast.CaseClause)
func IsCaseClause(node ast.Node) bool {
_, ok := node.(*ast.CaseClause)
return ok
}
// IsSwitchStmt reports whether a given ast.Node is a switch statement(*ast.SwitchStmt)
func IsSwitchStmt(node ast.Node) bool {
_, ok := node.(*ast.SwitchStmt)
return ok
}
// IsTypeSwitchStmt reports whether a given ast.Node is a type switch statement(*ast.TypeSwitchStmt)
func IsTypeSwitchStmt(node ast.Node) bool {
_, ok := node.(*ast.TypeSwitchStmt)
return ok
}
// IsCommClause reports whether a given ast.Node is a select statement(*ast.CommClause)
func IsCommClause(node ast.Node) bool {
_, ok := node.(*ast.CommClause)
return ok
}
// IsSelectStmt reports whether a given ast.Node is a selection statement(*ast.SelectStmt)
func IsSelectStmt(node ast.Node) bool {
_, ok := node.(*ast.SelectStmt)
return ok
}
// IsForStmt reports whether a given ast.Node is a for statement(*ast.ForStmt)
func IsForStmt(node ast.Node) bool {
_, ok := node.(*ast.ForStmt)
return ok
}
// IsRangeStmt reports whether a given ast.Node is a range statement(*ast.RangeStmt)
func IsRangeStmt(node ast.Node) bool {
_, ok := node.(*ast.RangeStmt)
return ok
}