line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#regroup.pm
|
2
|
|
|
|
|
|
|
#Last Change: 2009-01-19
|
3
|
|
|
|
|
|
|
#Copyright (c) 2009 Marc-Seabstian "Maluku" Lucksch
|
4
|
|
|
|
|
|
|
#Version 0.8
|
5
|
|
|
|
|
|
|
####################
|
6
|
|
|
|
|
|
|
#This file is part of the Dotiac::DTL project.
|
7
|
|
|
|
|
|
|
#http://search.cpan.org/perldoc?Dotiac::DTL
|
8
|
|
|
|
|
|
|
#
|
9
|
|
|
|
|
|
|
#regroup.pm is published under the terms of the MIT license, which basically
|
10
|
|
|
|
|
|
|
#means "Do with it whatever you want". For more information, see the
|
11
|
|
|
|
|
|
|
#license.txt file that should be enclosed with libsofu distributions. A copy of
|
12
|
|
|
|
|
|
|
#the license is (at the time of writing) also available at
|
13
|
|
|
|
|
|
|
#http://www.opensource.org/licenses/mit-license.php .
|
14
|
|
|
|
|
|
|
###############################################################################
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
package Dotiac::DTL::Tag::regroup;
|
17
|
11
|
|
|
11
|
|
63
|
use base qw/Dotiac::DTL::Tag/;
|
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
1782
|
|
18
|
11
|
|
|
11
|
|
66
|
use strict;
|
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
358
|
|
19
|
11
|
|
|
11
|
|
53
|
use warnings;
|
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
259
|
|
20
|
11
|
|
|
11
|
|
56
|
use Scalar::Util;
|
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
29704
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = 0.8;
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new {
|
25
|
2
|
|
|
2
|
1
|
5
|
my $class=shift;
|
26
|
2
|
|
|
|
|
8
|
my $self={p=>shift()};
|
27
|
2
|
|
|
|
|
7
|
bless $self,$class;
|
28
|
2
|
|
|
|
|
11
|
my %name = Dotiac::DTL::get_variables(shift(),"as","by");
|
29
|
2
|
50
|
33
|
|
|
18
|
die "Can't use regroup without a variable" unless $name{""} and $name{""}->[0];
|
30
|
2
|
50
|
33
|
|
|
29
|
die "Can't use regroup without a property" unless $name{by} and $name{by}->[0];
|
31
|
2
|
50
|
33
|
|
|
17
|
die "Can't use regroup without a new variable name" unless $name{as} and $name{as}->[0];
|
32
|
2
|
|
|
|
|
18
|
$self->{source}=$name{""}->[0];
|
33
|
2
|
|
|
|
|
7
|
$self->{property}=$name{by}->[0];
|
34
|
2
|
|
|
|
|
6
|
$self->{var}=$name{as}->[0];
|
35
|
2
|
|
|
|
|
12
|
return $self;
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
sub print {
|
38
|
2
|
|
|
2
|
1
|
5
|
my $self=shift;
|
39
|
2
|
|
|
|
|
10
|
my $var = Dotiac::DTL::devar_content($self->{source},@_);
|
40
|
2
|
|
|
|
|
8
|
my $r = Scalar::Util::reftype($var);
|
41
|
2
|
|
|
|
|
5
|
my @data=($var);
|
42
|
2
|
50
|
|
|
|
9
|
@data=values %{$var} if $r eq "HASH";
|
|
0
|
|
|
|
|
0
|
|
43
|
2
|
50
|
|
|
|
7
|
@data=@{$var} if $r eq "ARRAY";
|
|
2
|
|
|
|
|
9
|
|
44
|
2
|
|
|
|
|
5
|
my %data;
|
45
|
|
|
|
|
|
|
my @ret;
|
46
|
2
|
|
|
|
|
4
|
my $vars=shift;
|
47
|
2
|
|
|
|
|
4
|
my $escape=shift;
|
48
|
2
|
|
|
|
|
5
|
foreach my $e (@data) {
|
49
|
8
|
|
|
|
|
12
|
my $g="";
|
50
|
8
|
50
|
|
|
|
26
|
if (substr($self->{property},0,1) eq "`") {
|
51
|
0
|
|
|
|
|
0
|
$g=Dotiac::DTL::devar_var("foo.".Dotiac::DTL::devar($self->{property},$vars,0,@_),{foo=>$e},0,@_)->string();
|
52
|
|
|
|
|
|
|
}
|
53
|
|
|
|
|
|
|
else {
|
54
|
8
|
|
|
|
|
13
|
$g=Dotiac::DTL::devar("foo.".$self->{property},{%{$vars},foo=>$e},0,@_);
|
|
8
|
|
|
|
|
44
|
|
55
|
|
|
|
|
|
|
}
|
56
|
8
|
50
|
|
|
|
30
|
next unless $g;
|
57
|
8
|
|
|
|
|
14
|
my $list = $data{$g};
|
58
|
8
|
100
|
|
|
|
19
|
unless ($list) {
|
59
|
6
|
|
|
|
|
13
|
$list=[];
|
60
|
6
|
|
|
|
|
28
|
push @ret,{grouper=>$g,list=>$list} ;
|
61
|
6
|
|
|
|
|
15
|
$data{$g}=$list;
|
62
|
|
|
|
|
|
|
}
|
63
|
8
|
|
|
|
|
21
|
push @$list,$e;
|
64
|
|
|
|
|
|
|
}
|
65
|
2
|
|
|
|
|
8
|
$vars->{$self->{var}}=\@ret;
|
66
|
2
|
|
|
|
|
5
|
print $self->{p};
|
67
|
2
|
|
|
|
|
14
|
$self->{n}->print($vars,$escape,@_);
|
68
|
|
|
|
|
|
|
}
|
69
|
|
|
|
|
|
|
sub string {
|
70
|
2
|
|
|
2
|
1
|
4
|
my $self=shift;
|
71
|
2
|
|
|
|
|
128
|
my $var = Dotiac::DTL::devar_content($self->{source},@_);
|
72
|
2
|
|
|
|
|
7
|
my $r = Scalar::Util::reftype($var);
|
73
|
2
|
|
|
|
|
6
|
my @data=($var);
|
74
|
2
|
50
|
|
|
|
7
|
@data=values %{$var} if $r eq "HASH";
|
|
0
|
|
|
|
|
0
|
|
75
|
2
|
50
|
|
|
|
7
|
@data=@{$var} if $r eq "ARRAY";
|
|
2
|
|
|
|
|
8
|
|
76
|
2
|
|
|
|
|
4
|
my %data;
|
77
|
|
|
|
|
|
|
my @ret;
|
78
|
2
|
|
|
|
|
6
|
my $vars=shift;
|
79
|
2
|
|
|
|
|
2
|
my $escape=shift;
|
80
|
2
|
|
|
|
|
5
|
foreach my $e (@data) {
|
81
|
8
|
|
|
|
|
12
|
my $g="";
|
82
|
8
|
50
|
|
|
|
25
|
if (substr($self->{property},0,1) eq "`") {
|
83
|
0
|
|
|
|
|
0
|
$g=Dotiac::DTL::devar_var("foo.".Dotiac::DTL::devar($self->{property},$vars,0,@_),{foo=>$e},0,@_)->string();
|
84
|
|
|
|
|
|
|
}
|
85
|
|
|
|
|
|
|
else {
|
86
|
8
|
|
|
|
|
17
|
$g=Dotiac::DTL::devar("foo.".$self->{property},{%{$vars},foo=>$e},0,@_);
|
|
8
|
|
|
|
|
45
|
|
87
|
|
|
|
|
|
|
}
|
88
|
8
|
50
|
|
|
|
27
|
next unless $g;
|
89
|
8
|
|
|
|
|
14
|
my $list = $data{$g};
|
90
|
8
|
100
|
|
|
|
16
|
unless ($list) {
|
91
|
6
|
|
|
|
|
10
|
$list=[];
|
92
|
6
|
|
|
|
|
21
|
push @ret,{grouper=>$g,list=>$list} ;
|
93
|
6
|
|
|
|
|
14
|
$data{$g}=$list;
|
94
|
|
|
|
|
|
|
}
|
95
|
8
|
|
|
|
|
20
|
push @$list,$e;
|
96
|
|
|
|
|
|
|
}
|
97
|
2
|
|
|
|
|
9
|
$vars->{$self->{var}}=\@ret;
|
98
|
2
|
|
|
|
|
11
|
return $self->{p}.$self->{n}->string($vars,$escape,@_);
|
99
|
|
|
|
|
|
|
}
|
100
|
|
|
|
|
|
|
sub perl {
|
101
|
2
|
|
|
2
|
1
|
8
|
my $self=shift;
|
102
|
2
|
|
|
|
|
6
|
my $fh=shift;
|
103
|
2
|
|
|
|
|
4
|
my $id=shift;
|
104
|
2
|
|
|
|
|
19
|
$self->SUPER::perl($fh,$id,@_);
|
105
|
2
|
|
|
|
|
5
|
print $fh "my ";
|
106
|
2
|
|
|
|
|
16
|
print $fh (Data::Dumper->Dump([$self->{var}],["\$varname$id"]));
|
107
|
2
|
|
|
|
|
83
|
print $fh "my ";
|
108
|
2
|
|
|
|
|
15
|
print $fh (Data::Dumper->Dump([$self->{property}],["\$property$id"]));
|
109
|
2
|
|
|
|
|
179
|
print $fh "my ";
|
110
|
2
|
|
|
|
|
14
|
print $fh (Data::Dumper->Dump([$self->{source}],["\$source$id"]));
|
111
|
2
|
50
|
|
|
|
94
|
return $self->{n}->perl($fh,$id+1,@_) if $self->{n};
|
112
|
0
|
|
|
|
|
0
|
return $id;
|
113
|
|
|
|
|
|
|
}
|
114
|
|
|
|
|
|
|
sub perlprint {
|
115
|
2
|
|
|
2
|
1
|
4
|
my $self=shift;
|
116
|
2
|
|
|
|
|
12
|
my $fh=shift;
|
117
|
2
|
|
|
|
|
3
|
my $id=shift;
|
118
|
2
|
|
|
|
|
5
|
my $level=shift;
|
119
|
2
|
|
|
|
|
6
|
my $in="\t" x $level;
|
120
|
2
|
|
|
|
|
16
|
$self->SUPER::perlprint($fh,$id,$level,@_);
|
121
|
2
|
|
|
|
|
8
|
print $fh $in,"my \$var$id = Dotiac::DTL::devar_content(\$source$id,\$vars,\$escape,\@_);\n";
|
122
|
2
|
|
|
|
|
6
|
print $fh $in,"my \$r$id = Scalar::Util::reftype(\$var$id);\n";
|
123
|
2
|
|
|
|
|
7
|
print $fh $in,"my \@data$id=(\$var$id);\n";
|
124
|
2
|
|
|
|
|
8
|
print $fh $in,"\@data$id=values \%{\$var$id} if \$r$id eq \"HASH\";\n";
|
125
|
2
|
|
|
|
|
7
|
print $fh $in,"\@data$id=\@{\$var$id} if \$r$id eq \"ARRAY\";\n";
|
126
|
2
|
|
|
|
|
6
|
print $fh $in,"my \%data$id;\n";
|
127
|
2
|
|
|
|
|
4
|
print $fh $in,"my \@ret$id;\n";
|
128
|
2
|
|
|
|
|
6
|
print $fh $in,"foreach my \$e (\@data$id) {\n";
|
129
|
2
|
|
|
|
|
4
|
print $fh $in,"\tmy \$g=\"\";\n";
|
130
|
2
|
|
|
|
|
5
|
print $fh $in,"\tif (substr(\$property$id,0,1) eq \"`\") {\n";
|
131
|
2
|
|
|
|
|
4
|
print $fh $in,"\t\t\$g=Dotiac::DTL::devar_var(\"foo.\".Dotiac::DTL::devar(\$property$id,\$vars,0,\@_),{foo=>\$e},0,\@_)->string();\n";
|
132
|
2
|
|
|
|
|
5
|
print $fh $in,"\t} else {\n";
|
133
|
2
|
|
|
|
|
4
|
print $fh $in,"\t\t\$g=Dotiac::DTL::devar(\"foo.\".\$property$id,{\%{\$vars},foo=>\$e},0,\@_);\n";
|
134
|
2
|
|
|
|
|
4
|
print $fh $in,"\t}\n";
|
135
|
2
|
|
|
|
|
5
|
print $fh $in,"\tnext unless \$g;\n";
|
136
|
2
|
|
|
|
|
5
|
print $fh $in,"\tmy \$list = \$data$id"."{\$g};\n";
|
137
|
2
|
|
|
|
|
3
|
print $fh $in,"\tunless (\$list) {\n";
|
138
|
2
|
|
|
|
|
4
|
print $fh $in,"\t\t\$list=[];\n";
|
139
|
2
|
|
|
|
|
5
|
print $fh $in,"\t\tpush \@ret$id,{grouper=>\$g,list=>\$list} ;\n";
|
140
|
2
|
|
|
|
|
6
|
print $fh $in,"\t\t\$data$id"."{\$g}=\$list;\n";
|
141
|
2
|
|
|
|
|
3
|
print $fh $in,"\t}\n";
|
142
|
2
|
|
|
|
|
4
|
print $fh $in,"\tpush \@\$list,\$e;\n";
|
143
|
2
|
|
|
|
|
4
|
print $fh $in,"}\n";
|
144
|
2
|
|
|
|
|
10
|
print $fh $in,"\$vars->{\$varname$id}=\\\@ret$id;\n";
|
145
|
2
|
|
|
|
|
14
|
return $self->{n}->perlprint($fh,$id+1,$level,@_);
|
146
|
|
|
|
|
|
|
}
|
147
|
|
|
|
|
|
|
sub perlstring {
|
148
|
2
|
|
|
2
|
1
|
5
|
my $self=shift;
|
149
|
2
|
|
|
|
|
5
|
my $fh=shift;
|
150
|
2
|
|
|
|
|
4
|
my $id=shift;
|
151
|
2
|
|
|
|
|
5
|
my $level=shift;
|
152
|
2
|
|
|
|
|
6
|
my $in="\t" x $level;
|
153
|
2
|
|
|
|
|
16
|
$self->SUPER::perlstring($fh,$id,$level,@_);
|
154
|
2
|
|
|
|
|
10
|
print $fh $in,"my \$var$id = Dotiac::DTL::devar_content(\$source$id,\$vars,\$escape,\@_);\n";
|
155
|
2
|
|
|
|
|
8
|
print $fh $in,"my \$r$id = Scalar::Util::reftype(\$var$id);\n";
|
156
|
2
|
|
|
|
|
6
|
print $fh $in,"my \@data$id=(\$var$id);\n";
|
157
|
2
|
|
|
|
|
95
|
print $fh $in,"\@data$id=values \%{\$var$id} if \$r$id eq \"HASH\";\n";
|
158
|
2
|
|
|
|
|
8
|
print $fh $in,"\@data$id=\@{\$var$id} if \$r$id eq \"ARRAY\";\n";
|
159
|
2
|
|
|
|
|
19
|
print $fh $in,"my \%data$id;\n";
|
160
|
2
|
|
|
|
|
6
|
print $fh $in,"my \@ret$id;\n";
|
161
|
2
|
|
|
|
|
54
|
print $fh $in,"foreach my \$e (\@data$id) {\n";
|
162
|
2
|
|
|
|
|
3
|
print $fh $in,"\tmy \$g=\"\";\n";
|
163
|
2
|
|
|
|
|
6
|
print $fh $in,"\tif (substr(\$property$id,0,1) eq \"`\") {\n";
|
164
|
2
|
|
|
|
|
7
|
print $fh $in,"\t\t\$g=Dotiac::DTL::devar_var(\"foo.\".Dotiac::DTL::devar(\$property$id,\$vars,0,\@_),{foo=>\$e},0,\@_)->string();\n";
|
165
|
2
|
|
|
|
|
3
|
print $fh $in,"\t} else {\n";
|
166
|
2
|
|
|
|
|
7
|
print $fh $in,"\t\t\$g=Dotiac::DTL::devar(\"foo.\".\$property$id,{\%{\$vars},foo=>\$e},0,\@_);\n";
|
167
|
2
|
|
|
|
|
5
|
print $fh $in,"\t}\n";
|
168
|
2
|
|
|
|
|
5
|
print $fh $in,"\tnext unless \$g;\n";
|
169
|
2
|
|
|
|
|
6
|
print $fh $in,"\tmy \$list = \$data$id"."{\$g};\n";
|
170
|
2
|
|
|
|
|
5
|
print $fh $in,"\tunless (\$list) {\n";
|
171
|
2
|
|
|
|
|
4
|
print $fh $in,"\t\t\$list=[];\n";
|
172
|
2
|
|
|
|
|
7
|
print $fh $in,"\t\tpush \@ret$id,{grouper=>\$g,list=>\$list} ;\n";
|
173
|
2
|
|
|
|
|
5
|
print $fh $in,"\t\t\$data$id"."{\$g}=\$list;\n";
|
174
|
2
|
|
|
|
|
5
|
print $fh $in,"\t}\n";
|
175
|
2
|
|
|
|
|
4
|
print $fh $in,"\tpush \@\$list,\$e;\n";
|
176
|
2
|
|
|
|
|
4
|
print $fh $in,"}\n";
|
177
|
2
|
|
|
|
|
6
|
print $fh $in,"\$vars->{\$varname$id}=\\\@ret$id;\n";
|
178
|
2
|
|
|
|
|
24
|
return $self->{n}->perlstring($fh,$id+1,$level,@_);
|
179
|
|
|
|
|
|
|
}
|
180
|
|
|
|
|
|
|
sub perlcount {
|
181
|
0
|
|
|
0
|
1
|
0
|
my $self=shift;
|
182
|
0
|
|
|
|
|
0
|
my $id=shift;
|
183
|
0
|
|
|
|
|
0
|
return $self->{n}->perlcount($id+1);
|
184
|
|
|
|
|
|
|
}
|
185
|
|
|
|
|
|
|
sub perleval {
|
186
|
2
|
|
|
2
|
1
|
5
|
my $self=shift;
|
187
|
2
|
|
|
|
|
4
|
my $fh=shift;
|
188
|
2
|
|
|
|
|
2
|
my $id=shift;
|
189
|
2
|
|
|
|
|
4
|
my $level=shift;
|
190
|
2
|
|
|
|
|
5
|
my $in="\t" x $level;
|
191
|
2
|
|
|
|
|
10
|
print $fh $in,"my \$var$id = Dotiac::DTL::devar_content(\$source$id,\$vars,\$escape,\@_);\n";
|
192
|
2
|
|
|
|
|
5
|
print $fh $in,"my \$r$id = Scalar::Util::reftype(\$var$id);\n";
|
193
|
2
|
|
|
|
|
7
|
print $fh $in,"my \@data$id=(\$var$id);\n";
|
194
|
2
|
|
|
|
|
8
|
print $fh $in,"\@data$id=values \%{\$var$id} if \$r$id eq \"HASH\";\n";
|
195
|
2
|
|
|
|
|
6
|
print $fh $in,"\@data$id=\@{\$var$id} if \$r$id eq \"ARRAY\";\n";
|
196
|
2
|
|
|
|
|
5
|
print $fh $in,"my \%data$id;\n";
|
197
|
2
|
|
|
|
|
5
|
print $fh $in,"my \@ret$id;\n";
|
198
|
2
|
|
|
|
|
7
|
print $fh $in,"foreach my \$e (\@data$id) {\n";
|
199
|
2
|
|
|
|
|
5
|
print $fh $in,"\tmy \$g=\"\";\n";
|
200
|
2
|
|
|
|
|
5
|
print $fh $in,"\tif (substr(\$property$id,0,1) eq \"`\") {\n";
|
201
|
2
|
|
|
|
|
5
|
print $fh $in,"\t\t\$g=Dotiac::DTL::devar_var(\"foo.\".Dotiac::DTL::devar(\$property$id,\$vars,0,\@_),{foo=>\$e},0,\@_)->string();\n";
|
202
|
2
|
|
|
|
|
2
|
print $fh $in,"\t} else {\n";
|
203
|
2
|
|
|
|
|
6
|
print $fh $in,"\t\t\$g=Dotiac::DTL::devar(\"foo.\".\$property$id,{\%{\$vars},foo=>\$e},0,\@_);\n";
|
204
|
2
|
|
|
|
|
4
|
print $fh $in,"\t}\n";
|
205
|
2
|
|
|
|
|
5
|
print $fh $in,"\tnext unless \$g;\n";
|
206
|
2
|
|
|
|
|
6
|
print $fh $in,"\tmy \$list = \$data$id"."{\$g};\n";
|
207
|
2
|
|
|
|
|
6
|
print $fh $in,"\tunless (\$list) {\n";
|
208
|
2
|
|
|
|
|
3
|
print $fh $in,"\t\t\$list=[];\n";
|
209
|
2
|
|
|
|
|
5
|
print $fh $in,"\t\tpush \@ret$id,{grouper=>\$g,list=>\$list} ;\n";
|
210
|
2
|
|
|
|
|
5
|
print $fh $in,"\t\t\$data$id"."{\$g}=\$list;\n";
|
211
|
2
|
|
|
|
|
4
|
print $fh $in,"\t}\n";
|
212
|
2
|
|
|
|
|
6
|
print $fh $in,"\tpush \@\$list,\$e;\n";
|
213
|
2
|
|
|
|
|
3
|
print $fh $in,"}\n";
|
214
|
2
|
|
|
|
|
5
|
print $fh $in,"\$vars->{\$varname$id}=\\\@ret$id;\n";
|
215
|
2
|
|
|
|
|
20
|
return $self->{n}->perleval($fh,$id+1,$level,@_);
|
216
|
|
|
|
|
|
|
}
|
217
|
|
|
|
|
|
|
sub perlinit {
|
218
|
2
|
|
|
2
|
1
|
5
|
my $self=shift;
|
219
|
2
|
|
|
|
|
3
|
my $fh=shift;
|
220
|
2
|
|
|
|
|
4
|
my $id=shift;
|
221
|
2
|
|
|
|
|
11
|
return $self->{n}->perlinit($fh,$id+1,@_);
|
222
|
|
|
|
|
|
|
}
|
223
|
|
|
|
|
|
|
sub next {
|
224
|
2
|
|
|
2
|
1
|
4
|
my $self=shift;
|
225
|
2
|
|
|
|
|
10
|
$self->{n}=shift;
|
226
|
|
|
|
|
|
|
}
|
227
|
|
|
|
|
|
|
sub eval {
|
228
|
0
|
|
|
0
|
1
|
|
my $self=shift;
|
229
|
0
|
|
|
|
|
|
my $var = Dotiac::DTL::devar_content($self->{source},@_);
|
230
|
0
|
|
|
|
|
|
my $r = Scalar::Util::reftype($var);
|
231
|
0
|
|
|
|
|
|
my @data=($var);
|
232
|
0
|
0
|
|
|
|
|
@data=values %{$var} if $r eq "HASH";
|
|
0
|
|
|
|
|
|
|
233
|
0
|
0
|
|
|
|
|
@data=@{$var} if $r eq "ARRAY";
|
|
0
|
|
|
|
|
|
|
234
|
0
|
|
|
|
|
|
my %data;
|
235
|
|
|
|
|
|
|
my @ret;
|
236
|
0
|
|
|
|
|
|
my $vars=shift;
|
237
|
0
|
|
|
|
|
|
my $escape=shift;
|
238
|
0
|
|
|
|
|
|
foreach my $e (@data) {
|
239
|
0
|
|
|
|
|
|
my $g="";
|
240
|
0
|
0
|
|
|
|
|
if (substr($self->{property},0,1) eq "`") {
|
241
|
0
|
|
|
|
|
|
$g=Dotiac::DTL::devar_var("foo.".Dotiac::DTL::devar($self->{property},$vars,0,@_),{foo=>$e},0,@_)->string();
|
242
|
|
|
|
|
|
|
}
|
243
|
|
|
|
|
|
|
else {
|
244
|
0
|
|
|
|
|
|
$g=Dotiac::DTL::devar("foo.".$self->{property},{%{$vars},foo=>$e},0,@_);
|
|
0
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
}
|
246
|
0
|
0
|
|
|
|
|
next unless $g;
|
247
|
0
|
|
|
|
|
|
my $list = $data{$g};
|
248
|
0
|
0
|
|
|
|
|
unless ($list) {
|
249
|
0
|
|
|
|
|
|
$list=[];
|
250
|
0
|
|
|
|
|
|
push @ret,{grouper=>$g,list=>$list} ;
|
251
|
0
|
|
|
|
|
|
$data{$g}=$list;
|
252
|
|
|
|
|
|
|
}
|
253
|
0
|
|
|
|
|
|
push @$list,$e;
|
254
|
|
|
|
|
|
|
}
|
255
|
0
|
|
|
|
|
|
$vars->{$self->{var}}=\@ret;
|
256
|
0
|
|
|
|
|
|
$self->{n}->eval($vars,$escape,@_);
|
257
|
|
|
|
|
|
|
}
|
258
|
|
|
|
|
|
|
1;
|
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
__END__
|