summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-01-13 22:26:56 +0000
committerKarl Berry <karl@freefriends.org>2018-01-13 22:26:56 +0000
commit8321808ed1278e2b4fc5e6d58fcb1acecc4155c0 (patch)
tree3a919f39d8a823b139635052cb15b83bdbdfc8ef /Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
parent4cc1370e31979d579fabb2561b6de643adde68d9 (diff)
latexindent (13jan18)
git-svn-id: svn://tug.org/texlive/trunk@46303 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm')
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm23
1 files changed, 13 insertions, 10 deletions
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
index d5a751f9e0e..461c620e53f 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
@@ -20,6 +20,7 @@ use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::GetYamlSettings qw/%masterSettings/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
@@ -83,7 +84,7 @@ sub construct_special_begin{
/sx
} else {
- $self->logger("The special regexps won't include anything from $specialName (see lookForThis)",'heading') if $is_t_switch_active ;
+ $logger->trace("*The special regexps won't include anything from $specialName (see lookForThis)") if $is_t_switch_active ;
}
}
@@ -94,10 +95,12 @@ sub construct_special_begin{
}
# info to the log file
- $self->logger("The special beginnings regexp is: $specialBegins (see specialBeginEnd)",'heading') if $is_t_switch_active;
+ $logger->trace("*The special beginnings regexp is: (see specialBeginEnd)") if $is_tt_switch_active;
+ $logger->trace($specialBegins) if $is_tt_switch_active;
# overall special regexp
- $self->logger("The overall special regexp is: $specialAllMatchesRegExp(see specialBeginEnd)",'heading') if $is_t_switch_active;
+ $logger->trace("*The overall special regexp is: (see specialBeginEnd)") if $is_tt_switch_active;
+ $logger->trace($specialAllMatchesRegExp) if $is_tt_switch_active;
}
@@ -108,8 +111,8 @@ sub find_special{
return if($specialBegins eq "");
# otherwise loop through the special begin/end
- $self->logger("Searching for special begin/end (see specialBeginEnd)") if $is_t_switch_active ;
- $self->logger(Dumper(\%{$masterSettings{specialBeginEnd}})) if $is_tt_switch_active;
+ $logger->trace("*Searching ${$self}{name} for special begin/end (see specialBeginEnd)") if $is_t_switch_active ;
+ $logger->trace(Dumper(\%{$masterSettings{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){
@@ -119,9 +122,9 @@ sub find_special{
# log file
if((ref($BeginEnd) eq "HASH") and ${$BeginEnd}{lookForThis}){
- $self->logger("Looking for $specialName",'heading') if $is_t_switch_active ;
+ $logger->trace("Looking for $specialName") if $is_t_switch_active ;
} else {
- $self->logger("Not looking for $specialName (see lookForThis)",'heading') if ($is_t_switch_active and (ref($BeginEnd) eq "HASH"));
+ $logger->trace("Not looking for $specialName (see lookForThis)") if ($is_t_switch_active and (ref($BeginEnd) eq "HASH"));
next;
}
@@ -134,9 +137,6 @@ sub find_special{
${$self}{body} =~ s/
$specialRegExp(\h*)($trailingCommentRegExp)?
/
- # log file output
- $self->logger("special found: $specialName",'heading') if $is_t_switch_active;
-
# create a new special object
my $specialObject = LatexIndent::Special->new(begin=>$1,
body=>$3,
@@ -162,6 +162,9 @@ sub find_special{
horizontalTrailingSpace=>$6?$6:q(),
);
+ # log file output
+ $logger->trace("*Special found: $specialName",'heading') if $is_t_switch_active;
+
# the settings and storage of most objects has a lot in common
$self->get_settings_and_store_new_object($specialObject);
${@{${$self}{children}}[-1]}{replacementText}.($8?$8:q()).($9?$9:q());