File: util.pl

package info (click to toggle)
libparse-recdescent-perl 1.967015%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 764 kB
  • sloc: perl: 6,797; makefile: 13; ansic: 9
file content (22 lines) | stat: -rw-r--r-- 590 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
sub make_itempos_text
{
    my ($item, $itempos) = @_;

    join("\n",
         '',
         (
             map {
                 my $i = $_;
                 join(' ', sprintf("%-10s",ref $item->[$i] ? '_REF_' : $item->[$i]),
                      map {
                          my $type = $_;
                          map {
                              sprintf("%s.%s=%3d", $type, $_, $itempos->[$i]{$type}{$_})
                          } qw(from to)
                      } qw(offset line column));
             } (1..$#$item),
         ),
         '');
}

1;