From dc7a213675c0f1d25d6ccda7e5c2584f54c50540 Mon Sep 17 00:00:00 2001 From: elbrujohalcon Date: Fri, 18 Oct 2024 09:05:44 +0200 Subject: [PATCH] brujo-update Revert OTP27 compat changes --- src/ktn_dodger.erl | 7 ++++--- test/files/otp27.erl | 9 +++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ktn_dodger.erl b/src/ktn_dodger.erl index dd4e00a..c0cdadb 100644 --- a/src/ktn_dodger.erl +++ b/src/ktn_dodger.erl @@ -400,9 +400,10 @@ parse_form(Parser, Ts, L1, NoFail, Opt) -> IoErr = io_error(L1, Term), {error, IoErr, L1}; {parse_error, _IoErr} when NoFail -> - {ok, erl_syntax:set_pos( - erl_syntax:text(tokens_to_string(Ts)), - erl_anno:new(start_pos(Ts, L1))), + {ok, + erl_syntax:set_pos( + erl_syntax:text(tokens_to_string(Ts)), + erl_anno:new(start_pos(Ts, L1))), L1}; {parse_error, IoErr} -> {error, IoErr, L1}; diff --git a/test/files/otp27.erl b/test/files/otp27.erl index e7b0083..2e09d09 100644 --- a/test/files/otp27.erl +++ b/test/files/otp27.erl @@ -6,8 +6,13 @@ -export([break/0]). -break( ) -> _ = scan : string( ~ "" " +break() -> + _ = scan:string(~""" This is valid code. - " "" ) , Fun = fun ( ) -> ok end , ?assertMatch( { ok , _ } when is_function( Fun , 0 ) , { ok , 'no' } ) . + """), + + Fun = fun () -> ok end, + ?assertMatch({ok, _} + when is_function(Fun, 0), {ok, 'no'}). -endif.