Skip to content

Commit

Permalink
Left in some commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
djnym committed Nov 30, 2009
1 parent 9bb6d66 commit 88e9189
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions src/protobuffs_compile.erl
Original file line number Diff line number Diff line change
Expand Up @@ -159,33 +159,12 @@ collect_full_messages([{message, Name, Fields} | Tail], Acc) ->
end
end, [], Fields),

% FieldsOut = lists:foldl(
% fun (Input, TmpAcc) ->
% case Input of
% {Index, Rules, Type, Identifier, RealType, Other} ->
% case is_scalar_type (Type) of
% true -> [Input | TmpAcc];
% false ->
% PossibleTypes = all_possible_types (Type, ListName),
%
% NewType =
% case find_type (PossibleTypes, Acc) of
% false ->
% hd (PossibleTypes);
% ResultType ->
% ResultType
% end,
% [{Index, Rules, NewType, Identifier, RealType, Other} | TmpAcc]
% end;
% _ -> TmpAcc
% end
% end, [], Fields),
SubMessages = lists:foldl(
% fun ({message, C, D}, TmpAcc) -> [{message, Name ++ "_" ++ C, D} | TmpAcc];
fun ({message, C, D}, TmpAcc) -> [{message, [C | ListName], D} | TmpAcc];
(_, TmpAcc) -> TmpAcc
end, [], Fields),
collect_full_messages(Tail ++ SubMessages, [{ListName, FieldsOut} | Acc]);
SubMessages = lists:foldl(
fun ({message, C, D}, TmpAcc) -> [{message, [C | ListName], D} | TmpAcc];
(_, TmpAcc) -> TmpAcc
end, [], Fields),

collect_full_messages(Tail ++ SubMessages, [{ListName, FieldsOut} | Acc]);
collect_full_messages([{package, _Line1},
{bareword, _Line2, _PackageName},
{';', _Line3} | Tail], Acc) ->
Expand Down

0 comments on commit 88e9189

Please sign in to comment.