~ubuntu-branches/debian/sid/libembperl-perl/sid

« back to all changes in this revision

Viewing changes to Embperl/Syntax/RTF.pm

  • Committer: Bazaar Package Importer
  • Author(s): Gunnar Wolf
  • Date: 2007-03-26 11:49:17 UTC
  • mfrom: (3.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20070326114917-717f30vfkvbdasd5
Tags: 2.2.0-1.2
* Non-maintainer upload.
* No longer spawns Apache processes to run the test scripts, as it leads
  to FTBFS (Closes: #416016)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
###################################################################################
3
3
#
4
 
#   Embperl - Copyright (c) 1997-2004 Gerald Richter / ECOS
 
4
#   Embperl - Copyright (c) 1997-2005 Gerald Richter / ECOS
5
5
#
6
6
#   You may distribute under the terms of either the GNU General Public
7
7
#   License or the Artistic License, as specified in the Perl README file.
10
10
#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11
11
#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12
12
#
13
 
#   $Id: RTF.pm,v 1.3 2004/01/23 06:50:57 richter Exp $
 
13
#   $Id: RTF.pm 355574 2005-12-09 18:15:54Z richter $
14
14
#
15
15
###################################################################################
16
16
 
272
272
                            'cdatatype' => 0,
273
273
                            },
274
274
                            ) ;
275
 
 
276
 
 
277
 
=pod
278
 
    $self -> AddRTFCmdWithEnd ('if', 'endif',
279
 
                            {
280
 
                            perlcode    => 'if (%&<noname>%) { ', 
281
 
                            removenode  => 10,
282
 
                            mayjump     => 1,
283
 
                            stackname   => 'metacmd',
284
 
                            'push'      => 'if',
285
 
                            }) ;
286
 
 
287
 
    $self -> AddRTFCmdWithEnd  ('else', 'endif',
288
 
                            { 
289
 
                            perlcode => '} else {',
290
 
                            removenode => 10,
291
 
                            mayjump     => 1,
292
 
                            stackname   => 'metacmd',
293
 
                            stackmatch  => 'if',
294
 
                            'push'      => 'if',
295
 
                            }) ;
296
 
    $self -> AddRTFCmdWithEnd  ('elsif', 'endif',
297
 
                            { 
298
 
                            perlcode => '} elsif (%&<noname>%) { ', 
299
 
                            removenode => 10,
300
 
                            mayjump     => 1,
301
 
                            stackname   => 'metacmd',
302
 
                            stackmatch  => 'if',
303
 
                            'push'      => 'if',
304
 
                            }) ;
305
 
    $self -> AddRTFCmd ('endif',
306
 
                            { 
307
 
                            perlcode => '}', 
308
 
                            removenode => 10,
309
 
                            mayjump     => 1,
310
 
                            stackname   => 'metacmd',
311
 
                            stackmatch  => 'if',
312
 
                            }) ;
313
 
    $self -> AddRTFCmdBlock  ('while', 'endwhile',
314
 
                { 
315
 
                perlcode => 'while (%&<noname>%) { ', 
316
 
                removenode => 10,
317
 
                mayjump     => 1,
318
 
                },
319
 
                { 
320
 
                perlcode => '};', 
321
 
                removenode => 10,
322
 
                mayjump     => 1,
323
 
                }) ;
324
 
    $self -> AddRTFCmdBlock  ('foreach', 'endforeach',
325
 
                { 
326
 
                perlcode => 'foreach %&<noname>% { ', 
327
 
                removenode => 10,
328
 
                mayjump     => 1,
329
 
                },
330
 
                { 
331
 
                perlcode => '};', 
332
 
                removenode => 10,
333
 
                mayjump     => 1,
334
 
                }) ;
335
 
    $self -> AddRTFCmdBlock  ('do', 'until',
336
 
                { 
337
 
                perlcode => 'do { ', 
338
 
                removenode => 10,
339
 
                mayjump     => 1,
340
 
                },
341
 
                { 
342
 
                perlcode => '} until (%&<noname>%) ; ',
343
 
                removenode => 10,
344
 
                mayjump     => 1,
345
 
                }) ;
346
 
    $self -> AddRTFCmd ('var',
347
 
                { 
348
 
                compiletimeperlcode => 'use strict ; use vars qw{%%CLEANUP %&<noname>%} ; map { $CLEANUP{substr($_,1)} = 1 } qw{%&<noname>%} ;', 
349
 
                perlcode => 'use strict ;', 
350
 
                removenode => 3,
351
 
                }) ;
352
 
    $self -> AddRTFCmd ('hidden',
353
 
                { 
354
 
                perlcode => '_ep_hid(%$n%,%&\'<noname>%);', 
355
 
                removenode => 8,
356
 
                }) ;
357
 
    $self -> AddRTFCmd ('syntax',
358
 
                { 
359
 
                compiletimeperlcode => '$_[0] -> Syntax (Embperl::Syntax::GetSyntax(%&\'<noname>%, $_[0] -> SyntaxName));', 
360
 
                removenode => 3,
361
 
                },
362
 
                { 
363
 
                parsetimeperlcode => '$_[0] -> Syntax (Embperl::Syntax::GetSyntax(\'%%\', $_[0] -> SyntaxName)) ;', 
364
 
                },
365
 
                ) ;
366
 
    $self -> AddRTFCmdBlock ('sub', 'endsub',
367
 
                { 
368
 
                perlcode => 'sub _ep_sub_%&<noname>% { ', 
369
 
                removenode => 10,
370
 
                mayjump     => 1,
371
 
                stackname2   => 'subname',
372
 
                push2        => '%&<noname>%',
373
 
                switchcodetype => 2,
374
 
                },
375
 
                { 
376
 
                perlcode => '};  sub %^subname% { my @_ep_save ; Embperl::Cmd::SubStart(\\$_ep_DomTree,%$q%,\\@_ep_save); my $_ep_ret = _ep_sub_%^subname% (@_); Embperl::Cmd::SubEnd(\\@_ep_save); return $_ep_ret } ; $_[0] -> ExportHash ->
377
 
 
378
 
 
379
 
 
380
 
 {%^"subname%} = \&%^subname% ; ', 
381
 
                removenode => 10,
382
 
                mayjump     => 1,
383
 
                pop2        => 'subname',
384
 
                switchcodetype => 1,
385
 
                }) ;
386
 
 
387
 
=cut
388
 
 
389
 
    } 
 
275
    }
390
276
 
391
277
 
392
278