定义数据类型枚举值

This commit is contained in:
zhangdeman committed 2022-07-05 17:02:53 +08:00
1 parent 5f1a779a26
commit b85023e57f
1 file changed
+14
+14
View File
@@ -25,6 +25,7 @@ type jsonNode struct {
PreBrother *jsonNode // 前一个兄弟节点
NextBrother *jsonNode // 下一个兄弟节点
Val interface{} // 节点的值
Type string // 数据类型
}
// lexicalNode 词法分析的节点
@@ -53,3 +54,16 @@ func (l *lexicalNode) ValStr() string {
}
return fmt.Sprintf("%v", l.Val)
}
const (
// NodeTypeNumber 数据类型
NodeTypeNumber = "number"
// NodeTypeBool bool 类型
NodeTypeBool = "bool"
// NodeTypeString 字符串类型
NodeTypeString = "string"
// NodeTypeObject kv 对象类型
NodeTypeObject = "object"
// NodeTypeList list类型
NodeTypeList = "list"
)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.