-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.go
More file actions
43 lines (38 loc) · 1.02 KB
/
types.go
File metadata and controls
43 lines (38 loc) · 1.02 KB
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
package libjson
// json type
type t_json int32
type token struct {
Type t_json
// only populated for number and string
Start int
End int
}
var empty = token{Type: t_eof}
const (
t_string t_json = iota // anything between ""
t_number // floating point, hex, etc
t_true // true
t_false // false
t_null // null
t_left_curly // {
t_right_curly // }
t_left_braket // [
t_right_braket // ]
t_comma // ,
t_colon // :
t_eof // for any non structure characters outside of strings and numbers
)
var tokennames = map[t_json]string{
t_string: "string",
t_number: "number",
t_true: "true",
t_false: "false",
t_null: "null",
t_left_curly: "{",
t_right_curly: "}",
t_left_braket: "[",
t_right_braket: "]",
t_comma: ",",
t_colon: ":",
t_eof: "EOF",
}