diff options
Diffstat (limited to 'lib/syntax_tools')
-rw-r--r-- | lib/syntax_tools/src/erl_syntax.erl | 18 | ||||
-rw-r--r-- | lib/syntax_tools/src/erl_syntax_lib.erl | 10 | ||||
-rw-r--r-- | lib/syntax_tools/src/erl_tidy.erl | 14 | ||||
-rw-r--r-- | lib/syntax_tools/src/igor.erl | 20 | ||||
-rw-r--r-- | lib/syntax_tools/src/syntax_tools.appup.src | 22 | ||||
-rw-r--r-- | lib/syntax_tools/test/syntax_tools_SUITE.erl | 9 |
6 files changed, 63 insertions, 30 deletions
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl index 2f4c9ac309..ed9decd4b5 100644 --- a/lib/syntax_tools/src/erl_syntax.erl +++ b/lib/syntax_tools/src/erl_syntax.erl @@ -453,33 +453,38 @@ %% </tr><tr> %% <td>list_comp</td> %% <td>macro</td> +%% <td>map_expr</td> +%% <td>map_field_assoc</td> +%% </tr><tr> +%% <td>map_field_exact</td> %% <td>match_expr</td> %% <td>module_qualifier</td> -%% </tr><tr> %% <td>named_fun_expr</td> +%% </tr><tr> %% <td>nil</td> %% <td>operator</td> %% <td>parentheses</td> -%% </tr><tr> %% <td>prefix_expr</td> +%% </tr><tr> %% <td>receive_expr</td> %% <td>record_access</td> %% <td>record_expr</td> -%% </tr><tr> %% <td>record_field</td> +%% </tr><tr> %% <td>record_index_expr</td> %% <td>rule</td> %% <td>size_qualifier</td> -%% </tr><tr> %% <td>string</td> +%% </tr><tr> %% <td>text</td> %% <td>try_expr</td> %% <td>tuple</td> -%% </tr><tr> %% <td>underscore</td> +%% </tr><tr> %% <td>variable</td> %% <td>warning_marker</td> %% <td></td> +%% <td></td> %% </tr> %% </table></center> %% @@ -520,6 +525,9 @@ %% @see list/2 %% @see list_comp/2 %% @see macro/2 +%% @see map_expr/2 +%% @see map_field_assoc/2 +%% @see map_field_exact/2 %% @see match_expr/2 %% @see module_qualifier/2 %% @see named_fun_expr/2 diff --git a/lib/syntax_tools/src/erl_syntax_lib.erl b/lib/syntax_tools/src/erl_syntax_lib.erl index e4665b99fc..2f0488abec 100644 --- a/lib/syntax_tools/src/erl_syntax_lib.erl +++ b/lib/syntax_tools/src/erl_syntax_lib.erl @@ -288,7 +288,7 @@ mapfoldl(_, S, []) -> %% %% @see //stdlib/sets --spec variables(erl_syntax:syntaxTree()) -> set(). +-spec variables(erl_syntax:syntaxTree()) -> sets:set(atom()). variables(Tree) -> variables(Tree, sets:new()). @@ -343,7 +343,7 @@ default_variable_name(N) -> %% %% @see new_variable_name/2 --spec new_variable_name(set()) -> atom(). +-spec new_variable_name(sets:set(atom())) -> atom(). new_variable_name(S) -> new_variable_name(fun default_variable_name/1, S). @@ -369,7 +369,7 @@ new_variable_name(S) -> %% @see //stdlib/sets %% @see //stdlib/random --spec new_variable_name(fun((integer()) -> atom()), set()) -> atom(). +-spec new_variable_name(fun((integer()) -> atom()), sets:set(atom())) -> atom(). new_variable_name(F, S) -> R = start_range(S), @@ -416,7 +416,7 @@ generate(_Key, Range) -> %% %% @see new_variable_name/1 --spec new_variable_names(integer(), set()) -> [atom()]. +-spec new_variable_names(integer(), sets:set(atom())) -> [atom()]. new_variable_names(N, S) -> new_variable_names(N, fun default_variable_name/1, S). @@ -432,7 +432,7 @@ new_variable_names(N, S) -> %% %% @see new_variable_name/2 --spec new_variable_names(integer(), fun((integer()) -> atom()), set()) -> +-spec new_variable_names(integer(), fun((integer()) -> atom()), sets:set(atom())) -> [atom()]. new_variable_names(N, F, S) when is_integer(N) -> diff --git a/lib/syntax_tools/src/erl_tidy.erl b/lib/syntax_tools/src/erl_tidy.erl index 7444d8dc67..38e0c2099b 100644 --- a/lib/syntax_tools/src/erl_tidy.erl +++ b/lib/syntax_tools/src/erl_tidy.erl @@ -14,7 +14,7 @@ %% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 %% USA %% -%% @copyright 1999-2006 Richard Carlsson +%% @copyright 1999-2014 Richard Carlsson %% @author Richard Carlsson <[email protected]> %% @end %% ===================================================================== @@ -958,7 +958,7 @@ hidden_uses_2(Tree, Used) -> -record(env, {file :: file:filename(), module :: atom(), current :: fa(), - imports = dict:new() :: dict(), + imports = dict:new() :: dict:dict(atom(), atom()), context = normal :: context(), verbosity = 1 :: 0 | 1 | 2, quiet = false :: boolean(), @@ -970,12 +970,12 @@ hidden_uses_2(Tree, Used) -> old_guard_tests = false :: boolean()}). -record(st, {varc :: non_neg_integer(), - used = sets:new() :: set(), - imported :: set(), - vars :: set(), - functions :: set(), + used = sets:new() :: sets:set({atom(), arity()}), + imported :: sets:set({atom(), arity()}), + vars :: sets:set(atom()), + functions :: sets:set({atom(), arity()}), new_forms = [] :: [erl_syntax:syntaxTree()], - rename :: dict()}). + rename :: dict:dict(mfa(), {atom(), atom()})}). visit_used(Names, Defs, Roots, Imports, Module, Opts) -> File = proplists:get_value(file, Opts, ""), diff --git a/lib/syntax_tools/src/igor.erl b/lib/syntax_tools/src/igor.erl index 19b1cd592f..e6aff7b20a 100644 --- a/lib/syntax_tools/src/igor.erl +++ b/lib/syntax_tools/src/igor.erl @@ -14,7 +14,7 @@ %% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 %% USA %% -%% @copyright 1998-2006 Richard Carlsson +%% @copyright 1998-2014 Richard Carlsson %% @author Richard Carlsson <[email protected]> %% @end %% ===================================================================== @@ -695,7 +695,7 @@ merge_files1(Files, Opts) -> preserved :: boolean(), no_headers :: boolean(), notes :: notes(), - redirect :: dict(), % = dict(atom(), atom()) + redirect :: dict:dict(atom(), atom()), no_imports :: ordsets:ordset(atom()), options :: [option()] }). @@ -727,7 +727,7 @@ merge_sources(Name, Sources, Opts) -> %% Data structure for keeping state during transformation. --record(state, {export :: set()}). +-record(state, {export :: sets:set(atom(), arity())}). state__add_export(Name, Arity, S) -> S#state{export = sets:add_element({Name, Arity}, @@ -1039,7 +1039,7 @@ make_stub(M, Map, Env) -> -type atts() :: 'delete' | 'kill'. -type file_atts() :: 'delete' | 'keep' | 'kill'. --record(filter, {records :: set(), +-record(filter, {records :: sets:set(atom()), file_attributes :: file_atts(), attributes :: atts()}). @@ -1588,17 +1588,17 @@ alias_expansions_2(Modules, Table) -> -record(code, {module :: atom(), target :: atom(), - sources :: set(), % set(atom()), - static :: set(), % set(atom()), - safe :: set(), % set(atom()), + sources :: sets:set(atom()), + static :: sets:set(atom()), + safe :: sets:set(atom()), preserved :: boolean(), no_headers :: boolean(), notes :: notes(), map :: map_fun(), renaming :: fun((atom()) -> map_fun()), - expand :: dict(), % = dict({atom(), integer()}, - % {atom(), {atom(), integer()}}) - redirect :: dict() % = dict(atom(), atom()) + expand :: dict:dict({atom(), integer()}, + {atom(), {atom(), integer()}}), + redirect :: dict:dict(atom(), atom()) }). %% `Trees' must be a list of syntax trees of type `form_list'. The diff --git a/lib/syntax_tools/src/syntax_tools.appup.src b/lib/syntax_tools/src/syntax_tools.appup.src index 54a63833e6..89c25d14d7 100644 --- a/lib/syntax_tools/src/syntax_tools.appup.src +++ b/lib/syntax_tools/src/syntax_tools.appup.src @@ -1 +1,21 @@ -{"%VSN%",[],[]}. +%% -*- erlang -*- +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2014. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +{"%VSN%", + [{<<".*">>,[{restart_application, syntax_tools}]}], + [{<<".*">>,[{restart_application, syntax_tools}]}] +}. diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl index b673b70a95..d4c54a72aa 100644 --- a/lib/syntax_tools/test/syntax_tools_SUITE.erl +++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl @@ -24,12 +24,12 @@ init_per_group/2,end_per_group/2]). %% Test cases --export([smoke_test/1,revert/1]). +-export([app_test/1,appup_test/1,smoke_test/1,revert/1]). suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> - [smoke_test,revert]. + [app_test,appup_test,smoke_test,revert]. groups() -> []. @@ -46,6 +46,11 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. +app_test(Config) when is_list(Config) -> + ok = ?t:app_test(syntax_tools). + +appup_test(Config) when is_list(Config) -> + ok = ?t:appup_test(syntax_tools). %% Read and parse all source in the OTP release. smoke_test(Config) when is_list(Config) -> |