update the ec_semver_parser
This commit is contained in:
parent
16b441f0e3
commit
54f568e826
1 changed files with 6 additions and 7 deletions
|
@ -1,4 +1,3 @@
|
|||
%%% vi:ts=4 sw=4 et
|
||||
-module(ec_semver_parser).
|
||||
-export([parse/1,file/1]).
|
||||
-compile({nowarn_unused_function,[p/4, p/5, p_eof/0, p_optional/1, p_not/1, p_assert/1, p_seq/1, p_and/1, p_choose/1, p_zero_or_more/1, p_one_or_more/1, p_label/2, p_string/1, p_anything/0, p_charclass/1, p_regexp/1, p_attempt/4, line/1, column/1]}).
|
||||
|
@ -6,7 +5,7 @@
|
|||
|
||||
-compile(export_all).
|
||||
-spec file(file:name()) -> any().
|
||||
file(Filename) -> {ok, Bin} = file:read_file(Filename), parse(Bin).
|
||||
file(Filename) -> case file:read_file(Filename) of {ok,Bin} -> parse(Bin); Err -> Err end.
|
||||
|
||||
-spec parse(binary() | list()) -> any().
|
||||
parse(List) when is_list(List) -> parse(list_to_binary(List));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue