diff options
author | Karl Berry <karl@freefriends.org> | 2023-09-09 20:10:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-09-09 20:10:52 +0000 |
commit | d8c36eec0fe1018fe55ddccabc9e59727a29f9f3 (patch) | |
tree | f011558bb25e6856476de9834635ddb3cd6f0184 /Master/texmf-dist/scripts/latexindent | |
parent | 016f06c77e15ad911a2b886c7b0cd4338675e2fc (diff) |
latexindent (9sep23)
git-svn-id: svn://tug.org/texlive/trunk@68225 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/latexindent')
41 files changed, 296 insertions, 263 deletions
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm index 16603094a97..3cffb4ddac3 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm @@ -18,15 +18,15 @@ package LatexIndent::AlignmentAtAmpersand; use strict; use warnings; use Data::Dumper; -use Exporter qw/import/; -use List::Util qw/max min sum/; +use Exporter qw/import/; +use List::Util qw/max min sum/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active %switches/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::HiddenChildren qw/%familyTree/; -use LatexIndent::Verbatim qw/%verbatimStorage/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active %switches/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::HiddenChildren qw/%familyTree/; +use LatexIndent::Verbatim qw/%verbatimStorage/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/align_at_ampersand find_aligned_block double_back_slash_else main_formatting individual_padding multicolumn_padding multicolumn_pre_check multicolumn_post_check dont_measure hidden_child_cell_row_width hidden_child_row_width get_column_width/; @@ -719,7 +719,7 @@ sub dont_measure { ${ $cellStorage[ $input{row} ][ $input{column} ] }{width} ) if ($is_t_switch_active); $logger->trace( "entry: ", ${ $cellStorage[ $input{row} ][ $input{column} ] }{entry} ) if ($is_t_switch_active); - $logger->trace("--------------------------") if ($is_t_switch_active); + $logger->trace("--------------------------") if ($is_t_switch_active); ${ $cellStorage[ $input{row} ][ $input{column} ] }{measureThis} = 0; ${ $cellStorage[ $input{row} ][ $input{column} ] }{type} = "X"; } diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm index e70fd57fb51..69bb6026a2c 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm @@ -17,11 +17,11 @@ package LatexIndent::Arguments; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -263,7 +263,7 @@ sub find_opt_mand_arguments { # delete the regexp, as there's no need for it delete ${ ${ ${$self}{children} }[-1] }{regexp}; - $logger->trace( Dumper( \%{$arguments} ) ) if ($is_tt_switch_active); + $logger->trace( Dumper( \%{$arguments} ) ) if ($is_tt_switch_active); $logger->trace("replaced with ID: ${$arguments}{id}") if $is_tt_switch_active; } else { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm index 9f54207a572..1fc5bbb28c6 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm @@ -18,12 +18,12 @@ package LatexIndent::BackUpFileProcedure; use strict; use warnings; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/%switches/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Switches qw/%switches/; +use LatexIndent::LogFile qw/$logger/; use File::Basename; # to get the filename and directory path use File::Copy; # to copy the original file to backup (if overwrite option set) use Exporter qw/import/; -use Encode qw/decode/; +use Encode qw/decode/; our @EXPORT_OK = qw/create_back_up_file check_if_different/; # copy main file to a back up in the case of the overwrite switch being active diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/BlankLines.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/BlankLines.pm index d0fee3cbe6a..c2ad537feb4 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/BlankLines.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/BlankLines.pm @@ -17,11 +17,11 @@ package LatexIndent::BlankLines; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use Exporter qw/import/; our @EXPORT_OK = qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/; sub protect_blank_lines { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm index 80efc02e523..abddc45ccbc 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm @@ -25,10 +25,10 @@ use LatexIndent::NamedGroupingBracesBrackets qw/$grouping_braces_regexp $groupin use LatexIndent::UnNamedGroupingBracesBrackets qw/$un_named_grouping_braces_RegExp $un_named_grouping_braces_RegExp_trailing_comment/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; -our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 +our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_commands_or_key_equals_values_braces $braceBracketRegExpBasic/; our $commandCounter; our $braceBracketRegExpBasic = qr/\{|\[/; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Check.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Check.pm index 76d75cc9892..e983e9f3a1b 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Check.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Check.pm @@ -17,8 +17,8 @@ package LatexIndent::Check; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use Exporter qw/import/; -use LatexIndent::LogFile qw/$logger/; +use Exporter qw/import/; +use LatexIndent::LogFile qw/$logger/; use LatexIndent::Switches qw/$is_m_switch_active $is_check_verbose_switch_active/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/simple_diff/; @@ -113,8 +113,8 @@ sub simple_diff { } ); - $tmpOldBody = '-' . ${ $diff[$i] }{old} if defined ${ $diff[$i] }{old}; - $tmpNewBody = '+' . ${ $diff[$i] }{new} if defined ${ $diff[$i] }{new}; + $tmpOldBody = '-' . ${ $diff[$i] }{old} if defined ${ $diff[$i] }{old}; + $tmpNewBody = '+' . ${ $diff[$i] }{new} if defined ${ $diff[$i] }{new}; $diffChunkFirstLineNumber = $currentLineNumber; } else { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Command.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Command.pm index 9e2a677a1b8..3ed17900c9c 100755 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Command.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Command.pm @@ -17,11 +17,11 @@ package LatexIndent::Command; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm index 59188a7234a..04c8e638dc0 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm @@ -25,20 +25,20 @@ use Encode qw/decode/; # gain access to subroutines in the following modules use LatexIndent::Switches qw/store_switches %switches $is_m_switch_active $is_t_switch_active $is_tt_switch_active $is_r_switch_active $is_rr_switch_active $is_rv_switch_active $is_check_switch_active/; -use LatexIndent::LogFile qw/process_switches $logger/; -use LatexIndent::Logger qw/@logFileLines/; -use LatexIndent::Check qw/simple_diff/; -use LatexIndent::Lines qw/lines_body_selected_lines lines_verbatim_create_line_block/; +use LatexIndent::LogFile qw/process_switches $logger/; +use LatexIndent::Logger qw/@logFileLines/; +use LatexIndent::Check qw/simple_diff/; +use LatexIndent::Lines qw/lines_body_selected_lines lines_verbatim_create_line_block/; use LatexIndent::Replacement qw/make_replacements/; use LatexIndent::GetYamlSettings qw/yaml_read_settings yaml_modify_line_breaks_settings yaml_get_indentation_settings_for_this_object yaml_poly_switch_get_every_or_custom_value yaml_get_indentation_information yaml_get_object_attribute_for_indentation_settings yaml_alignment_at_ampersand_settings %mainSettings /; -use LatexIndent::FileExtension qw/file_extension_check/; +use LatexIndent::FileExtension qw/file_extension_check/; use LatexIndent::BackUpFileProcedure qw/create_back_up_file check_if_different/; -use LatexIndent::BlankLines qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/; +use LatexIndent::BlankLines qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/; use LatexIndent::ModifyLineBreaks qw/modify_line_breaks_body modify_line_breaks_end modify_line_breaks_end_after remove_line_breaks_begin adjust_line_breaks_end_parent verbatim_modify_line_breaks/; use LatexIndent::Sentence qw/one_sentence_per_line/; -use LatexIndent::Wrap qw/text_wrap text_wrap_comment_blocks/; +use LatexIndent::Wrap qw/text_wrap text_wrap_comment_blocks/; use LatexIndent::TrailingComments qw/remove_trailing_comments put_trailing_comments_back_in add_comment_symbol construct_trailing_comment_regexp/; use LatexIndent::HorizontalWhiteSpace qw/remove_trailing_whitespace remove_leading_space/; @@ -55,21 +55,21 @@ use LatexIndent::DoubleBackSlash qw/dodge_double_backslash un_dodge_double_backs use LatexIndent::Verbatim qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands find_verbatim_special verbatim_common_tasks %verbatimStorage/; use LatexIndent::Environment qw/find_environments $environmentBasicRegExp construct_environments_regexp/; -use LatexIndent::IfElseFi qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/; -use LatexIndent::Else qw/check_for_else_statement/; -use LatexIndent::Arguments qw/get_arguments_regexp find_opt_mand_arguments construct_arguments_regexp comma_else/; -use LatexIndent::OptionalArgument qw/find_optional_arguments/; -use LatexIndent::MandatoryArgument qw/find_mandatory_arguments get_mand_arg_reg_exp/; -use LatexIndent::RoundBrackets qw/find_round_brackets/; -use LatexIndent::Item qw/find_items construct_list_of_items/; -use LatexIndent::Braces qw/find_commands_or_key_equals_values_braces $braceBracketRegExpBasic/; -use LatexIndent::Command qw/construct_command_regexp/; -use LatexIndent::KeyEqualsValuesBraces qw/construct_key_equals_values_regexp/; -use LatexIndent::NamedGroupingBracesBrackets qw/construct_grouping_braces_brackets_regexp/; +use LatexIndent::IfElseFi qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/; +use LatexIndent::Else qw/check_for_else_statement/; +use LatexIndent::Arguments qw/get_arguments_regexp find_opt_mand_arguments construct_arguments_regexp comma_else/; +use LatexIndent::OptionalArgument qw/find_optional_arguments/; +use LatexIndent::MandatoryArgument qw/find_mandatory_arguments get_mand_arg_reg_exp/; +use LatexIndent::RoundBrackets qw/find_round_brackets/; +use LatexIndent::Item qw/find_items construct_list_of_items/; +use LatexIndent::Braces qw/find_commands_or_key_equals_values_braces $braceBracketRegExpBasic/; +use LatexIndent::Command qw/construct_command_regexp/; +use LatexIndent::KeyEqualsValuesBraces qw/construct_key_equals_values_regexp/; +use LatexIndent::NamedGroupingBracesBrackets qw/construct_grouping_braces_brackets_regexp/; use LatexIndent::UnNamedGroupingBracesBrackets qw/construct_unnamed_grouping_braces_brackets_regexp/; use LatexIndent::Special qw/find_special construct_special_begin $specialBeginAndBracesBracketsBasicRegExp $specialBeginBasicRegExp/; -use LatexIndent::Heading qw/find_heading construct_headings_levels $allHeadingsRegexp/; +use LatexIndent::Heading qw/find_heading construct_headings_levels $allHeadingsRegexp/; use LatexIndent::FileContents qw/find_file_contents_environments_and_preamble/; use LatexIndent::Preamble; @@ -369,15 +369,15 @@ sub find_objects { # search for environments $logger->trace('*looking for ENVIRONMENTS') if $is_t_switch_active; - $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s; + $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s; # search for ifElseFi blocks $logger->trace('*looking for IFELSEFI') if $is_t_switch_active; - $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s; + $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s; # search for headings (part, chapter, section, setc) $logger->trace('*looking for HEADINGS (chapter, section, part, etc)') if $is_t_switch_active; - $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s; + $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s; # the ordering of finding commands and special code blocks can change $self->find_commands_or_key_equals_values_braces_and_special @@ -412,16 +412,16 @@ sub find_commands_or_key_equals_values_braces_and_special { # search for commands with arguments $logger->trace('looking for COMMANDS and key = {value}') if $is_t_switch_active; - $self->find_commands_or_key_equals_values_braces if ${$self}{body} =~ m/$braceBracketRegExpBasic/s; + $self->find_commands_or_key_equals_values_braces if ${$self}{body} =~ m/$braceBracketRegExpBasic/s; } else { # search for commands with arguments $logger->trace('looking for COMMANDS and key = {value}') if $is_t_switch_active; - $self->find_commands_or_key_equals_values_braces if ${$self}{body} =~ m/$braceBracketRegExpBasic/s; + $self->find_commands_or_key_equals_values_braces if ${$self}{body} =~ m/$braceBracketRegExpBasic/s; # search for special begin/end $logger->trace('looking for SPECIAL begin/end') if $is_t_switch_active; - $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s; + $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s; } return; } @@ -540,7 +540,7 @@ sub tasks_common_to_each_object { if ( $is_m_switch_active and ( ${$self}{lookForAlignDelims} - or ( defined ${$self}{DBSStartsOnOwnLine} and ${$self}{DBSStartsOnOwnLine} != 0 ) + or ( defined ${$self}{DBSStartsOnOwnLine} and ${$self}{DBSStartsOnOwnLine} != 0 ) or ( defined ${$self}{DBSFinishesWithLineBreak} and ${$self}{DBSFinishesWithLineBreak} != 0 ) ) ); @@ -596,7 +596,7 @@ sub wrap_up_tasks { # check if the last object was the last thing in the body, and if it has adjusted linebreaks $self->adjust_line_breaks_end_parent if $is_m_switch_active; - $logger->trace( Dumper( \%{$child} ) ) if ($is_tt_switch_active); + $logger->trace( Dumper( \%{$child} ) ) if ($is_tt_switch_active); $logger->trace("replaced with ID: ${$child}{id}") if $is_t_switch_active; } diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/DoubleBackSlash.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/DoubleBackSlash.pm index 1c483b68655..10c484935f5 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/DoubleBackSlash.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/DoubleBackSlash.pm @@ -18,8 +18,8 @@ package LatexIndent::DoubleBackSlash; use strict; use warnings; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::Tokens qw/%tokens/; -use Exporter qw/import/; +use LatexIndent::Tokens qw/%tokens/; +use Exporter qw/import/; our @EXPORT_OK = qw/dodge_double_backslash un_dodge_double_backslash/; # some code can contain, e.g diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm index e78aa6b8b54..cb8a29d7437 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm @@ -17,14 +17,14 @@ package LatexIndent::Else; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Braces qw/$braceBracketRegExpBasic/; -use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; -use LatexIndent::Heading qw/$allHeadingsRegexp/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Braces qw/$braceBracketRegExpBasic/; +use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; +use LatexIndent::Heading qw/$allHeadingsRegexp/; +use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/check_for_else_statement/; our $elseCounter; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm index 9d2c34d1bd6..c9a456fa1ad 100755 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm @@ -17,17 +17,17 @@ package LatexIndent::Environment; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Braces qw/$braceBracketRegExpBasic/; -use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; -use LatexIndent::Heading qw/$allHeadingsRegexp/; -use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; -use Exporter qw/import/; -our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Braces qw/$braceBracketRegExpBasic/; +use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; +use LatexIndent::Heading qw/$allHeadingsRegexp/; +use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; +use Exporter qw/import/; +our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_environments $environmentBasicRegExp construct_environments_regexp/; our $environmentCounter; our $environmentBasicRegExp = qr/\\begin\{/; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm index 5093458ee6f..730858094bd 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm @@ -17,15 +17,15 @@ package LatexIndent::FileContents; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Environment qw/$environmentBasicRegExp/; -use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; -use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; -use LatexIndent::Heading qw/$allHeadingsRegexp/; -use LatexIndent::Verbatim qw/%verbatimStorage/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Environment qw/$environmentBasicRegExp/; +use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; +use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; +use LatexIndent::Heading qw/$allHeadingsRegexp/; +use LatexIndent::Verbatim qw/%verbatimStorage/; use Data::Dumper; use Exporter qw/import/; our @EXPORT_OK = qw/find_file_contents_environments_and_preamble/; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm index b61ffc1bb47..bd909b2f60c 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm @@ -20,11 +20,11 @@ use warnings; use PerlIO::encoding; use open ':std', ':encoding(UTF-8)'; use File::Basename; # to get the filename and directory path -use Exporter qw/import/; -use Encode qw/decode/; +use Exporter qw/import/; +use Encode qw/decode/; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/%switches $is_check_switch_active/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Switches qw/%switches $is_check_switch_active/; +use LatexIndent::LogFile qw/$logger/; our @EXPORT_OK = qw/file_extension_check/; sub file_extension_check { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm index 6b97e617375..7f3f507076d 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm @@ -23,7 +23,7 @@ use YAML::Tiny; # interpret defaultSettings.yaml and other potential sett use File::Basename; # to get the filename and directory path use File::HomeDir; use Cwd; -use Exporter qw/import/; +use Exporter qw/import/; use LatexIndent::LogFile qw/$logger/; our @EXPORT_OK = qw/yaml_read_settings yaml_modify_line_breaks_settings yaml_get_indentation_settings_for_this_object yaml_poly_switch_get_every_or_custom_value yaml_get_indentation_information yaml_get_object_attribute_for_indentation_settings yaml_alignment_at_ampersand_settings %mainSettings %previouslyFoundSettings/; @@ -839,7 +839,7 @@ sub yaml_get_indentation_settings_for_this_object { } # log file information - $logger->trace("Settings for $name (stored for future use):") if $is_tt_switch_active; + $logger->trace("Settings for $name (stored for future use):") if $is_tt_switch_active; $logger->trace( Dump \%{ ${previouslyFoundSettings}{$storageName} } ) if $is_tt_switch_active; } diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm index 0a6366f8fa2..999fffb8eec 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm @@ -17,14 +17,14 @@ package LatexIndent::Heading; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Special qw/$specialBeginBasicRegExp/; -use Exporter qw/import/; -our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Special qw/$specialBeginBasicRegExp/; +use Exporter qw/import/; +our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_heading construct_headings_levels $allHeadingsRegexp/; our $headingCounter; our @headingsRegexpArray; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm index aec7cd365ef..5f7264a3085 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm @@ -17,9 +17,9 @@ package LatexIndent::HiddenChildren; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::LogFile qw/$logger/; use LatexIndent::GetYamlSettings qw/%mainSettings/; use Data::Dumper; use Exporter qw/import/; @@ -75,14 +75,14 @@ sub find_surrounding_indentation_for_children { # output to logfile $logger->trace("*FamilyTree before update:") if $is_tt_switch_active; - $logger->trace( Dumper( \%familyTree ) ) if ($is_tt_switch_active); + $logger->trace( Dumper( \%familyTree ) ) if ($is_tt_switch_active); # update the family tree with ancestors $self->update_family_tree; # output information to the logfile $logger->trace("*FamilyTree after update:") if $is_tt_switch_active; - $logger->trace( Dumper( \%familyTree ) ) if ($is_tt_switch_active); + $logger->trace( Dumper( \%familyTree ) ) if ($is_tt_switch_active); while ( my ( $idToSearch, $ancestorToSearch ) = each %familyTree ) { $logger->trace("*Hidden child ID: ,$idToSearch, here are its ancestors:") if $is_t_switch_active; @@ -204,7 +204,7 @@ sub check_for_hidden_children { # log file $logger->trace("*Hidden children check for ${$self}{name}") if $is_t_switch_active; - $logger->trace( join( "|", @matched ) ) if $is_t_switch_active; + $logger->trace( join( "|", @matched ) ) if $is_t_switch_active; my $naturalAncestors = ${$self}{naturalAncestors}; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/HorizontalWhiteSpace.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/HorizontalWhiteSpace.pm index 9582eeb6c53..a81405c1843 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/HorizontalWhiteSpace.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/HorizontalWhiteSpace.pm @@ -18,9 +18,9 @@ package LatexIndent::HorizontalWhiteSpace; use strict; use warnings; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use Exporter qw/import/; our @EXPORT_OK = qw/remove_trailing_whitespace remove_leading_space/; sub remove_trailing_whitespace { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm index ad7237240b4..453d0006893 100755 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm @@ -17,14 +17,14 @@ package LatexIndent::IfElseFi; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Heading qw/$allHeadingsRegexp/; -use Exporter qw/import/; -our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Heading qw/$allHeadingsRegexp/; +use Exporter qw/import/; +our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/; our $ifElseFiCounter; our $ifElseFiRegExp; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Indent.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Indent.pm index 23968069b0c..e852600bae7 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Indent.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Indent.pm @@ -17,11 +17,11 @@ package LatexIndent::Indent; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; -use LatexIndent::HiddenChildren qw/%familyTree/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::HiddenChildren qw/%familyTree/; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::LogFile qw/$logger/; use Text::Tabs; use Data::Dumper; use Exporter qw/import/; @@ -94,8 +94,8 @@ sub get_surrounding_indentation { $logger->trace( "ancestor ID: $newAncestorId, adding indentation of $newAncestorId to surroundingIndentation of ${$self}{id}" ) if ($is_t_switch_active); - $surroundingIndentation .= - ref( ${$_}{ancestorIndentation} ) eq 'SCALAR' + $surroundingIndentation + .= ref( ${$_}{ancestorIndentation} ) eq 'SCALAR' ? ( ${ ${$_}{ancestorIndentation} } ? ${ ${$_}{ancestorIndentation} } : q() ) : ( ${$_}{ancestorIndentation} ? ${$_}{ancestorIndentation} : q() ); } @@ -158,7 +158,7 @@ sub indent_body { { my $bodyFirstLine = $1; my $remainingBody = $2; - $logger->trace("first line of body: $bodyFirstLine") if $is_tt_switch_active; + $logger->trace("first line of body: $bodyFirstLine") if $is_tt_switch_active; $logger->trace("remaining body (before indentation):\n'$remainingBody'") if ($is_tt_switch_active); # add the indentation to all the body except first line @@ -292,7 +292,7 @@ sub indent_children_recursively { } $logger->trace('Pre-processed body:') if $is_tt_switch_active; - $logger->trace( ${$self}{body} ) if ($is_tt_switch_active); + $logger->trace( ${$self}{body} ) if ($is_tt_switch_active); # send the children through this indentation routine recursively if ( defined ${$self}{children} ) { @@ -471,7 +471,7 @@ sub replace_id_with_begin_body_end { # log file info $logger->trace("Body (${$self}{name}) now looks like:") if $is_tt_switch_active; - $logger->trace( ${$self}{body} ) if ($is_tt_switch_active); + $logger->trace( ${$self}{body} ) if ($is_tt_switch_active); # remove element from array: http://stackoverflow.com/questions/174292/what-is-the-best-way-to-delete-a-value-from-an-array-in-perl splice( @{ ${$self}{children} }, $index, 1 ); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm index 8fe50458524..458cb5bdd41 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm @@ -17,14 +17,14 @@ package LatexIndent::Item; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; -use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; -use LatexIndent::Heading qw/$allHeadingsRegexp/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; +use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; +use LatexIndent::Heading qw/$allHeadingsRegexp/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -32,6 +32,7 @@ our @EXPORT_OK = qw/find_items construct_list_of_items $listOfItems/; our $itemCounter; our $listOfItems = q(); our $itemRegExp; +our $itemCanBeFollowedBy; sub construct_list_of_items { my $self = shift; @@ -46,18 +47,18 @@ sub construct_list_of_items { # detail items in the log $logger->trace("*List of items: $listOfItems (see itemNames)") if $is_t_switch_active; - my $itemCanBeFollowedBy = qr/${${$mainSettings{fineTuning}}{items}}{canBeFollowedBy}/; + $itemCanBeFollowedBy = qr/${${$mainSettings{fineTuning}}{items}}{canBeFollowedBy}/; $itemRegExp = qr/ ( - \\((?:$listOfItems)(?:$itemCanBeFollowedBy)?(?!\S)) + \\((?:$listOfItems)(?:$itemCanBeFollowedBy)?(?![a-zA-Z0-9])) \h* (\R*)? ) ( (?: # cluster-only (), don't capture (?! - (?:\\(?:(?:$listOfItems)(?:$itemCanBeFollowedBy)?(?!\S))) # cluster-only (), don't capture + (?:\\(?:(?:$listOfItems)(?:$itemCanBeFollowedBy)?(?![a-zA-Z0-9]))) # cluster-only (), don't capture ). # any character, but not \\$item )* ) @@ -106,10 +107,11 @@ sub find_items { endImmediatelyFollowedByComment=>$5?0:($7?1:0), ); + ${$itemObject}{name} =~ s@$itemCanBeFollowedBy@@s; # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($itemObject); ${@{${$self}{children}}[-1]}{replacementText}.($6?$6:q()).($7?$7:q()); - /xseg; + /xse; } } diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/KeyEqualsValuesBraces.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/KeyEqualsValuesBraces.pm index 873a04adbe6..86846d8580d 100755 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/KeyEqualsValuesBraces.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/KeyEqualsValuesBraces.pm @@ -17,12 +17,12 @@ package LatexIndent::KeyEqualsValuesBraces; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use Exporter qw/import/; our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/construct_key_equals_values_regexp $key_equals_values_bracesRegExp $key_equals_values_bracesRegExpTrailingComment/; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm index f0510cac1f5..78271811477 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm @@ -17,11 +17,11 @@ package LatexIndent::Lines; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use Exporter qw/import/; -use LatexIndent::LogFile qw/$logger/; +use Exporter qw/import/; +use LatexIndent::LogFile qw/$logger/; use LatexIndent::Switches qw/%switches/; use LatexIndent::Verbatim qw/%verbatimStorage/; -our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 +our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/lines_body_selected_lines lines_verbatim_create_line_block/; sub lines_body_selected_lines { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm index 4e9064c937a..b72655b686c 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm @@ -19,11 +19,11 @@ use strict; use warnings; use FindBin; use File::Basename; # to get the filename and directory path -use File::Path qw(make_path); -use Exporter qw/import/; +use File::Path qw(make_path); +use Exporter qw/import/; use LatexIndent::Switches qw/%switches/; -use LatexIndent::Version qw/$versionNumber $versionDate/; -use Encode qw/decode/; +use LatexIndent::Version qw/$versionNumber $versionDate/; +use Encode qw/decode/; our @EXPORT_OK = qw/process_switches $logger/; our $logger; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm index 65982ba7b57..64ed21fa14f 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm @@ -17,13 +17,13 @@ package LatexIndent::MandatoryArgument; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; -use LatexIndent::Special qw/$specialBeginBasicRegExp/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; +use LatexIndent::Special qw/$specialBeginBasicRegExp/; +use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_mandatory_arguments get_mand_arg_reg_exp/; our $mandatoryArgumentCounter; @@ -38,7 +38,7 @@ sub find_mandatory_arguments { # log file output $logger->trace("*Mandatory argument found, body in ${$self}{name}") if $is_t_switch_active; - $logger->trace("(last argument)") if ( $9 eq '' and $is_t_switch_active ); + $logger->trace("(last argument)") if ( $9 eq '' and $is_t_switch_active ); ${$self}{body} =~ s/ $mandArgRegExp(\h*)($trailingCommentRegExp)*(.*) diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/ModifyLineBreaks.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/ModifyLineBreaks.pm index 35cb04d35ac..62737cc144c 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/ModifyLineBreaks.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/ModifyLineBreaks.pm @@ -17,14 +17,14 @@ package LatexIndent::ModifyLineBreaks; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use Exporter qw/import/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Tokens qw/%tokens/; +use Exporter qw/import/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; -use LatexIndent::Item qw/$listOfItems/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Verbatim qw/%verbatimStorage/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::Item qw/$listOfItems/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Verbatim qw/%verbatimStorage/; our @EXPORT_OK = qw/modify_line_breaks_body modify_line_breaks_end modify_line_breaks_end_after adjust_line_breaks_end_parent remove_line_breaks_begin verbatim_modify_line_breaks/; our $paragraphRegExp = q(); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm index 3d6dd70af69..fccf4b2022c 100755 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm @@ -17,12 +17,12 @@ package LatexIndent::NamedGroupingBracesBrackets; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use Exporter qw/import/; our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/construct_grouping_braces_brackets_regexp $grouping_braces_regexp $grouping_braces_regexpTrailingComment/; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm index 90dba063b95..877a5e97a7f 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm @@ -17,13 +17,13 @@ package LatexIndent::OptionalArgument; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; -use LatexIndent::Special qw/$specialBeginBasicRegExp/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; +use LatexIndent::Special qw/$specialBeginBasicRegExp/; +use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_optional_arguments/; our $optionalArgumentCounter; @@ -52,7 +52,7 @@ sub find_optional_arguments { # log file output $logger->trace("*Optional argument found, body in ${$self}{name}") if $is_t_switch_active; - $logger->trace("(last argument)") if ( $9 eq '' and $is_t_switch_active ); + $logger->trace("(last argument)") if ( $9 eq '' and $is_t_switch_active ); ${$self}{body} =~ s/ $optArgRegExp(\h*)($trailingCommentRegExp)*(.*) diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm index 7f835e6d0d5..69bad5535ee 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm @@ -17,13 +17,13 @@ package LatexIndent::Preamble; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::Switches qw/$is_t_switch_active $is_m_switch_active/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Switches qw/$is_t_switch_active $is_m_switch_active/; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Environment qw/$environmentBasicRegExp/; -use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; -use LatexIndent::Special qw/$specialBeginBasicRegExp/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Environment qw/$environmentBasicRegExp/; +use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; +use LatexIndent::Special qw/$specialBeginBasicRegExp/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our $preambleCounter; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Replacement.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Replacement.pm index 707010e9661..e864a968952 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Replacement.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Replacement.pm @@ -17,12 +17,12 @@ package LatexIndent::Replacement; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_rr_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use Exporter qw/import/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_rr_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/make_replacements/; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/RoundBrackets.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/RoundBrackets.pm index 9b6f4aa8dd8..9870fb948b5 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/RoundBrackets.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/RoundBrackets.pm @@ -17,10 +17,10 @@ package LatexIndent::RoundBrackets; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_round_brackets/; our $roundBracketCounter; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Sentence.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Sentence.pm index 3447d975c36..9a7f32e7dbe 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Sentence.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Sentence.pm @@ -17,16 +17,16 @@ package LatexIndent::Sentence; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Environment qw/$environmentBasicRegExp/; -use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; -use LatexIndent::Heading qw/$allHeadingsRegexp/; -use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; -use Exporter qw/import/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Environment qw/$environmentBasicRegExp/; +use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; +use LatexIndent::Heading qw/$allHeadingsRegexp/; +use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/; +use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/one_sentence_per_line/; our $sentenceCounter; @@ -104,7 +104,7 @@ sub one_sentence_per_line { } $logger->trace("Sentences follow regexp:") if $is_tt_switch_active; - $logger->trace($sentencesFollow) if $is_tt_switch_active; + $logger->trace($sentencesFollow) if $is_tt_switch_active; # # sentences BEGIN with @@ -186,7 +186,7 @@ sub one_sentence_per_line { # the OVERALL sentence regexp # $logger->trace("Overall sentences end with regexp:") if $is_tt_switch_active; - $logger->trace($sentencesEndWith) if $is_tt_switch_active; + $logger->trace($sentencesEndWith) if $is_tt_switch_active; $logger->trace("Finding sentences...") if $is_t_switch_active; @@ -210,11 +210,8 @@ sub one_sentence_per_line { $notWithinSentence .= "|" . qr/(?:\R?\\par)/s; } - # initiate the sentence counter - my @sentenceStorage; - - # make the sentence manipulation - ${$self}{body} =~ s/((?:$sentencesFollow)) + my $sentenceRegEx = qr/ + ((?:$sentencesFollow)) (\h*) (?!$notWithinSentence) ((?:$sentencesBeginWith).*?) @@ -222,7 +219,39 @@ sub one_sentence_per_line { (\h*)? # possibly followed by horizontal space (\R)? # possibly followed by a line break ($trailingCommentRegExp)? # possibly followed by trailing comments - / + /sx; + + if ( ref ${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentencesDoNOTcontain} eq 'HASH' + and defined ${ ${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentencesDoNOTcontain} }{other} ) + { + my $sentencesDoNOTcontain + = qr/${${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentencesDoNOTcontain}}{other}/; + + $sentenceRegEx = qr/ + ((?:$sentencesFollow)) + (\h*) + (?!$notWithinSentence) + ( + (?:$sentencesBeginWith) + (?: + (?! + $sentencesDoNOTcontain + ). + ) + *? + ) + ($sentencesEndWith) + (\h*)? # possibly followed by horizontal space + (\R)? # possibly followed by a line break + ($trailingCommentRegExp)? # possibly followed by trailing comments + /sx; + } + + # initiate the sentence counter + my @sentenceStorage; + + # make the sentence manipulation + ${$self}{body} =~ s/$sentenceRegEx/ my $beginning = $1; my $h_space = ($2?$2:q()); my $middle = $3; @@ -333,7 +362,7 @@ sub one_sentence_per_line { my $bodyFirstLine = $1; my $remainingBody = $2; my $indentation = ${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentenceIndent}; - $logger->trace("first line of sentence: $bodyFirstLine") if $is_tt_switch_active; + $logger->trace("first line of sentence: $bodyFirstLine") if $is_tt_switch_active; $logger->trace("remaining body (before indentation):\n'$remainingBody'") if ($is_tt_switch_active); # add the indentation to all the body except first line @@ -379,15 +408,15 @@ sub tasks_particular_to_each_object { # search for environments $logger->trace('looking for ENVIRONMENTS') if $is_t_switch_active; - $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s; + $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s; # search for ifElseFi blocks $logger->trace('looking for IFELSEFI') if $is_t_switch_active; - $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s; + $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s; # search for headings (part, chapter, section, setc) $logger->trace('looking for HEADINGS (chapter, section, part, etc)') if $is_t_switch_active; - $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s; + $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s; # the ordering of finding commands and special code blocks can change $self->find_commands_or_key_equals_values_braces_and_special @@ -410,7 +439,7 @@ sub indent_body { my $bodyFirstLine = $1; my $remainingBody = $2; my $indentation = ${$self}{indentation}; - $logger->trace("first line of sentence $bodyFirstLine") if $is_tt_switch_active; + $logger->trace("first line of sentence $bodyFirstLine") if $is_tt_switch_active; $logger->trace("remaining body (before indentation):\n'$remainingBody'") if ($is_tt_switch_active); # add the indentation to all the body except first line diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm index 331d5e87cf9..f68db3400ba 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm @@ -17,12 +17,12 @@ package LatexIndent::Special; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -114,11 +114,11 @@ sub construct_special_begin { # info to the log file $logger->trace("*The special beginnings regexp is: (see specialBeginEnd)") if $is_tt_switch_active; - $logger->trace($specialBegins) if $is_tt_switch_active; + $logger->trace($specialBegins) if $is_tt_switch_active; # overall special regexp $logger->trace("*The overall special regexp is: (see specialBeginEnd)") if $is_tt_switch_active; - $logger->trace($specialAllMatchesRegExp) if $is_tt_switch_active; + $logger->trace($specialAllMatchesRegExp) if $is_tt_switch_active; # basic special begin regexp $specialBeginBasicRegExp = qr/$specialBegins/; @@ -134,7 +134,7 @@ sub find_special { # otherwise loop through the special begin/end $logger->trace("*Searching ${$self}{name} for special begin/end (see specialBeginEnd)") if $is_t_switch_active; - $logger->trace( Dumper( \%{ $mainSettings{specialBeginEnd} } ) ) if $is_tt_switch_active; + $logger->trace( Dumper( \%{ $mainSettings{specialBeginEnd} } ) ) if $is_tt_switch_active; # keep looping as long as there is a special match of some kind while ( ${$self}{body} =~ m/$specialAllMatchesRegExp/sx ) { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Switches.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Switches.pm index 858e3519137..b7ff3b2998b 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Switches.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Switches.pm @@ -34,7 +34,7 @@ sub store_switches { my $self = shift; # copy document switches into hash local to this module - %switches = %{ ${$self}{switches} }; + %switches = %{ ${$self}{switches} }; $switches{version} = defined $switches{vversion} ? 1 : $switches{version}; $is_m_switch_active = defined $switches{modifyLineBreaks} ? $switches{modifyLineBreaks} : 0; $is_t_switch_active = defined $switches{trace} ? $switches{trace} : 0; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Tokens.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Tokens.pm index adea6481abc..6fbf008e12c 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Tokens.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Tokens.pm @@ -17,9 +17,9 @@ package LatexIndent::Tokens; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use Exporter qw/import/; +use Exporter qw/import/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::LogFile qw/$logger/; our @EXPORT_OK = qw/token_check %tokens/; # each of the tokens begins the same way -- this is exploited during the hidden Children routine diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/TrailingComments.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/TrailingComments.pm index 748d005f98e..9d6532500aa 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/TrailingComments.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/TrailingComments.pm @@ -17,10 +17,10 @@ package LatexIndent::TrailingComments; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @EXPORT_OK @@ -52,7 +52,7 @@ sub add_comment_symbol { { id => $tokens{trailingComment} . $commentCounter . $tokens{endOfToken}, value => $commentValue } ); # log file info - $logger->trace("*Updating trailing comment array") if $is_t_switch_active; + $logger->trace("*Updating trailing comment array") if $is_t_switch_active; $logger->trace( Dumper( \@trailingComments ), 'ttrace' ) if ($is_tt_switch_active); # the returned value diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm index bf7008a6b41..a42258bccc9 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm @@ -17,12 +17,12 @@ package LatexIndent::UnNamedGroupingBracesBrackets; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::GetYamlSettings qw/%mainSettings/; +use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use Exporter qw/import/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use Exporter qw/import/; our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/construct_unnamed_grouping_braces_brackets_regexp $un_named_grouping_braces_RegExp $un_named_grouping_braces_RegExp_trailing_comment/; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm index 8efbeaf8774..984c081f595 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm @@ -18,11 +18,11 @@ package LatexIndent::Verbatim; use strict; use warnings; use Data::Dumper; -use Exporter qw/import/; -use LatexIndent::Tokens qw/%tokens/; +use Exporter qw/import/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::GetYamlSettings qw/%mainSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; -use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; +use LatexIndent::LogFile qw/$logger/; our @EXPORT_OK = qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands find_verbatim_special verbatim_common_tasks %verbatimStorage/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -34,7 +34,7 @@ sub find_noindent_block { # noindent block $logger->trace('*Searching for NOINDENTBLOCK (see noIndentBlock)') if $is_t_switch_active; - $logger->trace( Dumper( \%{ $mainSettings{noIndentBlock} } ) ) if ($is_tt_switch_active); + $logger->trace( Dumper( \%{ $mainSettings{noIndentBlock} } ) ) if ($is_tt_switch_active); while ( my ( $noIndentBlock, $yesno ) = each %{ $mainSettings{noIndentBlock} } ) { # integrity check on the field for noIndentBlock @@ -182,7 +182,7 @@ sub find_verbatim_environments { # verbatim environments $logger->trace('*Searching for VERBATIM environments (see verbatimEnvironments)') if $is_t_switch_active; - $logger->trace( Dumper( \%{ $mainSettings{verbatimEnvironments} } ) ) if ($is_tt_switch_active); + $logger->trace( Dumper( \%{ $mainSettings{verbatimEnvironments} } ) ) if ($is_tt_switch_active); while ( my ( $verbEnv, $yesno ) = each %{ $mainSettings{verbatimEnvironments} } ) { my $verbEnvSpec; @@ -281,7 +281,7 @@ sub find_verbatim_commands { # verbatim commands need to be put back in *after* trailing comments have been put # back in $logger->trace('*Searching for VERBATIM commands (see verbatimCommands)') if $is_t_switch_active; - $logger->trace( Dumper( \%{ $mainSettings{verbatimCommands} } ) ) if ($is_tt_switch_active); + $logger->trace( Dumper( \%{ $mainSettings{verbatimCommands} } ) ) if ($is_tt_switch_active); while ( my ( $verbCommand, $yesno ) = each %{ $mainSettings{verbatimCommands} } ) { my $verbCommandSpec; @@ -486,7 +486,7 @@ sub put_verbatim_back_in { # count the number of non-command verbatim objects while ( my ( $key, $child ) = each %verbatimStorage ) { ${$child}{type} = "environment" if !( defined ${$child}{type} ); - $verbatimCount++ if ( $toMatch =~ m/${$child}{type}/ ); + $verbatimCount++ if ( $toMatch =~ m/${$child}{type}/ ); } return unless ( $verbatimCount > 0 ); @@ -535,7 +535,7 @@ sub put_verbatim_back_in { ${$self}{body} =~ s/$verbatimID/${$child}{begin}${$child}{body}${$child}{end}/s; # log file info - $logger->trace('Body now looks like:') if $is_tt_switch_active; + $logger->trace('Body now looks like:') if $is_tt_switch_active; $logger->trace( ${$self}{body}, 'ttrace' ) if ($is_tt_switch_active); # delete the child so it won't be operated upon again @@ -565,7 +565,7 @@ sub put_verbatim_back_in { # logfile info $logger->trace('*Post-processed body:') if $is_tt_switch_active; - $logger->trace( ${$self}{body} ) if ($is_tt_switch_active); + $logger->trace( ${$self}{body} ) if ($is_tt_switch_active); } } return; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index eb1bfbe1431..9b6fbc7272b 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm @@ -20,6 +20,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.22.2'; -our $versionDate = '2023-07-14'; +our $versionNumber = '3.23'; +our $versionDate = '2023-09-09'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm index 6b545c7e28d..c7dbd097656 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm @@ -18,14 +18,14 @@ package LatexIndent::Wrap; use strict; use warnings; use Text::Wrap; -use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::Tokens qw/%tokens/; use LatexIndent::AlignmentAtAmpersand qw/get_column_width/; -use LatexIndent::TrailingComments qw/$trailingCommentRegExp @trailingComments/; -use LatexIndent::GetYamlSettings qw/%mainSettings %previouslyFoundSettings/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; -use LatexIndent::LogFile qw/$logger/; -use LatexIndent::Verbatim qw/%verbatimStorage/; -use Exporter qw/import/; +use LatexIndent::TrailingComments qw/$trailingCommentRegExp @trailingComments/; +use LatexIndent::GetYamlSettings qw/%mainSettings %previouslyFoundSettings/; +use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; +use LatexIndent::LogFile qw/$logger/; +use LatexIndent::Verbatim qw/%verbatimStorage/; +use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/text_wrap text_wrap_comment_blocks/; our $sentenceCounter; diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index de0c1335ca5..f55bf5202d6 100755 --- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml +++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml @@ -1,5 +1,5 @@ # -# latexindent.pl, version 3.22.2, 2023-07-14 +# latexindent.pl, version 3.23, 2023-09-09 # # defaultSettings.yaml, the default settings for latexindent.pl # @@ -525,6 +525,8 @@ modifyLineBreaks: exclamationMark: 1 # 0/1 questionMark: 1 # 0/1 other: 0 # regex + sentencesDoNOTcontain: + other: \\begin # regex textWrapOptions: columns: 0 multipleSpacesToSingle: 1 @@ -559,11 +561,11 @@ modifyLineBreaks: BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 EndStartsOnOwnLine: 0 # -1,0,1,2,3,4 EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - equation*: - BeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 - BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - EndStartsOnOwnLine: 0 # -1,0,1,2,3,4 - EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + ## equation*: + ## BeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ## BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ## EndStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ## EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 ifElseFi: IfStartsOnOwnLine: 0 # -1,0,1,2,3,4 BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 @@ -573,15 +575,15 @@ modifyLineBreaks: ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4 FiStartsOnOwnLine: 0 # -1,0,1,2,3,4 FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - ifnum: - IfStartsOnOwnLine: 0 # -1,0,1,2,3,4 - BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - OrStartsOnOwnLine: 0 # -1,0,1,2,3,4 - OrFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - ElseStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - FiStartsOnOwnLine: 0 # -1,0,1,2,3,4 - FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + ## ifnum: + ## IfStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ## BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ## OrStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ## OrFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + ## ElseStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ## ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + ## FiStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ## FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4 commands: CommandStartsOnOwnLine: 0 CommandNameFinishesWithLineBreak: 0 diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl index 61ee1131b4d..571dbcbd260 100755 --- a/Master/texmf-dist/scripts/latexindent/latexindent.pl +++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# latexindent.pl, version 3.22.2, 2023-07-14 +# latexindent.pl, version 3.23, 2023-09-09 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by |