| 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.16'; | |||||||||||||||||||
| 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 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 21 | 1 | my $proto = shift; | |||||||||||||||||||
| 22 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 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 | 0 | ▶ | sub language { | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 67 | 0 | return 'Diff'; | |||||||||||||||||||
| 68 | } | ||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | 0 | ▶ | sub parseAdded { | ||||||||||||||||||
|
Subroutine
parseAdded: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 71 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 72 | 0 | return 0; | |||||||||||||||||||
| 73 | }; | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 0 | ▶ | sub parseData { | ||||||||||||||||||
|
Subroutine
parseData: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 76 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 77 | 0 | return 0; | |||||||||||||||||||
| 78 | }; | ||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | 0 | ▶ | sub parseKeyword { | ||||||||||||||||||
|
Subroutine
parseKeyword: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 81 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 82 | 0 | return 0; | |||||||||||||||||||
| 83 | }; | ||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 0 | ▶ | sub parseNormal { | ||||||||||||||||||
|
Subroutine
parseNormal: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 86 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 118 | 0 | return 1 | |||||||||||||||||||
| 119 | } | ||||||||||||||||||||
| 120 | 0 | return 0; | |||||||||||||||||||
| 121 | }; | ||||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | 0 | ▶ | sub parseRemoved { | ||||||||||||||||||
|
Subroutine
parseRemoved: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 124 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 125 | 0 | return 0; | |||||||||||||||||||
| 126 | }; | ||||||||||||||||||||
| 127 | |||||||||||||||||||||
| 128 | |||||||||||||||||||||
| 129 | 1 | 1; | |||||||||||||||||||
| 130 | |||||||||||||||||||||
| 131 | __END__ | ||||||||||||||||||||