fixes to dialyzer
All types should now be correct and dialyzer runs successfully Signed-off-by: Jordan Wilberding <diginux@gmail.com>
This commit is contained in:
parent
7e42c243b0
commit
e035ae3dbf
12 changed files with 107 additions and 92 deletions
|
@ -20,11 +20,13 @@
|
|||
%%%===================================================================
|
||||
|
||||
-type semvar() :: string().
|
||||
-type parsed_semvar() :: {MajorVsn::string(),
|
||||
MinorVsn::string(),
|
||||
PatchVsn::string(),
|
||||
-type parsed_semvar() :: {MajorVsn::integer(),
|
||||
MinorVsn::integer(),
|
||||
PatchVsn::integer(),
|
||||
PathString::string()}.
|
||||
|
||||
-type semver_tokens() :: {string(), string(), string(), string()}.
|
||||
|
||||
%%%===================================================================
|
||||
%%% API
|
||||
%%%===================================================================
|
||||
|
@ -41,7 +43,7 @@ compare(VsnA, VsnB) ->
|
|||
%%% Internal Functions
|
||||
%%%===================================================================
|
||||
|
||||
-spec tokens(semvar()) -> parsed_semvar().
|
||||
-spec tokens(semvar()) -> semver_tokens().
|
||||
tokens(Vsn) ->
|
||||
[MajorVsn, MinorVsn, RawPatch] = string:tokens(Vsn, "."),
|
||||
{PatchVsn, PatchString} = split_patch(RawPatch),
|
||||
|
@ -62,7 +64,7 @@ split_patch([Dig|T], {PatchVsn, PatchStr}) when Dig >= $0 andalso Dig =< $9 ->
|
|||
split_patch(PatchStr, {PatchVsn, ""}) ->
|
||||
{PatchVsn, PatchStr}.
|
||||
|
||||
-spec compare_toks(parsed_semvar(), parsed_semvar()) -> boolean().
|
||||
-spec compare_toks(semver_tokens(), semver_tokens()) -> boolean().
|
||||
compare_toks({MajA, MinA, PVA, PSA}, {MajB, MinB, PVB, PSB}) ->
|
||||
compare_toks2({to_int(MajA), to_int(MinA), to_int(PVA), PSA},
|
||||
{to_int(MajB), to_int(MinB), to_int(PVB), PSB}).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue