|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
  
 
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # (c) Jan Gehring   | 
| 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package Rex::Template::NG;  | 
| 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
7
 | 
10
 | 
 
 | 
 
 | 
  
10
  
 | 
 
 | 
70672
 | 
 use v5.12.5;  | 
| 
 
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
75
 | 
    | 
| 
8
 | 
10
 | 
 
 | 
 
 | 
  
10
  
 | 
 
 | 
84
 | 
 use warnings;  | 
| 
 
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
43
 | 
    | 
| 
 
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
6017
 | 
    | 
| 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our $VERSION = '1.14.2.2'; # TRIAL VERSION  | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub new {  | 
| 
13
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
  
0
  
 | 
134
 | 
   my $that  = shift;  | 
| 
14
 | 
1
 | 
 
 | 
  
 33
  
 | 
 
 | 
 
 | 
7
 | 
   my $proto = ref($that) || $that;  | 
| 
15
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4
 | 
   my $self  = {@_};  | 
| 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
17
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
   bless( $self, $proto );  | 
| 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
19
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
   $self->_init();  | 
| 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
21
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3
 | 
   return $self;  | 
| 
22
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
23
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
24
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _init {  | 
| 
25
 | 
15
 | 
 
 | 
 
 | 
  
15
  
 | 
 
 | 
28
 | 
   my ($self) = @_;  | 
| 
26
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
27
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
30
 | 
   $self->{__output__}   = "";  | 
| 
28
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
24
 | 
   $self->{__code__}     = "";  | 
| 
29
 | 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
24
 | 
   $self->{__raw_data__} = "";  | 
| 
30
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
31
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
32
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub parse {  | 
| 
33
 | 
14
 | 
 
 | 
 
 | 
  
14
  
 | 
  
0
  
 | 
35
 | 
   my $self = shift;  | 
| 
34
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
22
 | 
   my $c    = shift;  | 
| 
35
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
23
 | 
   my %in_vars;  | 
| 
36
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
37
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
35
 | 
   $self->_init();  | 
| 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
39
 | 
14
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
42
 | 
   if ( ref $_[0] eq "HASH" ) {  | 
| 
40
 | 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
     %in_vars = %{ +shift };  | 
| 
 
 | 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
37
 | 
    | 
| 
41
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
42
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   else {  | 
| 
43
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
     %in_vars = @_;  | 
| 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
45
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
46
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
23
 | 
   my %vars;  | 
| 
47
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
48
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
34
 | 
   for my $key ( keys %in_vars ) {  | 
| 
49
 | 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17
 | 
     my $new_key = $key;  | 
| 
50
 | 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
47
 | 
     $new_key =~ s/[^a-zA-Z0-9_]/_/gms;  | 
| 
51
 | 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
29
 | 
     $vars{$new_key} = $in_vars{$key};  | 
| 
52
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
53
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
54
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   # some backward compat. to old template module.  | 
| 
55
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
71
 | 
   $c =~ s/\$::([a-zA-Z0-9_]+)/_replace_var($1, \%vars)/egms;  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
23
 | 
    | 
| 
56
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
57
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
30
 | 
   my $code = "";  | 
| 
58
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
59
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
21
 | 
   my $var_data = '  | 
| 
60
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     | 
| 
61
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   return sub {  | 
| 
62
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my (  | 
| 
63
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       $self,  | 
| 
64
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ';  | 
| 
65
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
66
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
21
 | 
   my @code_values;  | 
| 
67
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
29
 | 
   for my $var ( keys %vars ) {  | 
| 
68
 | 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
22
 | 
     $var_data .= '$' . $var . ", \n";  | 
| 
69
 | 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
23
 | 
     push( @code_values, $vars{$var} );  | 
| 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
71
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
72
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
27
 | 
   $var_data .= '$this_is_really_nothing) = @_;';  | 
| 
73
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
18
 | 
   $var_data .= "\n";  | 
| 
74
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
75
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
25
 | 
   $code = $var_data;  | 
| 
76
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
77
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
30
 | 
   $code .= $self->_parse($c);  | 
| 
78
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
79
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
26
 | 
   $code .= "\n}";  | 
| 
80
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
81
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
20
 | 
   my $idx_c = 1;  | 
| 
82
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
73
 | 
   for my $l ( split( /\n/, $code ) ) {  | 
| 
83
 | 
232
 | 
 
 | 
 
 | 
 
 | 
 
 | 
282
 | 
     $idx_c++;  | 
| 
84
 | 
232
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
419
 | 
     $l ||= "";  | 
| 
85
 | 
232
 | 
 
 | 
 
 | 
 
 | 
 
 | 
486
 | 
     Rex::Logger::debug("$idx_c. $l");  | 
| 
86
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
87
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
88
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
75
 | 
   $self->{__code__}     = $code;  | 
| 
89
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
27
 | 
   $self->{__raw_data__} = $c;  | 
| 
90
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
91
 | 
10
 | 
 
 | 
 
 | 
  
10
  
 | 
 
 | 
97
 | 
   no warnings;  | 
| 
 
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
34
 | 
    | 
| 
 
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1182
 | 
    | 
| 
92
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1538
 | 
   my $tpl_code = eval($code);  | 
| 
93
 | 
10
 | 
 
 | 
 
 | 
  
10
  
 | 
 
 | 
117
 | 
   use warnings;  | 
| 
 
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
43
 | 
    | 
| 
 
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14714
 | 
    | 
| 
94
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
95
 | 
14
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
59
 | 
   if ($@) {  | 
| 
96
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
97
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $error = $@;  | 
| 
98
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
99
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($error_line) = ( $error =~ m/line (\d+)[\.,]/ );  | 
| 
100
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my @code_lines   = split( /\n/, $code );  | 
| 
101
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my @raw_lines    = split( /\n/, $c );  | 
| 
102
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
103
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $idx = $error_line - 5;  | 
| 
104
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     for my $l ( @code_lines[ $error_line - 5 .. $error_line + 5 ] ) {  | 
| 
105
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $idx++;  | 
| 
106
 | 
  
0
  
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
       $l ||= "";  | 
| 
107
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       Rex::Logger::debug("$idx. $l");  | 
| 
108
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
110
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $template_line     = 0;  | 
| 
111
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $add_to_error_line = -1;  | 
| 
112
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
113
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # search the error line  | 
| 
114
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     Rex::Logger::debug("Template-Error-Line: $error_line");  | 
| 
115
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     for ( my $bi = $error_line - 1 ; $bi >= 0 ; $bi-- ) {  | 
| 
116
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       if ( $code_lines[$bi] =~ m/^# LINE: (\d+)$/ ) {  | 
| 
117
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $template_line = $1 + $add_to_error_line;  | 
| 
118
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         last;  | 
| 
119
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }  | 
| 
120
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $add_to_error_line++;  | 
| 
121
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
122
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
123
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( !$template_line ) {  | 
| 
124
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       die "Uncatchable error in template: $error ($error_line)";  | 
| 
125
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
126
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
127
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $start_part = $template_line - 5;  | 
| 
128
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $start_part = 0 if $start_part <= 0;  | 
| 
129
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $end_part = $template_line + 5;  | 
| 
130
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $end_part = scalar @raw_lines if $end_part > scalar @raw_lines;  | 
| 
131
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
132
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $idx_t = $start_part;  | 
| 
133
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
134
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     for my $l ( @raw_lines[ $start_part .. $end_part ] ) {  | 
| 
135
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $idx_t++;  | 
| 
136
 | 
  
0
  
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
       $l ||= "";  | 
| 
137
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       Rex::Logger::info("$idx_t. $l");  | 
| 
138
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
139
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
140
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $tpl_error = $error;  | 
| 
141
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $tpl_error =~ s/at \(eval \d+\) line \d+/at template line $template_line/;  | 
| 
142
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
143
 | 
  
0
  
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     if ( $error =~ m/Global symbol "([^"]+)" requires explicit package name/ ) {  | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
144
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $tpl_error =  | 
| 
145
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         "Unknown variable name $1 in code line: ,,$raw_lines[$template_line-1]'' line: $template_line.\nOriginal Error:\n$error\n";  | 
| 
146
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
147
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
148
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # internal parsing error, maybe runaway line without ";"  | 
| 
149
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     elsif ( $raw_lines[ $template_line - 2 ] =~ m/^%/  | 
| 
150
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && $raw_lines[ $template_line - 2 ] !~ m/[;{("']/ )  | 
| 
151
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     {  | 
| 
152
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       Rex::Logger::debug(  | 
| 
153
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         "Template Error in compiled line: $code_lines[$error_line-1]");  | 
| 
154
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       Rex::Logger::info(  | 
| 
155
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         "Template Error somewhere around: $raw_lines[$template_line-2]",  | 
| 
156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         "error" );  | 
| 
157
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
158
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       my $template_line_ = $template_line - 1;  | 
| 
159
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $tpl_error =  | 
| 
160
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         "Maybe missing <<;, {, (, \" or '>> in code line: ,,$raw_lines[$template_line-2]'' line $template_line_.\nOriginal Error:\n$error\n";  | 
| 
161
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
162
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     else {  | 
| 
163
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $tpl_error =  | 
| 
164
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         "Failed parsing template. Unkown error near $template_line.\nOriginal Error:\n$error\n";  | 
| 
165
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
166
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
167
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     die $tpl_error;  | 
| 
168
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
169
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
170
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
287
 | 
   $tpl_code->( $self, @code_values );  | 
| 
171
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
172
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
237
 | 
   return $self->{__output__};  | 
| 
173
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
174
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
175
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub __out {  | 
| 
176
 | 
44
 | 
 
 | 
 
 | 
  
44
  
 | 
 
 | 
80
 | 
   my ( $self, $str ) = @_;  | 
| 
177
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
178
 | 
44
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
580
 | 
   $self->{__output__} .= defined $str ? $str : "";  | 
| 
179
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
180
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
181
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _parse {  | 
| 
182
 | 
14
 | 
 
 | 
 
 | 
  
14
  
 | 
 
 | 
28
 | 
   my ( $self, $c ) = @_;  | 
| 
183
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
184
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
19
 | 
   my $parsed = "";  | 
| 
185
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
186
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
82
 | 
   my @chars = split( //, $c );  | 
| 
187
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
188
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
26
 | 
   my $begin_line        = 0;  | 
| 
189
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
19
 | 
   my $code_line         = 0;  | 
| 
190
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
20
 | 
   my $code_block        = 0;  | 
| 
191
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
19
 | 
   my $code_block_output = 0;  | 
| 
192
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17
 | 
   my $current_char_idx  = -1;  | 
| 
193
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
   my $line_count        = 1;  | 
| 
194
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
19
 | 
   my $string_open       = 0;  | 
| 
195
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
20
 | 
   my $skip_next         = 0;  | 
| 
196
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
   my $skip_next_newline = 0;  | 
| 
197
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
198
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
29
 | 
   for my $curr_char (@chars) {  | 
| 
199
 | 
427
 | 
 
 | 
 
 | 
 
 | 
 
 | 
508
 | 
     $current_char_idx++;  | 
| 
200
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
201
 | 
427
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
632
 | 
     if ($skip_next) {  | 
| 
202
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11
 | 
       $skip_next = 0;  | 
| 
203
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
       next;  | 
| 
204
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
205
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
206
 | 
417
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
740
 | 
     my $prev_char = $chars[ $current_char_idx - 1 ] || "";  | 
| 
207
 | 
417
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
754
 | 
     my $next_char = $chars[ $current_char_idx + 1 ] || "";  | 
| 
208
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
209
 | 
417
 | 
  
 50
  
 | 
  
 33
  
 | 
 
 | 
 
 | 
698
 | 
     if ( $skip_next_newline && $curr_char eq "\n" ) {  | 
| 
210
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $skip_next_newline = 0;  | 
| 
211
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $curr_char         = "";  | 
| 
212
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
213
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
214
 | 
417
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
724
 | 
     if ( $curr_char eq "\n" && $prev_char ne "\n" ) { # count lines, for error messages  | 
| 
215
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
15
 | 
       $line_count++;  | 
| 
216
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
       $parsed .= $curr_char;  | 
| 
217
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
218
 | 
10
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
17
 | 
       if ($string_open) {  | 
| 
219
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
15
 | 
         $parsed .= "});\n";  | 
| 
220
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }  | 
| 
221
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
222
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       # reset vars  | 
| 
223
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
15
 | 
       $code_line   = 0;  | 
| 
224
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14
 | 
       $string_open = 0;  | 
| 
225
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
226
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17
 | 
       next;  | 
| 
227
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
228
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
229
 | 
407
 | 
  
 50
  
 | 
  
 33
  
 | 
 
 | 
 
 | 
685
 | 
     if ( $curr_char eq "\n" && $prev_char eq "\n" ) {  | 
| 
230
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $parsed .= "\$self->__out(q{\n});\n";  | 
| 
231
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $line_count++;  | 
| 
232
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       next;  | 
| 
233
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
234
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
235
 | 
407
 | 
  
  0
  
 | 
  
 33
  
 | 
 
 | 
 
 | 
649
 | 
     if ( $curr_char eq "-"  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
 33
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
236
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && $next_char eq "%"  | 
| 
237
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && ( $prev_char eq " " || $prev_char eq "\n" )  | 
| 
238
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && $chars[ $current_char_idx + 2 ] eq ">" )  | 
| 
239
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     {  | 
| 
240
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       # skip "-" of -%> sequence  | 
| 
241
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $skip_next_newline = 1;  | 
| 
242
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       next;  | 
| 
243
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
244
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
245
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # catch code line  | 
| 
246
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # % some code  | 
| 
247
 | 
407
 | 
  
 50
  
 | 
  
100
  
 | 
 
 | 
 
 | 
1167
 | 
     if (  | 
| 
 
 | 
 
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
 33
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
248
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       !$code_block  | 
| 
249
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && ( $prev_char eq "\n"  | 
| 
250
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         || $current_char_idx == 0 ) # first line or new line  | 
| 
251
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && $curr_char eq "%"  | 
| 
252
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && $next_char eq " "          # code block, and no % char escape sequence  | 
| 
253
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       )  | 
| 
254
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     {  | 
| 
255
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $code_line = 1;  | 
| 
256
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $parsed .= "\n# LINE: $line_count\n";  | 
| 
257
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       next;  | 
| 
258
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
259
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
260
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # catch '<% ' ...  | 
| 
261
 | 
407
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
783
 | 
     if ( $prev_char eq "<"  | 
| 
 
 | 
 
 | 
 
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
262
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && $curr_char eq "%"  | 
| 
263
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && ( $next_char eq " " || $next_char eq "\n" ) )  | 
| 
264
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     {  | 
| 
265
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
8
 | 
       $code_block = 1;  | 
| 
266
 | 
6
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
12
 | 
       if ($string_open) {  | 
| 
267
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
9
 | 
         $parsed .= "});\n";  | 
| 
268
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
7
 | 
         $string_open = 0;  | 
| 
269
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }  | 
| 
270
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
271
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11
 | 
       $parsed .= "\n# LINE: $line_count\n";  | 
| 
272
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
273
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11
 | 
       next;  | 
| 
274
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
275
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
276
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # catch ' %>'  | 
| 
277
 | 
401
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
1167
 | 
     if (  | 
| 
 
 | 
 
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
278
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       $code_block  | 
| 
279
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && ( ( $code_block_output || $prev_char eq " " )  | 
| 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         || $prev_char eq "\n"  | 
| 
281
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         || $prev_char eq "-" )  | 
| 
282
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && $curr_char eq "%"  | 
| 
283
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       && $next_char eq ">"  | 
| 
284
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       )  | 
| 
285
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     {  | 
| 
286
 | 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
22
 | 
       $code_block = 0;  | 
| 
287
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
288
 | 
16
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
28
 | 
       if ($code_block_output) {  | 
| 
289
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
         $parsed .= ");\n";  | 
| 
290
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14
 | 
         $code_block_output = 0;  | 
| 
291
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }  | 
| 
292
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
293
 | 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
19
 | 
       $string_open = 1;  | 
| 
294
 | 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
23
 | 
       $parsed .= "\n\$self->__out(q{";  | 
| 
295
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
296
 | 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
25
 | 
       next;  | 
| 
297
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
298
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
299
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # catch '<%='  | 
| 
300
 | 
385
 | 
  
 50
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
676
 | 
     if ( $prev_char eq "<" && $curr_char eq "%" && $next_char eq "=" ) {  | 
| 
 
 | 
 
 | 
 
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
301
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
18
 | 
       $code_block        = 1;  | 
| 
302
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
       $code_block_output = 1;  | 
| 
303
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
304
 | 
10
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
19
 | 
       if ($string_open) {  | 
| 
305
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
13
 | 
         $parsed .= "});\n";  | 
| 
306
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }  | 
| 
307
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
308
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
20
 | 
       $parsed .= "\n# LINE: $line_count\n";  | 
| 
309
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14
 | 
       $parsed .= "\$self->__out(";  | 
| 
310
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
13
 | 
       $skip_next = 1;  | 
| 
311
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
312
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
       next;  | 
| 
313
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
314
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
315
 | 
375
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
912
 | 
     if ( $code_line || $code_block ) {  | 
| 
316
 | 
150
 | 
 
 | 
 
 | 
 
 | 
 
 | 
190
 | 
       $parsed .= $curr_char;  | 
| 
317
 | 
150
 | 
 
 | 
 
 | 
 
 | 
 
 | 
244
 | 
       next;  | 
| 
318
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
319
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
320
 | 
225
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
340
 | 
     if ( !$string_open ) {  | 
| 
321
 | 
24
 | 
 
 | 
 
 | 
 
 | 
 
 | 
29
 | 
       $string_open = 1;  | 
| 
322
 | 
24
 | 
 
 | 
 
 | 
 
 | 
 
 | 
43
 | 
       $parsed .= '$self->__out(q{';  | 
| 
323
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
324
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
325
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # don't catch opening <  | 
| 
326
 | 
225
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
406
 | 
     if ( $curr_char eq "<" && $next_char eq "%" ) {  | 
| 
327
 | 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
27
 | 
       next;  | 
| 
328
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
329
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
330
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # don't catch closing >  | 
| 
331
 | 
209
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
387
 | 
     if ( $curr_char eq ">" && $prev_char eq "%" ) {  | 
| 
332
 | 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
26
 | 
       next;  | 
| 
333
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
334
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
335
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # escaping of % sign  | 
| 
336
 | 
193
 | 
  
 50
  
 | 
  
 33
  
 | 
 
 | 
 
 | 
324
 | 
     if ( $curr_char eq "%" && $prev_char eq "%" ) {  | 
| 
337
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       next;  | 
| 
338
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
339
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
340
 | 
193
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
405
 | 
     $parsed .= $curr_char =~ m/[{}]/ ? "\\$curr_char" : $curr_char;  | 
| 
341
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
342
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
343
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
344
 | 
14
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
28
 | 
   if ($string_open) {  | 
| 
345
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
24
 | 
     $parsed .= "});\n";  | 
| 
346
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
347
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
348
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
62
 | 
   return $parsed;  | 
| 
349
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
350
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
351
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
352
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _replace_var {  | 
| 
353
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
30
 | 
   my ( $var, $t_vars ) = @_;  | 
| 
354
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
355
 | 
9
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
21
 | 
   if ( exists $t_vars->{$var} ) {  | 
| 
356
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
41
 | 
     return '$' . $var;  | 
| 
357
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
358
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   else {  | 
| 
359
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     return '$::' . $var;  | 
| 
360
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }  | 
| 
361
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
362
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
363
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 1;  | 
| 
364
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
365
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 __END__  |