From 77930f8f066b058c7e6cbae015523370ca3dab7e Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Sun, 13 Aug 2017 12:56:46 +1000 Subject: Add map shorthand --- json/json.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'json/json.go') diff --git a/json/json.go b/json/json.go index 172099c..7cc53a1 100644 --- a/json/json.go +++ b/json/json.go @@ -13,7 +13,7 @@ var ( _number = NumberLit() _properties = Some(Seq(StringLit(`"`), ":", &_value), ",") - _array = Map(Seq("[", Cut(), Some(&_value, ","), "]"), func(n Result) Result { + _array = Seq("[", Cut(), Some(&_value, ","), "]").Map(func(n Result) Result { ret := []interface{}{} for _, child := range n.Child[2].Child { ret = append(ret, child.Result) @@ -21,7 +21,7 @@ var ( return Result{Result: ret} }) - _object = Map(Seq("{", Cut(), _properties, "}"), func(n Result) Result { + _object = Seq("{", Cut(), _properties, "}").Map(func(n Result) Result { ret := map[string]interface{}{} for _, prop := range n.Child[2].Child { -- cgit v1.2.3