From b85023e57fe60e588ad4becf572ee0862e8ba54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Tue, 5 Jul 2022 17:02:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=95=B0=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=9E=9A=E4=B8=BE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- define.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/define.go b/define.go index caffdf0..877b057 100644 --- a/define.go +++ b/define.go @@ -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" +)