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.
5 # This file was generated from the 'rpmspec.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #generated: Sun Feb 3 22:02:06 2008, localtime
12 package Syntax::Highlight::Engine::Kate::RPM_Spec;
14 our $VERSION = '0.06';
18 use base('Syntax::Highlight::Engine::Kate::Template');
22 my $class = ref($proto) || $proto;
23 my $self = $class->SUPER::new(@_);
26 'Comment' => 'Comment',
28 'Keyword' => 'Keyword',
29 'Normal Text' => 'Normal',
32 $self->listAdd('keywords',
64 $self->listAdd('types',
71 callback => \&parseComment,
72 attribute => 'Comment',
76 callback => \&parseNormal,
77 attribute => 'Normal Text',
80 callback => \&parseSomeContext,
81 attribute => 'Keyword',
85 callback => \&parseSomeContext2,
90 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
91 $self->basecontext('Normal');
92 $self->keywordscase(0);
94 bless ($self, $class);
103 my ($self, $text) = @_;
108 my ($self, $text) = @_;
109 # String => 'keywords'
110 # attribute => 'Keyword'
113 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
117 # attribute => 'Data'
120 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data')) {
127 if ($self->testRegExpr($text, '%\\w*', 0, 0, 0, undef, 0, '#stay', 'Red')) {
130 # attribute => 'Comment'
132 # context => 'Comment'
133 # type => 'DetectChar'
134 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
138 # attribute => 'Keyword'
139 # context => 'Some Context'
141 if ($self->testRegExpr($text, '\\{\\w*', 0, 0, 0, undef, 0, 'Some Context', 'Keyword')) {
144 # String => '<\s*[\w@\.]*'
145 # attribute => 'Blue'
146 # context => 'Some Context2'
148 if ($self->testRegExpr($text, '<\\s*[\\w@\\.]*', 0, 0, 0, undef, 0, 'Some Context2', 'Blue')) {
152 # attribute => 'Data'
155 if ($self->testRegExpr($text, '\\$\\w*', 0, 0, 0, undef, 0, '#stay', 'Data')) {
158 # String => '(Source|Patch)\d*'
159 # attribute => 'Keyword'
162 if ($self->testRegExpr($text, '(Source|Patch)\\d*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
166 # attribute => 'Keyword'
168 # firstNonSpace => 'true'
170 if ($self->testRegExpr($text, '\\*.*', 0, 0, 0, undef, 1, '#stay', 'Keyword')) {
173 # attribute => 'Blue'
176 if ($self->testInt($text, 0, undef, 0, '#stay', 'Blue')) {
182 sub parseSomeContext {
183 my ($self, $text) = @_;
184 # attribute => 'Keyword'
187 # type => 'DetectChar'
188 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
194 sub parseSomeContext2 {
195 my ($self, $text) = @_;
196 # attribute => 'Blue'
199 # type => 'DetectChar'
200 if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Blue')) {
213 Syntax::Highlight::Engine::Kate::RPM_Spec - a Plugin for RPM Spec syntax highlighting
217 require Syntax::Highlight::Engine::Kate::RPM_Spec;
218 my $sh = new Syntax::Highlight::Engine::Kate::RPM_Spec([
223 Syntax::Highlight::Engine::Kate::RPM_Spec is a plugin module that provides syntax highlighting
224 for RPM Spec to the Syntax::Haghlight::Engine::Kate highlighting engine.
226 This code is generated from the syntax definition files used
228 It works quite fine, but can use refinement and optimization.
230 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
236 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
242 Unknown. If you find any, please contact the author