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.14';
16              
17 2     2   12 use strict;
  2         3  
  2         48  
18 2     2   8 use warnings;
  2         3  
  2         45  
19 2     2   7 use base('Syntax::Highlight::Engine::Kate::Template');
  2         4  
  2         477  
20              
21             sub new {
22 18     18 0 551 my $proto = shift;
23 18   33     92 my $class = ref($proto) || $proto;
24 18         92 my $self = $class->SUPER::new(@_);
25 18         118 $self->attributes({
26             'Alert' => 'Alert',
27             'Normal Text' => 'Normal',
28             });
29 18         93 $self->listAdd('alerts',
30             '###',
31             'FIXME',
32             'HACK',
33             'NOTE',
34             'NOTICE',
35             'TASK',
36             'TODO',
37             );
38 18         167 $self->contextdata({
39             'Normal Text' => {
40             callback => \&parseNormalText,
41             attribute => 'Normal Text',
42             lineending => '#pop',
43             },
44             });
45 18         80 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
46 18         65 $self->basecontext('Normal Text');
47 18         78 $self->keywordscase(0);
48 18         62 $self->initialize;
49 18         47 bless ($self, $class);
50 18         121 return $self;
51             }
52              
53             sub language {
54 0     0 0 0 return 'Alerts';
55             }
56              
57             sub parseNormalText {
58 14140     14140 0 20196 my ($self, $text) = @_;
59             # String => 'alerts'
60             # attribute => 'Alert'
61             # context => '#stay'
62             # type => 'keyword'
63 14140 100       30420 if ($self->testKeyword($text, 'alerts', 0, undef, 0, '#stay', 'Alert')) {
64 16         50 return 1
65             }
66 14124         36024 return 0;
67             };
68              
69              
70             1;
71              
72             __END__