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 'spice.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.01 |
9
|
|
|
|
|
|
|
#kate version 2.3 |
10
|
|
|
|
|
|
|
#kate author Steven Robson (s.a.robson@sms.ed.ac.uk) and Anders Lund |
11
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:06 2008, localtime |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::Spice; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
387
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
18
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
19
|
1
|
|
|
1
|
|
5
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
388
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
2
|
|
|
2
|
0
|
621
|
my $proto = shift; |
23
|
2
|
|
33
|
|
|
10
|
my $class = ref($proto) || $proto; |
24
|
2
|
|
|
|
|
12
|
my $self = $class->SUPER::new(@_); |
25
|
2
|
|
|
|
|
13
|
$self->attributes({ |
26
|
|
|
|
|
|
|
'Comment' => 'Comment', |
27
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
28
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
29
|
|
|
|
|
|
|
'Number' => 'DecVal', |
30
|
|
|
|
|
|
|
'String' => 'String', |
31
|
|
|
|
|
|
|
'String Char' => 'Char', |
32
|
|
|
|
|
|
|
}); |
33
|
2
|
|
|
|
|
18
|
$self->contextdata({ |
34
|
|
|
|
|
|
|
'Commentar 1' => { |
35
|
|
|
|
|
|
|
callback => \&parseCommentar1, |
36
|
|
|
|
|
|
|
attribute => 'Comment', |
37
|
|
|
|
|
|
|
lineending => '#pop', |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
'Normal' => { |
40
|
|
|
|
|
|
|
callback => \&parseNormal, |
41
|
|
|
|
|
|
|
attribute => 'Normal Text', |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
'String' => { |
44
|
|
|
|
|
|
|
callback => \&parseString, |
45
|
|
|
|
|
|
|
attribute => 'String', |
46
|
|
|
|
|
|
|
lineending => '#pop', |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
}); |
49
|
2
|
|
|
|
|
9
|
$self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\.'); |
50
|
2
|
|
|
|
|
6
|
$self->basecontext('Normal'); |
51
|
2
|
|
|
|
|
7
|
$self->keywordscase(0); |
52
|
2
|
|
|
|
|
8
|
$self->initialize; |
53
|
2
|
|
|
|
|
5
|
bless ($self, $class); |
54
|
2
|
|
|
|
|
8
|
return $self; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub language { |
58
|
0
|
|
|
0
|
0
|
0
|
return 'Spice'; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub parseCommentar1 { |
62
|
564
|
|
|
564
|
0
|
1016
|
my ($self, $text) = @_; |
63
|
564
|
|
|
|
|
1137
|
return 0; |
64
|
|
|
|
|
|
|
}; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub parseNormal { |
67
|
682
|
|
|
682
|
0
|
1276
|
my ($self, $text) = @_; |
68
|
|
|
|
|
|
|
# String => '\B\.\w+' |
69
|
|
|
|
|
|
|
# attribute => 'Keyword' |
70
|
|
|
|
|
|
|
# context => '#stay' |
71
|
|
|
|
|
|
|
# type => 'RegExpr' |
72
|
682
|
100
|
|
|
|
2030
|
if ($self->testRegExpr($text, '\\B\\.\\w+', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { |
73
|
14
|
|
|
|
|
42
|
return 1 |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
# attribute => 'Number' |
76
|
|
|
|
|
|
|
# context => '#stay' |
77
|
|
|
|
|
|
|
# type => 'Int' |
78
|
668
|
100
|
|
|
|
2051
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) { |
79
|
30
|
|
|
|
|
99
|
return 1 |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
# attribute => 'Number' |
82
|
|
|
|
|
|
|
# context => '#stay' |
83
|
|
|
|
|
|
|
# type => 'Float' |
84
|
638
|
50
|
|
|
|
1949
|
if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) { |
85
|
0
|
|
|
|
|
0
|
return 1 |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
# String => '$*' |
88
|
|
|
|
|
|
|
# attribute => 'Comment' |
89
|
|
|
|
|
|
|
# context => 'Commentar 1' |
90
|
|
|
|
|
|
|
# type => 'AnyChar' |
91
|
638
|
100
|
|
|
|
1811
|
if ($self->testAnyChar($text, '$*', 0, 0, undef, 0, 'Commentar 1', 'Comment')) { |
92
|
24
|
|
|
|
|
70
|
return 1 |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
# attribute => 'String' |
95
|
|
|
|
|
|
|
# char => '"' |
96
|
|
|
|
|
|
|
# context => 'String' |
97
|
|
|
|
|
|
|
# type => 'DetectChar' |
98
|
614
|
50
|
|
|
|
1698
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
99
|
0
|
|
|
|
|
0
|
return 1 |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
# attribute => 'String' |
102
|
|
|
|
|
|
|
# char => ''' |
103
|
|
|
|
|
|
|
# context => 'String' |
104
|
|
|
|
|
|
|
# type => 'DetectChar' |
105
|
614
|
100
|
|
|
|
1628
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) { |
106
|
2
|
|
|
|
|
9
|
return 1 |
107
|
|
|
|
|
|
|
} |
108
|
612
|
|
|
|
|
1440
|
return 0; |
109
|
|
|
|
|
|
|
}; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub parseString { |
112
|
20
|
|
|
20
|
0
|
46
|
my ($self, $text) = @_; |
113
|
|
|
|
|
|
|
# attribute => 'String' |
114
|
|
|
|
|
|
|
# context => '#stay' |
115
|
|
|
|
|
|
|
# type => 'LineContinue' |
116
|
20
|
50
|
|
|
|
73
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { |
117
|
0
|
|
|
|
|
0
|
return 1 |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
# attribute => 'String Char' |
120
|
|
|
|
|
|
|
# context => '#stay' |
121
|
|
|
|
|
|
|
# type => 'HlCStringChar' |
122
|
20
|
50
|
|
|
|
73
|
if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { |
123
|
0
|
|
|
|
|
0
|
return 1 |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
# attribute => 'String' |
126
|
|
|
|
|
|
|
# char => ''' |
127
|
|
|
|
|
|
|
# context => '#pop' |
128
|
|
|
|
|
|
|
# type => 'DetectChar' |
129
|
20
|
100
|
|
|
|
67
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { |
130
|
2
|
|
|
|
|
7
|
return 1 |
131
|
|
|
|
|
|
|
} |
132
|
18
|
|
|
|
|
45
|
return 0; |
133
|
|
|
|
|
|
|
}; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
1; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
__END__ |