From 0e8eb5c4ec32bc97137d06549237370d06ea44f7 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 29 Nov 2024 20:28:54 +0100 Subject: [PATCH] Erlang/OTP 27 finally exports re:mp/0 and re:compile_options/0 types --- .github/workflows/ci.yml | 1 + src/yconf.erl | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 615e88e..b583fd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: - run: rebar3 compile - run: rebar3 xref - run: rebar3 dialyzer + if: matrix.otp != 26 # Some re types are not exported in OTP 26 - run: rebar3 eunit -v - name: Send to Coveralls if: matrix.otp == 26 diff --git a/src/yconf.erl b/src/yconf.erl index 92b5a1c..39e73d5 100644 --- a/src/yconf.erl +++ b/src/yconf.erl @@ -243,7 +243,7 @@ binary() -> binary(Regexp) -> binary(Regexp, []). --spec binary(iodata(), [re:compile_option()]) -> validator(binary()). +-spec binary(iodata(), re:compile_options()) -> validator(binary()). binary(Regexp, Opts) when is_list(Regexp) orelse is_binary(Regexp) -> fun(Val) -> Bin = to_binary(Val), @@ -265,7 +265,7 @@ string() -> string(Regexp) -> string(Regexp, []). --spec string(iodata(), [re:compile_option()]) -> validator(string()). +-spec string(iodata(), re:compile_options()) -> validator(string()). string(Regexp, Opts) when is_list(Regexp) orelse is_binary(Regexp) -> fun(Val) -> Str = to_string(Val), @@ -451,7 +451,7 @@ timeout(Unit, Inf) -> re() -> re([]). --spec re([re:compile_option()]) -> validator(re:mp()). +-spec re(re:compile_options()) -> validator(re:mp()). re(Opts) -> fun(Val) -> Bin = to_binary(Val), @@ -465,7 +465,7 @@ re(Opts) -> glob() -> glob([]). --spec glob([re:compile_option()]) -> validator(re:mp()). +-spec glob(re:compile_options()) -> validator(re:mp()). glob(Opts) -> fun(Val) -> S = to_string(Val),