Added some more parsing rules
This commit is contained in:
parent
dcab797d0f
commit
1f3f7daa9a
1 changed files with 8 additions and 1 deletions
|
@ -6,10 +6,17 @@
|
|||
|
||||
parse(JSONData) ->
|
||||
{struct, Struct} = js_mochijson2:decode(JSONData),
|
||||
RequestType = proplists:get_value(<<"request">>, Struct),
|
||||
io:format("~p~n", [Struct]),
|
||||
[{RequestType, Rest}] = Struct,%proplists:get_value(<<"request">>, Struct),
|
||||
case RequestType of
|
||||
<<"define">> ->
|
||||
%Name = proplists:get_value(<<"name">>, Rest),
|
||||
%{struct, Name} = proplists:get_value(<<"name">>, Rest),
|
||||
{struct, Rest2} = Rest,
|
||||
io:format("~p", [Rest2]),
|
||||
ok_you_said_define;
|
||||
<<"call">> ->
|
||||
ok_you_said_call;
|
||||
Other ->
|
||||
io:format("~p", [RequestType]),
|
||||
ok_i_dont_understand
|
||||
|
|
Reference in a new issue