>From 3a6f1d8ea52b05c8b790e27bc7a9bf73cbda2555 Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Wed, 31 Oct 2018 07:38:43 +0900 Subject: [PATCH 1/8] reorder_ltms.pl: Add 'locationslabel=' option to \end[snippet] Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- utilities/reorder_ltms.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/utilities/reorder_ltms.pl b/utilities/reorder_ltms.pl index d4770d0..9999c29 100755 --- a/utilities/reorder_ltms.pl +++ b/utilities/reorder_ltms.pl @@ -47,6 +47,7 @@ my $end_command; my $lnlbl_command; my $lnlbl_on_exists = ""; my $lnlbl_on_filter = ""; +my $lnlbl_on_locations = ""; my $status = 0; # 0: just started, 1: first_line read; 2: begin line output, # 3: end line read @@ -58,6 +59,9 @@ while($line = <>) { } elsif ($line =~ /filter/) { chomp $line; print $line . $lnlbl_on_filter . "\n"; + } elsif ($line =~ /locations/) { + chomp $line; + print $line . $lnlbl_on_locations . "\n"; } else { print $line; } @@ -87,6 +91,9 @@ while($line = <>) { if ($line =~ /filterlabel=([^\],]+)/) { $lnlbl_on_filter = "//\\lnlbl\{$1\}"; } + if ($line =~ /locationslabel=([^\],]+)/) { + $lnlbl_on_locations = "//\\lnlbl\{$1\}"; + } $status = 3; next; } else { @@ -95,6 +102,11 @@ while($line = <>) { s/\\lnlbl\[([^\]]*)\]/\\lnlbl\{$1\}/ ; $line = $_ ; } + if ($line =~ /\(\*\s*\\lnlbl\{[^\}]*\}\s*\*\)/) { + $_ = $line ; + s/\(\*\s*(\\lnlbl\{[^\}]*\})\s*\*\)/\/\/$1/ ; + $line = $_ ; + } print $line ; } } elsif ($status == 3) { @@ -104,6 +116,9 @@ while($line = <>) { } elsif ($line =~ /filter/) { chomp $line; print $line . $lnlbl_on_filter . "\n"; + } elsif ($line =~ /locations/) { + chomp $line; + print $line . $lnlbl_on_locations . "\n"; } else { print $line ; } -- 2.7.4