diff options
author | Richard Carlsson <[email protected]> | 2014-04-21 10:10:28 +0200 |
---|---|---|
committer | Richard Carlsson <[email protected]> | 2014-12-22 11:52:12 +0100 |
commit | b61b839fff720fed3afa7c23d7787c60ff95de15 (patch) | |
tree | 66f9171d4374d49d4be01f1b3f83711e0067adbf /lib/syntax_tools/src/erl_tidy.erl | |
parent | 7bafc1b2ddd34b5905b9ef7d88dee5d8fc9c6aab (diff) | |
download | otp-b61b839fff720fed3afa7c23d7787c60ff95de15.tar.gz otp-b61b839fff720fed3afa7c23d7787c60ff95de15.tar.bz2 otp-b61b839fff720fed3afa7c23d7787c60ff95de15.zip |
Remove support for Mnemosyne rules
Diffstat (limited to 'lib/syntax_tools/src/erl_tidy.erl')
-rw-r--r-- | lib/syntax_tools/src/erl_tidy.erl | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/lib/syntax_tools/src/erl_tidy.erl b/lib/syntax_tools/src/erl_tidy.erl index 38e0c2099b..db7f0939a3 100644 --- a/lib/syntax_tools/src/erl_tidy.erl +++ b/lib/syntax_tools/src/erl_tidy.erl @@ -792,16 +792,11 @@ keep_form(Form, Used, Opts) -> N = erl_syntax_lib:analyze_function(Form), case sets:is_element(N, Used) of false -> - report_removed_def("function", N, Form, Opts), - false; - true -> - true - end; - rule -> - N = erl_syntax_lib:analyze_rule(Form), - case sets:is_element(N, Used) of - false -> - report_removed_def("rule", N, Form, Opts), + {F, A} = N, + File = proplists:get_value(file, Opts, ""), + report({File, erl_syntax:get_pos(Form), + "removing unused function `~w/~w'."}, + [F, A], Opts), false; true -> true @@ -823,12 +818,6 @@ keep_form(Form, Used, Opts) -> true end. -report_removed_def(Type, {N, A}, Form, Opts) -> - File = proplists:get_value(file, Opts, ""), - report({File, erl_syntax:get_pos(Form), - "removing unused ~s `~w/~w'."}, - [Type, N, A], Opts). - collect_functions(Forms) -> lists:foldl( fun (F, {Names, Defs}) -> @@ -837,10 +826,6 @@ collect_functions(Forms) -> N = erl_syntax_lib:analyze_function(F), {sets:add_element(N, Names), dict:store(N, {F, []}, Defs)}; - rule -> - N = erl_syntax_lib:analyze_rule(F), - {sets:add_element(N, Names), - dict:store(N, {F, []}, Defs)}; _ -> {Names, Defs} end @@ -855,11 +840,6 @@ update_forms([F | Fs], Defs, Imports, Opts) -> {F1, Fs1} = dict:fetch(N, Defs), [F1 | lists:reverse(Fs1)] ++ update_forms(Fs, Defs, Imports, Opts); - rule -> - N = erl_syntax_lib:analyze_rule(F), - {F1, Fs1} = dict:fetch(N, Defs), - [F1 | lists:reverse(Fs1)] ++ update_forms(Fs, Defs, Imports, - Opts); attribute -> [update_attribute(F, Imports, Opts) | update_forms(Fs, Defs, Imports, Opts)]; |