forked from Archives/tson
fix save string number
parent
805b6e1745
commit
014795081d
@ -1,25 +1,47 @@
|
|||||||
package gui
|
package gui
|
||||||
|
|
||||||
type Type int
|
type JSONType int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Unknown Type = iota
|
Root JSONType = iota + 1
|
||||||
Root
|
|
||||||
Object
|
Object
|
||||||
Array
|
Array
|
||||||
Key
|
Key
|
||||||
Value
|
Value
|
||||||
)
|
)
|
||||||
|
|
||||||
var TypeMap = map[Type]string{
|
var jsonTypeMap = map[JSONType]string{
|
||||||
Unknown: "unknown",
|
Object: "object",
|
||||||
Root: "root",
|
Array: "array",
|
||||||
Object: "object",
|
Key: "key",
|
||||||
Array: "array",
|
Value: "value",
|
||||||
Key: "key",
|
|
||||||
Value: "value",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t Type) String() string {
|
func (t JSONType) String() string {
|
||||||
return TypeMap[t]
|
return jsonTypeMap[t]
|
||||||
|
}
|
||||||
|
|
||||||
|
type ValueType int
|
||||||
|
|
||||||
|
const (
|
||||||
|
Int ValueType = iota + 1
|
||||||
|
String
|
||||||
|
Float
|
||||||
|
Boolean
|
||||||
|
)
|
||||||
|
|
||||||
|
var valueTypeMap = map[ValueType]string{
|
||||||
|
Int: "int",
|
||||||
|
String: "string",
|
||||||
|
Float: "float",
|
||||||
|
Boolean: "boolean",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v ValueType) String() string {
|
||||||
|
return valueTypeMap[v]
|
||||||
|
}
|
||||||
|
|
||||||
|
type Reference struct {
|
||||||
|
JSONType JSONType
|
||||||
|
ValueType ValueType
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue