-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsepran_style.pm
53 lines (40 loc) · 1.1 KB
/
sepran_style.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright (C) 2009-2010 Planbureau voor de Leefomgeving (PBL)
#
# full notice can be found in LICENSE
package sepran_style;
require 5.003;
use strict;
use warnings;
sub process_description($){};
sub line($$$$)
{
my $package = shift;
my $i = shift;
my $name = shift;
my $source = shift;
my $idebug = 0;
my $descr = '';
my $line = $$source[$i];
print "$package: LINE '$line'\n".
" NAME '$name'\n" if ($idebug>=1);
if ($line =~ /(^! +$name +)(.*) *$/i) {
print "$package: found line '$line'\n" if ($idebug>=2);
my $spaces = "$1";
$descr = "$2";
print "$name: found description: '$descr'\n" if ($idebug);
$i++;
print "$line$$source[$i]$spaces|\n" if ($idebug>=2);
$spaces = '!' . ' ' x (length($spaces) - 1);
while ($i < @$source) {
if ($$source[$i] =~ /^$spaces *(.*) *$/) {
$descr .= "\n$1";
} else { last }
$i++;
}
$descr =~ s/[\r]//g;
print "complete description for $name : '$descr'\n"
if ($idebug>=1);
}
return ($i, $descr);
}
1;