whitespace
This commit is contained in:
parent
feaef7380c
commit
4fdd939327
1 changed files with 3 additions and 2 deletions
|
@ -44,6 +44,7 @@ decode(JSON) ->
|
|||
_:_ -> throw(badarg)
|
||||
end.
|
||||
|
||||
|
||||
%% erlang representation is dicts for objects and lists for arrays. these are pushed
|
||||
%% onto a stack, the top of which is our current level, deeper levels represent parent
|
||||
%% and grandparent levels in the json structure. keys are also stored on top of the array
|
||||
|
@ -54,7 +55,6 @@ event(start_object, Stack) ->
|
|||
event(start_array, Stack) ->
|
||||
[[]] ++ Stack;
|
||||
|
||||
|
||||
event(end_object, [Object, {key, Key}, Parent|Stack]) when is_tuple(Parent) ->
|
||||
[insert(Key, Object, Parent)] ++ Stack;
|
||||
event(end_array, [Array, {key, Key}, Parent|Stack]) when is_tuple(Parent) ->
|
||||
|
@ -65,6 +65,7 @@ event(end_array, [Array, Parent|Stack]) when is_list(Parent) ->
|
|||
[[Array] ++ Parent] ++ Stack;
|
||||
|
||||
%% special cases for closing the root objects
|
||||
|
||||
event(end_object, [Object]) ->
|
||||
[Object];
|
||||
event(end_array, [Array]) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue