Kate/Diff.pm

filter: Statementstmt 53.6% 22 / 41 Branchbran 0.0% 0 / 8 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 40.0% 4 / 10 Podpod 0.0% 0 / 7 totaltotal 38.0% 27 / 71 SCAR 25.1
CC
6
Cov
44%
parseNormal
30.0
new
2.0
language
2.0
CRAP 12.2
« Kate/CMake.pm ↑ Summary Kate/M3U.pm »
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 1 our $VERSION = '0.14';
15  
16 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use base('Syntax::Highlight::Engine::Kate::Template');
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 sub new {
21 1 ▶ my $proto = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
22 1 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
23 1 my $self = $class->SUPER::new(@_);
24 1 $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 $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 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
59 1 $self->basecontext('Normal');
60 1 $self->keywordscase(0);
61 1 $self->initialize;
62 1 bless ($self, $class);
63 1 return $self;
64 }
65  
66 sub language {
67 0 ▶ return 'Diff';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
68 }
69  
70 sub parseAdded {
71 0 ▶ my ($self, $text) = @_;
Subroutine parseAdded: not called CC=1 SCAR=6.9
Pod undocumented
72 0 return 0;
73 };
74  
75 sub parseData {
76 0 ▶ my ($self, $text) = @_;
Subroutine parseData: not called CC=1 SCAR=6.9
Pod undocumented
77 0 return 0;
78 };
79  
80 sub parseKeyword {
81 0 ▶ my ($self, $text) = @_;
Subroutine parseKeyword: not called CC=1 SCAR=6.9
Pod undocumented
82 0 return 0;
83 };
84  
85 sub parseNormal {
86 0 ▶ my ($self, $text) = @_;
Subroutine parseNormal: not called CC=5 SCAR=34.0
Pod undocumented
87 # String => '(\+\+\+|\-\-\-|\*\*\*|diff|\d)'
88 # attribute => 'Keyword'
89 # column => '0'
90 # context => 'Keyword'
91 # type => 'RegExpr'
92 0 ▶ if ($self->testRegExpr($text, '(\\+\\+\\+|\\-\\-\\-|\\*\\*\\*|diff|\\d)', 0, 0, 0, 0, 0, 'Keyword', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(\\+\\+\\+|\\-\\-\\-|\\*\\*\\*|diff|\\d)", 0, 0, 0, 0, 0, "Keyword", "Keyword")) 0 0 0
93 0 return 1
94 }
95 # String => '(\+|>|!)'
96 # attribute => 'Added line'
97 # column => '0'
98 # context => 'Added'
99 # type => 'RegExpr'
100 0 ▶ if ($self->testRegExpr($text, '(\\+|>|!)', 0, 0, 0, 0, 0, 'Added', 'Added line')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(\\+|>|!)", 0, 0, 0, 0, 0, "Added", "Added line")) 0 0 0
101 0 return 1
102 }
103 # String => '-<'
104 # attribute => 'Removed line'
105 # column => '0'
106 # context => 'Removed'
107 # type => 'AnyChar'
108 0 ▶ if ($self->testAnyChar($text, '-<', 0, 0, 0, 0, 'Removed', 'Removed line')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "-<", 0, 0, 0, 0, "Removed", "Removed line")) 0 0 0
109 0 return 1
110 }
111 # attribute => 'Data Type'
112 # char => '@'
113 # char1 => '@'
114 # column => '0'
115 # context => 'Data'
116 # type => 'Detect2Chars'
117 0 ▶ if ($self->testDetect2Chars($text, '@', '@', 0, 0, 0, 0, 0, 'Data', 'Data Type')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "\@", "\@", 0, 0, 0, 0, 0, "Data", "Data Type")) 0 0 0
118 0 return 1
119 }
120 0 return 0;
121 };
122  
123 sub parseRemoved {
124 0 ▶ my ($self, $text) = @_;
Subroutine parseRemoved: not called CC=1 SCAR=6.9
Pod undocumented
125 0 return 0;
126 };
127  
128  
129 1 1;
130  
131 __END__
« Kate/CMake.pm ↑ Summary Kate/M3U.pm »