From 4bb418ec598705e27323a96345f7e7e39a6ffa27 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 5 Oct 2023 16:46:49 -0700 Subject: [PATCH] add checks to verify correct sequence numbers --- lib/Perl/Tidy/Formatter.pm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 3eac54e5..94ed836a 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -5876,8 +5876,27 @@ EOM # Save starting seqno to identify sequence method: # New method starts with 2 and has continuous numbering - # Old method starts with >2 and may have gaps - if ( !defined($initial_seqno) ) { $initial_seqno = $seqno } + # Old method (NOT USED) starts with >2 and may have gaps + if ( !defined($initial_seqno) ) { + $initial_seqno = $seqno; + + # Be sure that sequence numbers start with 2. If not, + # there is a programming error in the tokenizer. + if ( $initial_seqno ne 2 ) { + Fault(<