blib/lib/Embperl/Syntax/RTF.pm untested

filter: Statementstmt 0.0% 0 / 128 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 155 CC 6 SCAR 18.3
CC
6
Cov
0%
AddRTFCmd
12.0
Var2Code
12.0
new
6.0
CRAP 6.2
1  
2 ###################################################################################
3 #
4 # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
5 # Embperl - Copyright (c) 2008-2015 Gerald Richter
6 # Embperl - Copyright (c) 2015-2023 actevy.io
7 #
8 # You may distribute under the terms of either the GNU General Public
9 # License or the Artistic License, as specified in the Perl README file.
10 #
11 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
12 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 #
15 ###################################################################################
16
17  
18  
19 package Embperl::Syntax::RTF ;
20  
21 use Embperl::Syntax (':types') ;
22 use Embperl::Syntax::EmbperlBlocks ;
23  
24 use strict ;
25 use vars qw{@ISA %RTF %Para %ParaBlockInside %Block %BlockInside %FieldStart %CmdStart %Var %Spaces %Inside} ;
26  
27 require Text::ParseWords ;
28  
29 @ISA = qw(Embperl::Syntax::EmbperlBlocks) ;
30  
31  
32 ###################################################################################
33 #
34 # Methods
35 #
36 ###################################################################################
37  
38 # ---------------------------------------------------------------------------------
39 #
40 # Create new Syntax Object
41 #
42 # ---------------------------------------------------------------------------------
43  
44 sub new
45  
46 {
47 my $self = shift ;
48  
49 $self = Embperl::Syntax::EmbperlBlocks::new ($self, { 'unescape' => 17 }) ;
50  
51 if (!$self -> {-rtfBlocks})
52 {
53 my $eb = $self -> {-epbBlocks} ;
54 my $k ;
55 my $v ;
56 my $ebesc = $self -> CloneHash ($eb, { 'unescape' => 17 }) ;
57  
58 $self -> {-root} = $self -> CloneHash ($self -> {-root}, { 'unescape' => 17 }) ;
59
60 while (($k, $v) = each %$ebesc)
61 {
62 $Block{$k} = $v ;
63 }
64  
65 $self -> {-rtfBlocks} = $self -> CloneHash (\%RTF) ;
66  
67 $self -> AddToRoot ($self -> {-rtfBlocks}) ;
68  
69 # $self -> {-rtfCmds} = $self -> {-rtfBlocks}{'RTF mainblock'}{'inside'}{'RTF first paragraph'}{'inside'}{'RTF field'}{'inside'}{'RTF fieldstart'}{'inside'}{'RTF block cmd'}{'inside'} ;
70 # $self -> {-rtfCmds2} = $self -> {-rtfBlocks}{'RTF mainblock'}{'inside'}{'RTF first paragraph'}{'inside'}{'RTF field'}{'inside'}{'RTF fieldstart'}{'inside'} ;
71 $self -> {-rtfCmds} = $self -> {-rtfBlocks}{'RTF mainblock'}{'inside'}{'RTF field'}{'inside'}{'RTF fieldstart'}{'inside'}{'RTF block cmd'}{'inside'} ;
72 $self -> {-rtfCmds2} = $self -> {-rtfBlocks}{'RTF mainblock'}{'inside'}{'RTF field'}{'inside'}{'RTF fieldstart'}{'inside'} ;
73 Init ($self) ;
74 }
75  
76 return $self ;
77 }
78  
79 # ---------------------------------------------------------------------------------
80 #
81 # Add new rtf command
82 #
83 # ---------------------------------------------------------------------------------
84  
85  
86 sub AddRTFCmd
87  
88 {
89 my ($self, $cmdname, $procinfo, $taginfo, $procinfoinside) = @_ ;
90  
91 my $ttfollow = $self -> {-rtfCmds} ;
92  
93 my $tag = $ttfollow -> {$cmdname} = {
94 'text' => $cmdname,
95 'nodetype' => ntypStartEndTag,
96 #'nodetype' => ntypTag,
97 #'cdatatype' => ntypAttrValue,
98 'forcetype' => 1,
99 'unescape' => 1,
100 'removespaces' => 16,
101 (ref($taginfo) eq 'HASH'?%$taginfo:()),
102 } ;
103 if ($procinfo)
104 {
105 #$procinfo -> {compiletimeperlcode} = q[my $tmp = %#'0% ; $tmp =~ s/_ep_rp\(.*?\,/push \@_ep_rtf_tmp,(/, $Embperl::req -> component -> code ($tmp) ; ] ;
106 $tag -> {'procinfo'} = { $self -> {-procinfotype} => $procinfo } ;
107 }
108 $self -> {-rtfCmds2} -> {$cmdname} = $tag ;
109
110
111 return $tag ;
112 }
113  
114  
115 # ---------------------------------------------------------------------------------
116 #
117 # Add new rtf command that has an corresponding end rtf command
118 #
119 # ---------------------------------------------------------------------------------
120  
121  
122 sub AddRTFCmdWithEnd
123  
124 {
125 my ($self, $cmdname, $endname, $procinfo) = @_ ;
126  
127 my $tag = $self -> AddRTFCmd ($cmdname, $procinfo) ;
128  
129 $tag -> {'endtag'} = $endname ;
130  
131 return $tag ;
132 }
133  
134 # ---------------------------------------------------------------------------------
135 #
136 # Add new rtf command with start and end
137 #
138 # ---------------------------------------------------------------------------------
139  
140  
141 sub AddRTFCmdBlock
142  
143 {
144 my ($self, $cmdname, $endname, $procinfostart, $procinfoend) = @_ ;
145  
146 my $tag ;
147 my $pinfo ;
148  
149 $tag = $self -> AddRTFCmd ($cmdname, $procinfostart) ;
150 $tag -> {'endtag'} = $endname ;
151 $pinfo = $tag -> {'procinfo'} -> {$self -> {-procinfotype}} ;
152 $pinfo -> {'stackname'} = 'metacmd' ;
153 $pinfo -> {'push'} = $cmdname ;
154  
155 $tag = $self -> AddRTFCmd ($endname, $procinfoend) ;
156 $pinfo = $tag -> {'procinfo'} -> {$self -> {-procinfotype}} ;
157 $pinfo -> {'stackname'} = 'metacmd' ;
158 $pinfo -> {'stackmatch'} = $cmdname ;
159
160  
161 return $tag ;
162 }
163  
164  
165  
166  
167 ###################################################################################
168 #
169 # Definitions for RTF
170 #
171 ###################################################################################
172  
173 sub Init
174  
175 {
176 my ($self) = @_ ;
177  
178 $self -> AddInitCode (undef, '$_ep_rtf_ndx=0;$escmode=0;sub esc { my $x = shift ; $x =~ s/([{}])/\\\\$1/g ; $x =~ s/\n/\\\\line /g ; $x} ; ', undef) ;
179  
180 $self -> AddRTFCmd ('DOCVARIABLE',
181 {
182 perlcode => '_ep_rp(%$x%,scalar(esc(join(\'\',',
183 perlcodeend => '))));',
184 compiletimeperlcode => q[if ($_ep_rtf_inside) { my $tmp = $Embperl::req -> component -> code () ; $tmp =~ s/_ep_rp\(.*?\,/push \@_ep_rtf_tmp,(/ ; $Embperl::req -> component -> code ($tmp) } ; $_ep_rtf_cmd = 1 ;],
185 },
186 {
187 'inside' => \%Var,
188 'cdatatype' => 0,
189 },
190 ) ;
191 $self -> AddRTFCmd ('MERGEFIELD',
192 {
193 perlcode => '_ep_rp(%$x%,scalar(esc(join(\'\', ',
194 perlcodeend => '))));',
195 compiletimeperlcode => q[if ($_ep_rtf_inside) { my $tmp = $Embperl::req -> component -> code () ; $tmp =~ s/_ep_rp\(.*?\,/push \@_ep_rtf_tmp,(/ ; $tmp .= '\'' . (%>'-1%) . '\'' . ',' ; $Embperl::req -> component -> code ($tmp) } ; $_ep_rtf_cmd = 1 ;],
196 },
197 {
198 'inside' => \%Var,
199 'cdatatype' => 0,
200 },
201 ) ;
202  
203  
204 $self -> AddRTFCmd ('NEXT',
205 {
206 perlcode => '$_ep_rtf_ndx++;',
207 'removenode' => 1,
208 },
209 {
210 'nodename' => '::::NEXT',
211 'cdatatype' => 0,
212 }) ;
213  
214 $self -> AddRTFCmd ('MERGEREC',
215 {
216 perlcode => '_ep_rp(%$x%,$_ep_rtf_ndx+1);',
217 },
218 {
219 'nodename' => '::::MERGEREC',
220 'cdatatype' => 0,
221 },
222 {
223 perlcode => 'push @_ep_rtf_tmp,$_ep_rtf_ndx+1',
224 },
225 ) ;
226  
227 $self -> AddRTFCmd ('MERGESEQ',
228 {
229 perlcode => '_ep_rp(%$x%,$_ep_rtf_ndx+1);',
230 },
231 {
232 'nodename' => '::::MERGESEQ',
233 'cdatatype' => 0,
234 },
235 {
236 perlcode => 'push @_ep_rtf_tmp,$_ep_rtf_ndx+1',
237 },
238 ) ;
239  
240 $self -> AddRTFCmd ('IF',
241 {
242 perlcode => '@_ep_rtf_tmp=();%>\'-1% =~ /^\s*(.*?)\s*$/ ; $_ep_rtf_preif=$1;',
243 compiletimeperlcode => q[$_ep_rtf_inside = 1 ; $_ep_rtf_code = '{ my $itmp = $true?$_ep_rtf_tmp[3]:$_ep_rtf_tmp[4]; _ep_rp($x, \'{\'.$_ep_rtf_preif.(($itmp =~ /^\\\\\\\\/) || !$_ep_rtf_preif?$itmp:" $itmp").\'}\');}' ; $_ep_rtf_cmd = 1 ; ],
244 'removenode' => 1,
245 },
246 {
247 'nodename' => '::::IF',
248 'cdatatype' => 0,
249 },
250 ) ;
251  
252 $self -> AddRTFCmd ('NEXTIF',
253 {
254 perlcode => '@_ep_rtf_tmp=();',
255 compiletimeperlcode => q[$_ep_rtf_inside = 1 ; $_ep_rtf_code = '$_ep_rtf_ndx++ if ($true); ' ; $_ep_rtf_cmd = 1 ;],
256 'removenode' => 1,
257 },
258 {
259 'nodename' => '::::NEXTIF',
260 'cdatatype' => 0,
261 },
262 ) ;
263  
264 $self -> AddRTFCmd ('SKIPIF',
265 {
266 perlcode => '@_ep_rtf_tmp=();',
267 compiletimeperlcode => q[$_ep_rtf_inside = 1 ; $_ep_rtf_code = '$_ep_rtf_ndx+=2 if ($true); ' ; $_ep_rtf_cmd = 1 ; ],
268 'removenode' => 1,
269 },
270 {
271 'nodename' => '::::NEXTIF',
272 'cdatatype' => 0,
273 },
274 ) ;
275 }
276  
277  
278  
279 sub Var2Code
280  
281 {
282 my $var = shift ;
283 $var =~ s/(\r|\n)//g ; # variablename can contain \r and/or \n !!!
284 my @parts = split (/\./, $var) ;
285 return '' if (!@parts) ;
286 my $code = '$param[$_ep_rtf_ndx]' ;
287  
288 foreach (@parts)
289 {
290 if (/^\d+/)
291 { $code .= "[$_]" }
292 else
293 { $code .= "{'$_'}" }
294 }
295 return $code ;
296 }
297  
298 # Variablename inside of a command
299  
300 %Var = (
301 '-lsearch' => 1,
302 'Varname' =>
303 {
304 'contains' => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.\r\n",
305 #'inside' => \%Varseparator,
306 #'inside' => \%Varinside,
307 'cdatatype' => ntypTag,
308 'nodename' => ':{:}:full_var',
309 'procinfo' => {
310 'embperl' => {
311 compiletimeperlcode => q[$Embperl::req -> component -> code (Embperl::Syntax::RTF::Var2Code (%#'0%)) ;],
312 },
313 },
314  
315 },
316 'VarnameComment' =>
317 {
318 text => '\\\\*',
319 'cdatatype' => 0,
320 'contains' => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.\r\n",
321 },
322 ) ;
323  
324  
325 %Inside = () ;
326  
327  
328 %ParaBlockInside = (
329 '-lsearch' => 1,
330 'RTF block' => {
331 'text' => '{',
332 'end' => '}',
333 'nodename' => '!:{:::}',
334 'nodetype' => ntypStartEndTag,
335 'cdatatype' => ntypCDATA,
336 'removespaces' => 0,
337 'inside' => \%ParaBlockInside,
338 'procinfo' => {
339 'embperl' => {
340 },
341 },
342 },
343 'RTF field' => {
344 'text' => '{\field',
345 'end' => '}',
346 'nodename' => '!:{:::}',
347 'nodetype' => ntypStartEndTag,
348 #'cdatatype' => ntypAttrValue,
349 'insidemustexist' => 1,
350 'inside' => \%FieldStart,
351 'procinfo' => {
352 'embperl' => {
353 },
354 },
355 },
356 ) ;
357  
358  
359 # Start of commands
360  
361 %CmdStart = (
362 '-lsearch' => 1,
363 'RTF block cmd' => {
364 'text' => '{',
365 'end' => '}',
366 'unescape' => 1,
367 'nodetype' => ntypStartEndTag,
368 'removespaces' => 2,
369 #'cdatatype' => ntypCDATA,
370 #'cdatatype' => ntypAttrValue,
371 'nodename' => '!:',
372 'inside' => {%ParaBlockInside,},
373 'procinfo' => {
374 'embperl' => {
375 compiletimeperlcodeend => q[ $Embperl::req -> component -> code ('') if (!$_ep_rtf_inside || $_ep_rtf_cmd) ; $_ep_rtf_cmd = 0 ;],
376 perlcodeend => q[ { my $tmp = %#'0% ; if ($tmp =~ /\"\s*$/) { $tmp =~ s/\\\\/\\\\\\\\/g ; push @_ep_rtf_tmp, Text::ParseWords::quotewords('\s+', 0, $tmp) } else { push @_ep_rtf_tmp,$tmp } }],
377 },
378 },
379 # 'procinfo' => {'embperl' => {}},
380 },
381 'RTF field' => {
382 'text' => '{\field',
383 'end' => '}',
384 'nodename' => '!:{:::}',
385 'nodetype' => ntypStartEndTag,
386 'insidemustexist' => 1,
387 'inside' => \%FieldStart,
388 'procinfo' => {
389 'embperl' => {
390 compiletimeperlcode => q[$_ep_rtf_inside++ if ($_ep_rtf_inside) ; ],
391 compiletimeperlcodeend => q[ if ($_ep_rtf_inside) { $_ep_rtf_inside-- ; if ($_ep_rtf_inside == 0) { $Embperl::req -> component -> code ($_ep_rtf_code) ; } } ],
392 },
393 },
394 },
395
396 ) ;
397  
398 # Field start and end
399  
400 %FieldStart = (
401 '-lsearch' => 1,
402 'RTF block inside' => {
403 'text' => '{',
404 'end' => '}',
405 'nodename' => '!:{:::}',
406 'nodetype' => ntypStartEndTag,
407 'cdatatype' => ntypCDATA,
408 'removespaces' => 0,
409 'inside' => \%Block,
410 },
411 'RTF fieldstart' => {
412 'text' => '{\*\fldinst',
413 'end' => '}',
414 'nodename' => '!:',
415 'nodetype' => ntypStartEndTag,
416 #'cdatatype' => ntypCDATA,
417 #'cdatatype' => ntypAttrValue,
418 'inside' => \%CmdStart,
419 'procinfo' => {'embperl' => {}},
420 },
421 'RTF fieldend' => {
422 'text' => '{\fldrslt',
423 'end' => '}',
424 'nodename' => '!',
425 'cdatatype' => ntypAttrValue,
426 'inside' => \%BlockInside,
427 },
428 ) ;
429  
430  
431 =pod
432  
433 =begin comment
434  
435 'RTF first paragraph' => {
436 'text' => '\pard',
437 'end' => '}',
438 'nodename' => '!:::\pard:',
439 'nodetype' => ntypStartTag,
440 'inside' => \%Block,
441 'procinfo' => {
442 'embperl' => {
443 perlcode => q[ do { ],
444 perlcodeend => q[ $_ep_rtf_ndx++;} while ($param[$_ep_rtf_ndx]) ; ],
445 mayjump => 1,
446 },
447 },
448 },
449  
450 =end comment
451  
452 =cut
453  
454 # Finds the first paragraph
455  
456 %Para = (
457 '-lsearch' => 1,
458 'RTF field' => {
459 'text' => '{\field',
460 'end' => '}',
461 'nodename' => '!:{:::}',
462 'nodetype' => ntypStartEndTag,
463 #'cdatatype' => ntypAttrValue,
464 'insidemustexist' => 1,
465 'inside' => \%FieldStart,
466 'procinfo' => {
467 'embperl' => {
468 },
469 },
470 },
471 %ParaBlockInside,
472 ) ;
473  
474 %RTF = (
475 '-lsearch' => 1,
476 'RTF mainblock' => {
477 'text' => '{\rtf1',
478 'end' => '}',
479 'nodename' => '!:{\rtf1:::}',
480 'nodetype' => ntypStartEndTag,
481 'cdatatype' => ntypCDATA,
482 'removespaces' => 0,
483 'inside' => \%Block,
484 'procinfo' => {
485 'embperl' => {
486 perlcode => q[ my @_ep_rtf_stack ; do { ],
487 perlcodeend => q[ $_ep_rtf_ndx++;} while ($param[$_ep_rtf_ndx]) ; ],
488 mayjump => 1,
489 },
490 },
491 },
492 'RTF field' => {
493 'text' => '{\field',
494 'end' => '}',
495 'nodename' => '!:{:::}',
496 'nodetype' => ntypStartEndTag,
497 'insidemustexist' => 1,
498 'inside' => \%FieldStart,
499 'procinfo' => {
500 'embperl' => {
501 },
502 },
503 },
504 ) ;
505  
506 # Basic definition of Block in a RTF file
507  
508 #print "---------\n" ;
509 #foreach (@_ep_rtf_tmp) { print "<$_>\n" ; } ;
510  
511  
512 %Block = (
513 '-lsearch' => 1,
514 # 'RTF block' => {
515 # 'text' => '{',
516 # 'end' => '}',
517 # 'nodename' => '!:{:}:',
518 # 'cdatatype' => ntypAttrValue,
519 # #'forcetype' => ntypAttrValue,
520 # 'removespaces' => 0,
521 # 'inside' => \%Block,
522 # },
523 'RTF block' => {
524 'text' => '{',
525 'end' => '}',
526 'nodename' => '!:{:::}',
527 'nodetype' => ntypStartEndTag,
528 'cdatatype' => ntypCDATA,
529 'removespaces' => 0,
530 'inside' => \%Block,
531 'procinfo' => {
532 'embperl' => {},
533 },
534 },
535 'RTF field' => {
536 'text' => '{\field',
537 'end' => '}',
538 'nodename' => '!:{:::}',
539 'nodetype' => ntypStartEndTag,
540 'insidemustexist' => 1,
541 'inside' => \%FieldStart,
542 'procinfo' => {
543 'embperl' => {
544 compiletimeperlcode => q[$_ep_rtf_inside++ if ($_ep_rtf_inside) ; ],
545 perlcodeend => '%$x%',
546 compiletimeperlcodeend => q[#!-
547 if ($_ep_rtf_inside)
548 {
549 $_ep_rtf_inside-- ;
550 if ($_ep_rtf_inside == 0)
551 {
552 my $x = $Embperl::req -> component -> code ;
553 $_ep_rtf_code =~ s/\$x/$x/g ;
554  
555 $Embperl::req -> component -> code (q[
556 {
557  
558 $_ep_rtf_tmp[0] =~ s/\\\\\\\\[0-9a-zA-Z]+\s*//g ;
559 $_ep_rtf_tmp[1] =~ s/\\\\\\\\[0-9a-zA-Z]+\s*//g ;
560 if ($_ep_rtf_tmp[0] =~ /^\s*(.+?)\s*(=|<|>)$/)
561 {
562 unshift @_ep_rtf_tmp, $1 ;
563 $_ep_rtf_tmp[1] = $2 ;
564 }
565 if ($_ep_rtf_tmp[1] =~ /^(=|<|>)\s*\"?\s*(.+?)\s*$/)
566 {
567 unshift @_ep_rtf_tmp, $_ep_rtf_tmp[0] ;
568 $_ep_rtf_tmp[1] = $1 ;
569 $_ep_rtf_tmp[2] = $2 ;
570 }
571 if (!$_ep_rtf_tmp[1])
572 {
573 my $tmp = shift @_ep_rtf_tmp ;
574 $_ep_rtf_tmp[0] = $tmp ;
575 }
576 if ($_ep_rtf_tmp[4] =~ /^(\\\\\\\\[0-9a-zA-Z]+\s*)+$/)
577 {
578 $_ep_rtf_tmp[4] = $_ep_rtf_tmp[5] ;
579 }
580  
581 my $op = $_ep_rtf_tmp[1] ;
582 if ($op eq '=')
583 { $true = $_ep_rtf_tmp[0] eq $_ep_rtf_tmp[2] }
584 elsif ($op eq '<')
585 { $true = $_ep_rtf_tmp[0] lt $_ep_rtf_tmp[2] }
586 elsif ($op eq '>')
587 { $true = $_ep_rtf_tmp[0] gt $_ep_rtf_tmp[2] }
588 elsif ($op eq '<=')
589 { $true = $_ep_rtf_tmp[0] le $_ep_rtf_tmp[2] }
590 elsif ($op eq '>=')
591 { $true = $_ep_rtf_tmp[0] gt $_ep_rtf_tmp[2] }
592 elsif ($op eq '!=')
593 { $true = $_ep_rtf_tmp[0] ne $_ep_rtf_tmp[2] }
594 elsif ($op eq '<>')
595 { $true = $_ep_rtf_tmp[0] ne $_ep_rtf_tmp[2] }
596  
597 ] . $_ep_rtf_code . '}') ;
598 }
599 }
600 else
601 {
602 $Embperl::req -> component -> code ('') ;
603 }
604 ],
605 },
606 },
607 },
608  
609 'RTF escape open' => {
610 'text' => '\\{',
611 'nodename' => '\\{',
612 'nodetype' => ntypCDATA,
613 },
614 'RTF escape close' => {
615 'text' => '\\}',
616 'nodename' => '\\}',
617 'nodetype' => ntypCDATA,
618 },
619  
620 ) ;
621  
622 # Block inside of a command that should be deleted in the output
623  
624 %BlockInside = (
625 '-lsearch' => 1,
626 'RTF block' => {
627 'text' => '{',
628 'end' => '}',
629 'nodename' => '!',
630 'cdatatype' => ntypAttrValue,
631 'inside' => \%BlockInside,
632 },
633 ) ;
634  
635  
636 1;
637 =pod
638  
639 =begin comment
640  
641 #$Embperl::req -> component -> code ($_ep_rtf_code) ;
642  
643 my $x = $Embperl::req -> component -> code ;
644 my ($op, $cmp, $a, $b) = XML::Embperl::DOM::Node::iChildsText (%$q%,%$x%,1) =~ /\:([=<>])+\s*\"(.*?)\"(?:\s*\"(.*?)\"\s*\"(.*?)\")?/ ;
645
646 if ($op eq '=') { $op = 'eq' }
647 elsif ($op eq '<') { $op = 'lt' }
648 elsif ($op eq '>') { $op = 'gt' }
649 elsif ($op eq '>=') { $op = 'ge' }
650 elsif ($op eq '<=') { $op = 'le' }
651  
652 print "\n#" . __LINE__ . " op = $op cmp = $cmp a = $a b = $b code=$_ep_rtf_code tmp=$_ep_rtf_tmp 0=$param[0]{'adressen_anrede'} ndx=$_ep_rtf_ndx eval=qq[$_ep_rtf_code]\n" ;
653 $_ep_rtf_code =~ s/\$a/q\[$a\]/g ;
654 $_ep_rtf_code =~ s/\$b/q\[$b\]/g ;
655 $_ep_rtf_code =~ s/\$cmp/q\[$cmp\]/g ;
656 $_ep_rtf_code =~ s/\$op/$op/g ;
657 $_ep_rtf_code =~ s/\$x/$x/g ;
658 print "result=$_ep_rtf_code\n" ;
659
660 warn "RTF IF syntax error. Missing operator" if (!$op) ;
661  
662 =end comment
663  
664 =cut
665  
666  
667  
668 __END__