diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-07 21:45:12 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-07 21:45:12 +1000 |
commit | 88aaf567a51e9a0b11322db8a967f54057a7e340 (patch) | |
tree | bec13c95851d2b4fad9bbc529e1033414ff230ed /json | |
parent | 132876fce437c35fc861b0796cd231405250bbd5 (diff) |
*Node -> Node
Diffstat (limited to 'json')
-rw-r--r-- | json/json.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/json/json.go b/json/json.go index 01d209f..28889bd 100644 --- a/json/json.go +++ b/json/json.go @@ -9,42 +9,42 @@ import ( var ( value Parser - _array = Map(And("[", Kleene(&value, ","), "]"), func(n *Node) *Node { + _array = Map(And("[", Kleene(&value, ","), "]"), func(n Node) Node { ret := []interface{}{} for _, child := range n.Children[1].Children { ret = append(ret, child.Result) } - return &Node{Result: ret} + return Node{Result: ret} }) properties = Kleene(And(String('"'), ":", &value), ",") - _object = Map(And("{", properties, "}"), func(n *Node) *Node { + _object = Map(And("{", properties, "}"), func(n Node) Node { ret := map[string]interface{}{} for _, prop := range n.Children[1].Children { ret[prop.Children[0].Token] = prop.Children[2].Result } - return &Node{Result: ret} + return Node{Result: ret} }) - _null = Map("null", func(n *Node) *Node { - return &Node{Result: nil} + _null = Map("null", func(n Node) Node { + return Node{Result: nil} }) - _true = Map("true", func(n *Node) *Node { - return &Node{Result: true} + _true = Map("true", func(n Node) Node { + return Node{Result: true} }) - _false = Map("false", func(n *Node) *Node { - return &Node{Result: false} + _false = Map("false", func(n Node) Node { + return Node{Result: false} }) - _string = Map(String('"'), func(n *Node) *Node { - return &Node{Result: n.Token} + _string = Map(String('"'), func(n Node) Node { + return Node{Result: n.Token} }) - Y = Map(&value, func(n *Node) *Node { - return &Node{Result: n.Result} + Y = Map(&value, func(n Node) Node { + return Node{Result: n.Result} }) ) |