summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-04-28 21:57:31 +0000
committerKarl Berry <karl@freefriends.org>2018-04-28 21:57:31 +0000
commit1d47aeb4b6825139fc0f32c3549fbdf3fef6bb5c (patch)
tree13c5e17fc806f1d51e1d1a91c14b16e6a30b4fbb /Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm
parentb14146667f4cd6cbc5d5821c88e47096df3c78b5 (diff)
latexindent (28apr18)
git-svn-id: svn://tug.org/texlive/trunk@47471 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm')
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm17
1 files changed, 9 insertions, 8 deletions
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm
index fc6cab0c33a..8c8b5af38f1 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Arguments.pm
@@ -235,19 +235,20 @@ sub get_arguments_regexp{
# commands are allowed strings between arguments, e.g node, decoration, etc, specified in stringsAllowedBetweenArguments
my $stringsBetweenArguments = q();
- if(defined ${input}{stringBetweenArguments} and ${input}{stringBetweenArguments}==1){
+ if(defined ${input}{stringBetweenArguments} and ${input}{stringBetweenArguments}==1
+ and ref(${$masterSettings{commandCodeBlocks}}{stringsAllowedBetweenArguments}) eq "ARRAY"){
# grab the strings allowed between arguments
- my %stringsAllowedBetweenArguments = %{${$masterSettings{commandCodeBlocks}}{stringsAllowedBetweenArguments}};
+ my @stringsAllowedBetweenArguments = @{${$masterSettings{commandCodeBlocks}}{stringsAllowedBetweenArguments}};
- while( my ($allowedStringName,$allowedStringValue)= each %stringsAllowedBetweenArguments){
- # change + and - to escaped characters
- $allowedStringName =~ s/\+/\\+/g;
- $allowedStringName =~ s/\-/\\-/g;
+ $logger->trace("*Looping through array for commandCodeBlocks->stringsAllowedBetweenArguments") if $is_t_switch_active ;
- # form the regexp
- $stringsBetweenArguments .= ($stringsBetweenArguments eq '' ? q() : "|").$allowedStringName if $allowedStringValue;
+ # note that the zero'th element in this array contains the amalgamate switch, which we don't want!
+ foreach (@stringsAllowedBetweenArguments[1 .. $#stringsAllowedBetweenArguments]) {
+ $logger->trace("$_") if $is_t_switch_active ;
+ $stringsBetweenArguments .= ($stringsBetweenArguments eq ""?q():"|").$_;
}
+ $stringsBetweenArguments = qr/$stringsBetweenArguments/;
# report to log file
$logger->trace("*Strings allowed between arguments: $stringsBetweenArguments (see stringsAllowedBetweenArguments)") if $is_t_switch_active;
}