Skip to content

Commit

Permalink
brujo-update Revert OTP27 compat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
elbrujohalcon committed Oct 18, 2024
1 parent b1cd0ce commit dc7a213
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/ktn_dodger.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
9 changes: 7 additions & 2 deletions test/files/otp27.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit dc7a213

Please sign in to comment.