-
-
Notifications
You must be signed in to change notification settings - Fork 120
/
term_type.go
77 lines (74 loc) · 1.5 KB
/
term_type.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 gojq
// TermType represents the type of [Term].
type TermType int
// TermType list.
const (
TermTypeIdentity TermType = iota + 1
TermTypeRecurse
TermTypeNull
TermTypeTrue
TermTypeFalse
TermTypeIndex
TermTypeFunc
TermTypeObject
TermTypeArray
TermTypeNumber
TermTypeUnary
TermTypeFormat
TermTypeString
TermTypeIf
TermTypeTry
TermTypeReduce
TermTypeForeach
TermTypeLabel
TermTypeBreak
TermTypeQuery
)
// GoString implements [fmt.GoStringer].
func (termType TermType) GoString() (str string) {
defer func() { str = "gojq." + str }()
switch termType {
case TermTypeIdentity:
return "TermTypeIdentity"
case TermTypeRecurse:
return "TermTypeRecurse"
case TermTypeNull:
return "TermTypeNull"
case TermTypeTrue:
return "TermTypeTrue"
case TermTypeFalse:
return "TermTypeFalse"
case TermTypeIndex:
return "TermTypeIndex"
case TermTypeFunc:
return "TermTypeFunc"
case TermTypeObject:
return "TermTypeObject"
case TermTypeArray:
return "TermTypeArray"
case TermTypeNumber:
return "TermTypeNumber"
case TermTypeUnary:
return "TermTypeUnary"
case TermTypeFormat:
return "TermTypeFormat"
case TermTypeString:
return "TermTypeString"
case TermTypeIf:
return "TermTypeIf"
case TermTypeTry:
return "TermTypeTry"
case TermTypeReduce:
return "TermTypeReduce"
case TermTypeForeach:
return "TermTypeForeach"
case TermTypeLabel:
return "TermTypeLabel"
case TermTypeBreak:
return "TermTypeBreak"
case TermTypeQuery:
return "TermTypeQuery"
default:
panic(termType)
}
}