Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Diff.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 our $VERSION = '0.06';
15
16 use strict;
17 use warnings;
18 use base('Syntax::Highlight::Engine::Kate::Template');
19
20 sub new {
21    my $proto = shift;
22    my $class = ref($proto) || $proto;
23    my $self = $class->SUPER::new(@_);
24    $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    $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    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
59    $self->basecontext('Normal');
60    $self->keywordscase(0);
61    $self->initialize;
62    bless ($self, $class);
63    return $self;
64 }
65
66 sub language {
67    return 'Diff';
68 }
69
70 sub parseAdded {
71    my ($self, $text) = @_;
72    return 0;
73 };
74
75 sub parseData {
76    my ($self, $text) = @_;
77    return 0;
78 };
79
80 sub parseKeyword {
81    my ($self, $text) = @_;
82    return 0;
83 };
84
85 sub parseNormal {
86    my ($self, $text) = @_;
87    # String => '(\+\+\+|\-\-\-|\*\*\*|diff|\d)'
88    # attribute => 'Keyword'
89    # column => '0'
90    # context => 'Keyword'
91    # type => 'RegExpr'
92    if ($self->testRegExpr($text, '(\\+\\+\\+|\\-\\-\\-|\\*\\*\\*|diff|\\d)', 0, 0, 0, 0, 0, 'Keyword', 'Keyword')) {
93       return 1
94    }
95    # String => '(\+|>|!)'
96    # attribute => 'Added line'
97    # column => '0'
98    # context => 'Added'
99    # type => 'RegExpr'
100    if ($self->testRegExpr($text, '(\\+|>|!)', 0, 0, 0, 0, 0, 'Added', 'Added line')) {
101       return 1
102    }
103    # String => '-<'
104    # attribute => 'Removed line'
105    # column => '0'
106    # context => 'Removed'
107    # type => 'AnyChar'
108    if ($self->testAnyChar($text, '-<', 0, 0, 0, 0, 'Removed', 'Removed line')) {
109       return 1
110    }
111    # attribute => 'Data Type'
112    # char => '@'
113    # char1 => '@'
114    # column => '0'
115    # context => 'Data'
116    # type => 'Detect2Chars'
117    if ($self->testDetect2Chars($text, '@', '@', 0, 0, 0, 0, 0, 'Data', 'Data Type')) {
118       return 1
119    }
120    return 0;
121 };
122
123 sub parseRemoved {
124    my ($self, $text) = @_;
125    return 0;
126 };
127
128
129 1;
130
131 __END__
132
133 =head1 NAME
134
135 Syntax::Highlight::Engine::Kate::Diff - a Plugin for Diff syntax highlighting
136
137 =head1 SYNOPSIS
138
139  require Syntax::Highlight::Engine::Kate::Diff;
140  my $sh = new Syntax::Highlight::Engine::Kate::Diff([
141  ]);
142
143 =head1 DESCRIPTION
144
145 Syntax::Highlight::Engine::Kate::Diff is a  plugin module that provides syntax highlighting
146 for Diff to the Syntax::Haghlight::Engine::Kate highlighting engine.
147
148 This code is generated from the syntax definition files used
149 by the Kate project.
150 It works quite fine, but can use refinement and optimization.
151
152 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
153
154 =cut
155
156 =head1 AUTHOR
157
158 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
159
160 =cut
161
162 =head1 BUGS
163
164 Unknown. If you find any, please contact the author
165
166 =cut
167