-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtoken.go
50 lines (40 loc) · 930 Bytes
/
token.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
package astrav
import (
"go/token"
)
// Token provides an interface for nodes with a token.Token
type Token interface {
Token() token.Token
}
// Token returns the token of the node
func (s *AssignStmt) Token() token.Token {
return s.Tok
}
// Token returns the token of the node
func (s *BasicLit) Token() token.Token {
return s.Kind
}
// Token returns the token of the node
func (s *BinaryExpr) Token() token.Token {
return s.Op
}
// Token returns the token of the node
func (s *BranchStmt) Token() token.Token {
return s.Tok
}
// Token returns the token of the node
func (s *GenDecl) Token() token.Token {
return s.Tok
}
// Token returns the token of the node
func (s *IncDecStmt) Token() token.Token {
return s.Tok
}
// Token returns the token of the node
func (s *RangeStmt) Token() token.Token {
return s.Tok
}
// Token returns the token of the node
func (s *UnaryExpr) Token() token.Token {
return s.Op
}