File 3681-erl_parse.yrl-Eliminate-old-style-catches.patch of Package erlang

From 22fe97d2c3228d5166f3d61799f09a4f49767161 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Sat, 11 Jan 2025 07:51:53 +0100
Subject: [PATCH 1/7] erl_parse.yrl: Eliminate old-style catches

---
 lib/stdlib/src/erl_parse.yrl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index 7911135eaa..585681979c 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -869,8 +869,6 @@ This function is usually called implicitly when an ErrorInfo structure is
 processed (see section [Error Information](#module-error-information)).
 """).
 
--compile(nowarn_deprecated_catch).
-
 -export([parse_form/1,parse_exprs/1,parse_term/1]).
 -export([normalise/1,abstract/1,tokens/1,tokens/2]).
 -export([abstract/2]).
@@ -1898,7 +1896,12 @@ first_anno(Abstract) ->
                         throw(Anno1)
                 end
         end,
-    catch fold_anno(F, Anno0, Abstract).
+    try fold_anno(F, Anno0, Abstract) of
+        Anno -> Anno
+    catch
+        throw:Anno ->
+            Anno
+    end.
 
 last_anno(Abstract) ->
     Fun = fun(Anno, '*') ->
-- 
2.51.0

openSUSE Build Service is sponsored by