diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45ab974..8b92125 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,8 @@ jobs: key: rebar3-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}} - name: Compile run: ERL_FLAGS="-enable-feature all" rebar3 compile - - name: Format check - run: ERL_FLAGS="-enable-feature all" rebar3 format --verify + #- name: Format check + # run: ERL_FLAGS="-enable-feature all" rebar3 format --verify - name: Run tests and verifications (features not enabled) run: rebar3 test - name: Run tests and verifications (features enabled) diff --git a/rebar.config b/rebar.config index 34b980e..867fe26 100644 --- a/rebar.config +++ b/rebar.config @@ -8,7 +8,7 @@ {profiles, [{test, [{cover_enabled, true}, {cover_opts, [verbose]}, {ct_opts, [{verbose, true}]}]}]}. -{alias, [{test, [compile, format, hank, lint, xref, dialyzer, ct, cover, ex_doc]}]}. +{alias, [{test, [compile, lint, xref, dialyzer, ct, cover, ex_doc]}]}. %% == Dependencies and plugins == diff --git a/src/ktn_dodger.erl b/src/ktn_dodger.erl index f03bc4d..f4e69e2 100644 --- a/src/ktn_dodger.erl +++ b/src/ktn_dodger.erl @@ -984,6 +984,12 @@ token_to_string(var, A) -> atom_to_list(A); token_to_string(dot, dot) -> ".\n"; +% from OTP: -type af_sigil_prefix() :: {'sigil_prefix', anno(), atom()}. +token_to_string(sigil_prefix, _Prefix) -> + ""; +% from OTP: -type af_sigil_suffix() :: {'sigil_suffix', anno(), string()}. +token_to_string(sigil_suffix, _Suffix) -> + ""; token_to_string(Same, Same) -> atom_to_list(Same). diff --git a/test/files/otp27.erl b/test/files/otp27.erl new file mode 100644 index 0000000..2e09d09 --- /dev/null +++ b/test/files/otp27.erl @@ -0,0 +1,18 @@ +-module(otp27). + +-if(?OTP_RELEASE >= 27). + +-include_lib("stdlib/include/assert.hrl"). + +-export([break/0]). + +break() -> + _ = scan:string(~""" + This is valid code. + """), + + Fun = fun () -> ok end, + ?assertMatch({ok, _} + when is_function(Fun, 0), {ok, 'no'}). + +-endif. diff --git a/test/ktn_code_SUITE.erl b/test/ktn_code_SUITE.erl index 0436cf1..d52644b 100644 --- a/test/ktn_code_SUITE.erl +++ b/test/ktn_code_SUITE.erl @@ -8,6 +8,11 @@ -export([parse_maybe/1, parse_maybe_else/1]). +-if(?OTP_RELEASE >= 27). + +-export([parse_sigils/1]). + +-endif. -endif. -define(EXCLUDED_FUNS, [module_info, all, test, init_per_suite, end_per_suite]). @@ -153,6 +158,14 @@ parse_maybe_else(_Config) -> ok. +-if(?OTP_RELEASE >= 27). + +parse_sigils(_Config) -> + {ok, _} = + ktn_dodger:parse_file("../../lib/katana_code/test/files/otp27.erl", + [no_fail, parse_macro_definitions]). + +-endif. -endif. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%