diff --git a/statements.go b/statements.go index 3af7841..94c0bee 100644 --- a/statements.go +++ b/statements.go @@ -44,10 +44,10 @@ func (ss statements) Swap(i, j int) { ss[i], ss[j] = ss[j], ss[i] } -// ungron turns statements into a proper datastructur +// ungron turns statements into a proper datastructure func (ss statements) ungron() (interface{}, error) { - // Get all the idividually parsed statements + // Get all the individually parsed statements var parsed []interface{} for _, s := range ss { l := newLexer(s) diff --git a/ungron.go b/ungron.go index 8e0c8cd..8c46462 100644 --- a/ungron.go +++ b/ungron.go @@ -282,7 +282,9 @@ func ungronTokens(ts []token) (interface{}, error) { case typValue: var val interface{} - err := json.Unmarshal([]byte(t.text), &val) + d := json.NewDecoder(strings.NewReader(t.text)) + d.UseNumber() + err := d.Decode(&val) if err != nil { return nil, fmt.Errorf("failed to handle quoted key `%s`", t.text) }