2
0
mirror of https://github.com/skanehira/tson synced 2024-11-15 12:13:04 +00:00
tson/gui/type.go
2019-11-02 02:23:56 +09:00

50 lines
628 B
Go

package gui
type JSONType int
const (
Root JSONType = iota + 1
Object
Array
Key
Value
)
var jsonTypeMap = map[JSONType]string{
Object: "object",
Array: "array",
Key: "key",
Value: "value",
}
func (t JSONType) String() string {
return jsonTypeMap[t]
}
type ValueType int
const (
Int ValueType = iota + 1
String
Float
Boolean
Null
)
var valueTypeMap = map[ValueType]string{
Int: "int",
String: "string",
Float: "float",
Boolean: "boolean",
Null: "null",
}
func (v ValueType) String() string {
return valueTypeMap[v]
}
type Reference struct {
JSONType JSONType
ValueType ValueType
}