token_string.go raw
1 // Code generated by "stringer -type token -linecomment tokens.go"; DO NOT EDIT.
2
3 package syntax
4
5 import "strconv"
6
7 func _() {
8 // An "invalid array index" compiler error signifies that the constant values have changed.
9 // Re-run the stringer command to generate them again.
10 var x [1]struct{}
11 _ = x[EOF-1]
12 _ = x[NameType-2]
13 _ = x[Literal-3]
14 _ = x[OperatorType-4]
15 _ = x[AssignOp-5]
16 _ = x[IncOp-6]
17 _ = x[Assign-7]
18 _ = x[Define-8]
19 _ = x[Arrow-9]
20 _ = x[Star-10]
21 _ = x[Lparen-11]
22 _ = x[Lbrack-12]
23 _ = x[Lbrace-13]
24 _ = x[Rparen-14]
25 _ = x[Rbrack-15]
26 _ = x[Rbrace-16]
27 _ = x[Comma-17]
28 _ = x[Semi-18]
29 _ = x[Colon-19]
30 _ = x[Dot-20]
31 _ = x[DotDotDot-21]
32 _ = x[Break-22]
33 _ = x[Case-23]
34 _ = x[Chan-24]
35 _ = x[Const-25]
36 _ = x[Continue-26]
37 _ = x[Default-27]
38 _ = x[Defer-28]
39 _ = x[Else-29]
40 _ = x[Fallthrough-30]
41 _ = x[For-31]
42 _ = x[Func-32]
43 _ = x[Go-33]
44 _ = x[Goto-34]
45 _ = x[If-35]
46 _ = x[Import-36]
47 _ = x[Interface-37]
48 _ = x[Map-38]
49 _ = x[Package-39]
50 _ = x[Range-40]
51 _ = x[Return-41]
52 _ = x[Select-42]
53 _ = x[Struct-43]
54 _ = x[Switch-44]
55 _ = x[TypeType-45]
56 _ = x[Var-46]
57 _ = x[tokenCount-47]
58 }
59
60 const token_name = "EOFnameliteralopop=opop=:=<-*([{)]},;:....breakcasechanconstcontinuedefaultdeferelsefallthroughforfuncgogotoifimportinterfacemappackagerangereturnselectstructswitchtypevar"
61
62 var token_index = [...]uint8{0, 3, 7, 14, 16, 19, 23, 24, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 47, 51, 55, 60, 68, 75, 80, 84, 95, 98, 102, 104, 108, 110, 116, 125, 128, 135, 140, 146, 152, 158, 164, 168, 171, 171}
63
64 func (i Token) String() string {
65 i -= 1
66 if i >= Token(len(token_index)-1) {
67 return "token(" + strconv.FormatInt(int64(i+1), 10) + ")"
68 }
69 return token_name[token_index[i]:token_index[i+1]]
70 }
71