summaryrefslogtreecommitdiff
path: root/json/json.go
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-13 17:30:10 +1000
committerAdam Scarr <adam@vektah.net>2017-08-13 18:56:23 +1000
commit5716ddb5e7ca3cb4ee445bdd4958c37aeb033baa (patch)
treea5d5017dbf1078220ceef24d9ea9432b33972291 /json/json.go
parent0dc37ae5bc10cc0669f88ab9febbc039a28f23d1 (diff)
Pass result in instead of returning
Diffstat (limited to 'json/json.go')
-rw-r--r--json/json.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/json/json.go b/json/json.go
index 7cc53a1..9b1e8e9 100644
--- a/json/json.go
+++ b/json/json.go
@@ -13,22 +13,22 @@ var (
_number = NumberLit()
_properties = Some(Seq(StringLit(`"`), ":", &_value), ",")
- _array = Seq("[", Cut(), Some(&_value, ","), "]").Map(func(n Result) Result {
+ _array = Seq("[", Cut(), Some(&_value, ","), "]").Map(func(n *Result) {
ret := []interface{}{}
for _, child := range n.Child[2].Child {
ret = append(ret, child.Result)
}
- return Result{Result: ret}
+ n.Result = ret
})
- _object = Seq("{", Cut(), _properties, "}").Map(func(n Result) Result {
+ _object = Seq("{", Cut(), _properties, "}").Map(func(n *Result) {
ret := map[string]interface{}{}
for _, prop := range n.Child[2].Child {
ret[prop.Child[0].Result.(string)] = prop.Child[2].Result
}
- return Result{Result: ret}
+ n.Result = ret
})
)