Skip to content

Commit

Permalink
stdlib: Fix specs for all documented functions
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Jan 23, 2024
1 parent 6a461ef commit d7710e4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
33 changes: 18 additions & 15 deletions lib/parsetools/src/yecc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

-export([compile/3, file/1, file/2, format_error/1]).

-export_type([option/0, yecc_ret/0]).

%% Kept for compatibility with R10B.
-export([yecc/2, yecc/3, yecc/4]).

Expand Down Expand Up @@ -245,6 +247,21 @@ format_error(cannot_parse) ->
-type error_ret() :: 'error'
| {'error', Errors :: errors(), Warnings :: warnings()}.
-type yecc_ret() :: ok_ret() | error_ret().
-type option() :: {'error_location', 'column' | 'line'}
| {'includefile', Includefile :: file:filename()}
| {'report_errors', boolean()}
| {'report_warnings', boolean()}
| {'report', boolean()}
| {'return_errors', boolean()}
| {'return_warnings', boolean()}
| {'return', boolean()}
| {'parserfile', Parserfile :: file:filename()}
| {'verbose', boolean()}
| {'warnings_as_errors', boolean()}
| {'deterministic', boolean()}
| 'report_errors' | 'report_warnings' | 'report'
| 'return_errors' | 'return_warnings' | 'return'
| 'verbose' | 'warnings_as_errors'.

-spec file(FileName) -> yecc_ret() when
FileName :: file:filename().
Expand All @@ -255,21 +272,7 @@ file(GrammarFile) ->
-spec file(Grammarfile, Options) -> yecc_ret() when
Grammarfile :: file:filename(),
Options :: Option | [Option],
Option :: {'error_location', 'column' | 'line'}
| {'includefile', Includefile :: file:filename()}
| {'report_errors', boolean()}
| {'report_warnings', boolean()}
| {'report', boolean()}
| {'return_errors', boolean()}
| {'return_warnings', boolean()}
| {'return', boolean()}
| {'parserfile', Parserfile :: file:filename()}
| {'verbose', boolean()}
| {'warnings_as_errors', boolean()}
| {'deterministic', boolean()}
| 'report_errors' | 'report_warnings' | 'report'
| 'return_errors' | 'return_warnings' | 'return'
| 'verbose' | 'warnings_as_errors'.
Option :: option().

file(File, Options0) when is_list(Options0) ->
case is_filename(File) of
Expand Down
7 changes: 3 additions & 4 deletions lib/stdlib/src/c.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1177,21 +1177,20 @@ get_uptime() ->
%%
%% Cross Reference Check
%%
%%-spec xm(module() | file:filename()) -> xref:m/1 return
-spec xm(module() | file:filename()) -> XRefMRet :: term(). % xref:m/1 return
xm(M) ->
appcall(tools, xref, m, [M]).

%%
%% Call yecc
%%
%%-spec y(file:name()) -> yecc:file/2 return
-spec y(file:name()) -> YeccFileRet :: term(). % yecc:file/2 return
y(File) -> y(File, []).

%%-spec y(file:name(), [yecc:option()]) -> yecc:file/2 return
-spec y(file:name(), [yecc:option()]) -> YeccFileRet :: yecc:yecc_ret(). % yecc:file/2 return
y(File, Opts) ->
appcall(parsetools, yecc, file, [File, Opts]).


%%
%% Avoid creating strong components in xref and dialyzer by making calls
%% from helper functions to other applications indirect.
Expand Down
1 change: 1 addition & 0 deletions lib/stdlib/src/gen_event.erl
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ which_handlers(M) -> rpc(M, which_handlers).
stop(M) ->
gen:stop(M).

-spec stop(emgr_ref(), term(), timeout()) -> 'ok'.
stop(M, Reason, Timeout) ->
gen:stop(M, Reason, Timeout).

Expand Down
1 change: 1 addition & 0 deletions lib/stdlib/src/slave.erl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


%% Start a list of pseudo servers on the local node
-spec pseudo([Master :: node() | ServerList :: [atom()]]) -> ok.
pseudo([Master | ServerList]) ->
pseudo(Master , ServerList);
pseudo(_) ->
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-dialyzer
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ALL_APPLICATIONS="erts $ALL_APPLICATIONS"
echo "All applications: $ALL_APPLICATIONS" |tr '\n' ' ' && echo ""

BASE_PLT="compiler crypto erts kernel stdlib syntax_tools"
APP_PLT="asn1 debugger edoc et ftp inets mnesia observer public_key sasl runtime_tools snmp ssl tftp wx xmerl tools"
APP_PLT="asn1 debugger edoc et ftp inets mnesia observer parsetools public_key sasl runtime_tools snmp ssl tftp wx xmerl tools"
NO_UNMATCHED="common_test eunit inets megaco mnesia snmp ssh ssl observer reltool"
WARNINGS="diameter"

Expand Down

0 comments on commit d7710e4

Please sign in to comment.