File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/Alerts.pm
Criterion Covered Total %
statement 25 26 96.1
branch 2 2 100.0
condition 1 3 33.3
subroutine 5 6 83.3
pod 0 3 0.0
total 33 40 82.5


line stmt bran cond sub pod time code
1             # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2             # This program is free software; you can redistribute it and/or
3             # modify it under the same terms as Perl itself.
4              
5             # This file was generated from the 'alert.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 1.06
9             #kate version 2.3
10             #kate author Dominik Haumann (dhdev@gmx.de)
11             #generated: Sun Feb 3 22:02:04 2008, localtime
12              
13             package Syntax::Highlight::Engine::Kate::Alerts;
14              
15             our $VERSION = '0.16';
16              
17 3     3   26 use strict;
  3         9  
  3         162  
18 3     3   25 use warnings;
  3         7  
  3         328  
19 3     3   21 use base('Syntax::Highlight::Engine::Kate::Template');
  3         6  
  3         1413  
20              
21             sub new {
22 19     19 0 1396 my $proto = shift;
23 19   33     130 my $class = ref($proto) || $proto;
24 19         120 my $self = $class->SUPER::new(@_);
25 19         162 $self->attributes({
26             'Alert' => 'Alert',
27             'Normal Text' => 'Normal',
28             });
29 19         144 $self->listAdd('alerts',
30             '###',
31             'FIXME',
32             'HACK',
33             'NOTE',
34             'NOTICE',
35             'TASK',
36             'TODO',
37             );
38 19         268 $self->contextdata({
39             'Normal Text' => {
40             callback => \&parseNormalText,
41             attribute => 'Normal Text',
42             lineending => '#pop',
43             },
44             });
45 19         106 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
46 19         146 $self->basecontext('Normal Text');
47 19         105 $self->keywordscase(0);
48 19         69 $self->initialize;
49 19         54 bless ($self, $class);
50 19         203 return $self;
51             }
52              
53             sub language {
54 0     0 0 0 return 'Alerts';
55             }
56              
57             sub parseNormalText {
58 11115     11115 0 23591 my ($self, $text) = @_;
59             # String => 'alerts'
60             # attribute => 'Alert'
61             # context => '#stay'
62             # type => 'keyword'
63 11115 100       37218 if ($self->testKeyword($text, 'alerts', 0, undef, 0, '#stay', 'Alert')) {
64 16         85 return 1
65             }
66 11099         55544 return 0;
67             };
68              
69              
70             1;
71              
72             __END__