Fixed hash type

This commit is contained in:
radrow 2019-08-07 13:00:04 +02:00
parent 4d13e01177
commit 66d556907d

View File

@ -16,6 +16,8 @@
| {error, {aeso_parse_lib:pos(), atom(), term()}} | {error, {aeso_parse_lib:pos(), atom(), term()}}
| {error, {aeso_parse_lib:pos(), atom()}}. | {error, {aeso_parse_lib:pos(), atom()}}.
-type include_hash() :: {string(), binary()}.
-spec string(string()) -> parse_result(). -spec string(string()) -> parse_result().
string(String) -> string(String) ->
string(String, sets:new(), []). string(String, sets:new(), []).
@ -28,7 +30,7 @@ string(String, Opts) ->
false -> string(String, sets:new(), Opts) false -> string(String, sets:new(), Opts)
end. end.
-spec string(string(), sets:set(binary()), aeso_compiler:options()) -> parse_result(). -spec string(string(), sets:set(include_hash()), aeso_compiler:options()) -> parse_result().
string(String, Included, Opts) -> string(String, Included, Opts) ->
case parse_and_scan(file(), String, Opts) of case parse_and_scan(file(), String, Opts) of
{ok, AST} -> {ok, AST} ->
@ -603,7 +605,7 @@ get_include_code(File, Ann, Opts) ->
{error, {ann_pos(Ann), include_error, File}} {error, {ann_pos(Ann), include_error, File}}
end. end.
-spec hash_include(string() | binary(), string()) -> binary(). -spec hash_include(string() | binary(), string()) -> include_hash().
hash_include(File, Code) when is_binary(File) -> hash_include(File, Code) when is_binary(File) ->
hash_include(binary_to_list(File), Code); hash_include(binary_to_list(File), Code);
hash_include(File, Code) when is_list(File) -> hash_include(File, Code) when is_list(File) ->