1 # Copyright (C) 2020 Free Software Foundation
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 if (scalar (my (@line) = /^([A-Z]+)(\d+)([^"]+")( *)([^%"]*)(%?")$/) == 6) {
26 if (defined ($prev[0])
27 && $line[0] eq $prev[0]
28 && $line[1] == $prev[1] + 1
29 && $line[2] eq $prev[2]
30 && $line[5] eq $prev[5]) {
31 if ($line[3] eq " $prev[3]"
32 && $line[4] eq $prev[4]) {
36 } elsif ($line[3] eq $prev[3]
37 && length ($line[4]) == length ($prev[4]) + 1
38 && $prev[4] eq substr ($line[4], 0, length ($line[4]) - 1)) {
41 $suffix .= substr ($line[4], -1);
42 } elsif ($line[3] eq $prev[3]
43 && $prev[4] eq substr ($line[4], 1)) {
46 $prefix .= substr ($line[4], 0, 1);