aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2023-01-16 15:24:58 +0100
committerLoïc Hoguin <[email protected]>2023-01-16 15:24:58 +0100
commit73a2e67e709c38930580a80238e308397472c47d (patch)
treee049f949922ca87022a80830467faa2d73c9169f
parente9a597168760eca6cedbe4a5726b1f90b7a6d21b (diff)
downloadasciideck-master.tar.gz
asciideck-master.tar.bz2
asciideck-master.zip
Require OTP-21+ and remove erlang:get_stacktrace/0 usageHEADmaster
-rw-r--r--Makefile3
-rw-r--r--src/asciideck_to_html.erl10
-rw-r--r--src/asciideck_to_manpage.erl8
3 files changed, 6 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 623bc4a..94a1c3c 100644
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,9 @@ dep_ct_helper = git https://github.com/ninenines/ct_helper master
dep_ci.erlang.mk = git https://github.com/ninenines/ci.erlang.mk master
DEP_EARLY_PLUGINS = ci.erlang.mk
-AUTO_CI_OTP ?= OTP-20+
+AUTO_CI_OTP ?= OTP-21+
AUTO_CI_HIPE ?= OTP-LATEST
# AUTO_CI_ERLLVM ?= OTP-LATEST
-# Not sure why but the groff tests fail before OTP-21.
AUTO_CI_WINDOWS ?= OTP-21+
include erlang.mk
diff --git a/src/asciideck_to_html.erl b/src/asciideck_to_html.erl
index 62dfc11..228c043 100644
--- a/src/asciideck_to_html.erl
+++ b/src/asciideck_to_html.erl
@@ -14,10 +14,6 @@
-module(asciideck_to_html).
--ifdef(OTP_RELEASE).
--compile({nowarn_deprecated_function, [{erlang, get_stacktrace, 0}]}).
--endif.
-
-export([translate/2]).
translate(AST, Opts) ->
@@ -81,8 +77,8 @@ ast_node(Node={Type, _, _, _}) ->
comment_line -> comment_line(Node);
_ -> ast_error({unknown_type, Node})
end
- catch C:E ->
- ast_error({crash, C, E, erlang:get_stacktrace(), Node})
+ catch C:E:S ->
+ ast_error({crash, C, E, S, Node})
end.
ast_error(Error) ->
@@ -124,7 +120,7 @@ paragraph({paragraph, _, Text, _}) ->
listing_block({listing_block, Attrs, Listing0, _}) ->
Listing = case Attrs of
#{1 := <<"source">>, 2 := _} ->
- try asciideck_source_highlight:filter(Listing0, Attrs) catch C:E -> io:format("~p ~p ~p~n", [C, E, erlang:get_stacktrace()]), exit(bad) end;
+ try asciideck_source_highlight:filter(Listing0, Attrs) catch C:E:S -> io:format("~p ~p ~p~n", [C, E, S]), exit(bad) end;
_ ->
["<pre>", html_encode(Listing0), "</pre>"]
end,
diff --git a/src/asciideck_to_manpage.erl b/src/asciideck_to_manpage.erl
index 7f6cbaf..8e1a19e 100644
--- a/src/asciideck_to_manpage.erl
+++ b/src/asciideck_to_manpage.erl
@@ -16,10 +16,6 @@
%% description of the format expected for man pages.
-module(asciideck_to_manpage).
--ifdef(OTP_RELEASE).
--compile({nowarn_deprecated_function, [{erlang, get_stacktrace, 0}]}).
--endif.
-
-export([translate/2]).
translate(AST, Opts) ->
@@ -86,9 +82,9 @@ ast_node(Node={Type, _, _, _}) ->
io:format("Ignored AST node ~p~n", [Node]),
[]
end
- catch C:E ->
+ catch C:E:S ->
io:format("Ignored AST node ~p~nReason: ~p:~p~nStacktrace: ~p~n",
- [Node, C, E, erlang:get_stacktrace()]),
+ [Node, C, E, S]),
[]
end.