From 5a8830fb2675372bfa445de490ca572168200381 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 17 Aug 2024 15:47:11 -0700 Subject: [PATCH] add patch for git #162 --- CHANGES.md | 3 +++ lib/Perl/Tidy/Tokenizer.pm | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 3d5053ad..a60594cc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,9 @@ ## 2024 05 11.09 + - Add partial support for Syntax::Operator::In and Syntax::Keyword::Match + (see git #162). + - Add --timeout-in-seconds=n, or -tos=n. When the standard input supplies the input stream, and the input has not been received within n seconds, perltidy will end with a timeout message. The intention is to catch diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index caaf4f32..4af3faa5 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -3826,6 +3826,12 @@ EOM $type = 'J'; } + # mark colon as attribute if an error would occur otherwise; git #162 + elsif ( !$rcurrent_depth->[QUESTION_COLON] ) { + $type = 'A'; + $self->[_in_attribute_list_] = 1; + } + # otherwise, it should be part of a ?/: operator else { ( $type_sequence, $indent_flag ) = @@ -4600,6 +4606,11 @@ EOM } + # patch for Syntax::Operator::In, git #162 + elsif ( $tok eq 'in' && $next_nonblank_token eq ':' ) { + + } + # Fix part 1 for git #63 in which a comment falls # between an -> and the following word. An # alternate fix would be to change operator_expected -- 2.39.5