File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/Diff.pm
Criterion Covered Total %
statement 20 39 51.2
branch 0 8 0.0
condition 1 3 33.3
subroutine 4 10 40.0
pod 0 7 0.0
total 25 67 37.3


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 'diff.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 1.02
9             #kate version 2.4
10             #generated: Sun Feb 3 22:02:04 2008, localtime
11              
12             package Syntax::Highlight::Engine::Kate::Diff;
13              
14             our $VERSION = '0.14';
15              
16 1     1   455 use strict;
  1         2  
  1         23  
17 1     1   4 use warnings;
  1         3  
  1         21  
18 1     1   4 use base('Syntax::Highlight::Engine::Kate::Template');
  1         2  
  1         489  
19              
20             sub new {
21 1     1 0 537 my $proto = shift;
22 1   33     7 my $class = ref($proto) || $proto;
23 1         7 my $self = $class->SUPER::new(@_);
24 1         7 $self->attributes({
25             'Added line' => 'String',
26             'Comment' => 'Comment',
27             'Data Type' => 'DataType',
28             'Keyword' => 'Keyword',
29             'Normal Text' => 'Normal',
30             'Removed line' => 'Others',
31             });
32 1         11 $self->contextdata({
33             'Added' => {
34             callback => \&parseAdded,
35             attribute => 'Added line',
36             lineending => '#pop',
37             },
38             'Data' => {
39             callback => \&parseData,
40             attribute => 'Data Type',
41             lineending => '#pop',
42             },
43             'Keyword' => {
44             callback => \&parseKeyword,
45             attribute => 'Keyword',
46             lineending => '#pop',
47             },
48             'Normal' => {
49             callback => \&parseNormal,
50             attribute => 'Normal Text',
51             },
52             'Removed' => {
53             callback => \&parseRemoved,
54             attribute => 'Removed line',
55             lineending => '#pop',
56             },
57             });
58 1         4 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
59 1         4 $self->basecontext('Normal');
60 1         4 $self->keywordscase(0);
61 1         5 $self->initialize;
62 1         2 bless ($self, $class);
63 1         3 return $self;
64             }
65              
66             sub language {
67 0     0 0   return 'Diff';
68             }
69              
70             sub parseAdded {
71 0     0 0   my ($self, $text) = @_;
72 0           return 0;
73             };
74              
75             sub parseData {
76 0     0 0   my ($self, $text) = @_;
77 0           return 0;
78             };
79              
80             sub parseKeyword {
81 0     0 0   my ($self, $text) = @_;
82 0           return 0;
83             };
84              
85             sub parseNormal {
86 0     0 0   my ($self, $text) = @_;
87             # String => '(\+\+\+|\-\-\-|\*\*\*|diff|\d)'
88             # attribute => 'Keyword'
89             # column => '0'
90             # context => 'Keyword'
91             # type => 'RegExpr'
92 0 0         if ($self->testRegExpr($text, '(\\+\\+\\+|\\-\\-\\-|\\*\\*\\*|diff|\\d)', 0, 0, 0, 0, 0, 'Keyword', 'Keyword')) {
93 0           return 1
94             }
95             # String => '(\+|>|!)'
96             # attribute => 'Added line'
97             # column => '0'
98             # context => 'Added'
99             # type => 'RegExpr'
100 0 0         if ($self->testRegExpr($text, '(\\+|>|!)', 0, 0, 0, 0, 0, 'Added', 'Added line')) {
101 0           return 1
102             }
103             # String => '-<'
104             # attribute => 'Removed line'
105             # column => '0'
106             # context => 'Removed'
107             # type => 'AnyChar'
108 0 0         if ($self->testAnyChar($text, '-<', 0, 0, 0, 0, 'Removed', 'Removed line')) {
109 0           return 1
110             }
111             # attribute => 'Data Type'
112             # char => '@'
113             # char1 => '@'
114             # column => '0'
115             # context => 'Data'
116             # type => 'Detect2Chars'
117 0 0         if ($self->testDetect2Chars($text, '@', '@', 0, 0, 0, 0, 0, 'Data', 'Data Type')) {
118 0           return 1
119             }
120 0           return 0;
121             };
122              
123             sub parseRemoved {
124 0     0 0   my ($self, $text) = @_;
125 0           return 0;
126             };
127              
128              
129             1;
130              
131             __END__