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 'ini.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.0 |
9
|
|
|
|
|
|
|
#kate author Jan Janssen (medhefgo@web.de) |
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:05 2008, localtime |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::INI_Files; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
477
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
38
|
|
17
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
40
|
|
18
|
1
|
|
|
1
|
|
6
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
530
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
0
|
682
|
my $proto = shift; |
22
|
1
|
|
33
|
|
|
7
|
my $class = ref($proto) || $proto; |
23
|
1
|
|
|
|
|
8
|
my $self = $class->SUPER::new(@_); |
24
|
1
|
|
|
|
|
10
|
$self->attributes({ |
25
|
|
|
|
|
|
|
'Assignment' => 'Others', |
26
|
|
|
|
|
|
|
'Comment' => 'Comment', |
27
|
|
|
|
|
|
|
'Float' => 'Float', |
28
|
|
|
|
|
|
|
'Int' => 'DecVal', |
29
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
30
|
|
|
|
|
|
|
'Normal Text' => 'DataType', |
31
|
|
|
|
|
|
|
'Section' => 'Keyword', |
32
|
|
|
|
|
|
|
'Value' => 'String', |
33
|
|
|
|
|
|
|
}); |
34
|
1
|
|
|
|
|
7
|
$self->listAdd('keywords', |
35
|
|
|
|
|
|
|
'Default', |
36
|
|
|
|
|
|
|
'Defaults', |
37
|
|
|
|
|
|
|
'E_ALL', |
38
|
|
|
|
|
|
|
'E_COMPILE_ERROR', |
39
|
|
|
|
|
|
|
'E_COMPILE_WARNING', |
40
|
|
|
|
|
|
|
'E_CORE_ERROR', |
41
|
|
|
|
|
|
|
'E_CORE_WARNING', |
42
|
|
|
|
|
|
|
'E_ERROR', |
43
|
|
|
|
|
|
|
'E_NOTICE', |
44
|
|
|
|
|
|
|
'E_PARSE', |
45
|
|
|
|
|
|
|
'E_STRICT', |
46
|
|
|
|
|
|
|
'E_USER_ERROR', |
47
|
|
|
|
|
|
|
'E_USER_NOTICE', |
48
|
|
|
|
|
|
|
'E_USER_WARNING', |
49
|
|
|
|
|
|
|
'E_WARNING', |
50
|
|
|
|
|
|
|
'False', |
51
|
|
|
|
|
|
|
'Localhost', |
52
|
|
|
|
|
|
|
'No', |
53
|
|
|
|
|
|
|
'Normal', |
54
|
|
|
|
|
|
|
'Null', |
55
|
|
|
|
|
|
|
'Off', |
56
|
|
|
|
|
|
|
'On', |
57
|
|
|
|
|
|
|
'True', |
58
|
|
|
|
|
|
|
'Yes', |
59
|
|
|
|
|
|
|
); |
60
|
1
|
|
|
|
|
11
|
$self->contextdata({ |
61
|
|
|
|
|
|
|
'Comment' => { |
62
|
|
|
|
|
|
|
callback => \&parseComment, |
63
|
|
|
|
|
|
|
attribute => 'Comment', |
64
|
|
|
|
|
|
|
lineending => '#pop', |
65
|
|
|
|
|
|
|
}, |
66
|
|
|
|
|
|
|
'Value' => { |
67
|
|
|
|
|
|
|
callback => \&parseValue, |
68
|
|
|
|
|
|
|
attribute => 'Value', |
69
|
|
|
|
|
|
|
lineending => '#pop', |
70
|
|
|
|
|
|
|
}, |
71
|
|
|
|
|
|
|
'ini' => { |
72
|
|
|
|
|
|
|
callback => \&parseini, |
73
|
|
|
|
|
|
|
attribute => 'Normal Text', |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
}); |
76
|
1
|
|
|
|
|
6
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
77
|
1
|
|
|
|
|
4
|
$self->basecontext('ini'); |
78
|
1
|
|
|
|
|
5
|
$self->keywordscase(0); |
79
|
1
|
|
|
|
|
3
|
$self->initialize; |
80
|
1
|
|
|
|
|
2
|
bless ($self, $class); |
81
|
1
|
|
|
|
|
3
|
return $self; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub language { |
85
|
0
|
|
|
0
|
0
|
|
return 'INI Files'; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub parseComment { |
89
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
90
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
91
|
0
|
0
|
|
|
|
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
92
|
0
|
|
|
|
|
|
return 1 |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
# context => '##Alerts' |
95
|
|
|
|
|
|
|
# type => 'IncludeRules' |
96
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Alerts', $text)) { |
97
|
0
|
|
|
|
|
|
return 1 |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
100
|
0
|
0
|
|
|
|
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
101
|
0
|
|
|
|
|
|
return 1 |
102
|
|
|
|
|
|
|
} |
103
|
0
|
|
|
|
|
|
return 0; |
104
|
|
|
|
|
|
|
}; |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub parseValue { |
107
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
108
|
|
|
|
|
|
|
# attribute => 'Float' |
109
|
|
|
|
|
|
|
# type => 'Float' |
110
|
0
|
0
|
|
|
|
|
if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { |
111
|
0
|
|
|
|
|
|
return 1 |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
# attribute => 'Int' |
114
|
|
|
|
|
|
|
# type => 'Int' |
115
|
0
|
0
|
|
|
|
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) { |
116
|
0
|
|
|
|
|
|
return 1 |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
# String => 'keywords' |
119
|
|
|
|
|
|
|
# attribute => 'Keyword' |
120
|
|
|
|
|
|
|
# type => 'keyword' |
121
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
122
|
0
|
|
|
|
|
|
return 1 |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
# String => ';.*$' |
125
|
|
|
|
|
|
|
# attribute => 'Comment' |
126
|
|
|
|
|
|
|
# context => '#pop' |
127
|
|
|
|
|
|
|
# type => 'RegExpr' |
128
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, ';.*$', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
129
|
0
|
|
|
|
|
|
return 1 |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
# String => '#.*$' |
132
|
|
|
|
|
|
|
# attribute => 'Comment' |
133
|
|
|
|
|
|
|
# context => '#pop' |
134
|
|
|
|
|
|
|
# type => 'RegExpr' |
135
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
136
|
0
|
|
|
|
|
|
return 1 |
137
|
|
|
|
|
|
|
} |
138
|
0
|
|
|
|
|
|
return 0; |
139
|
|
|
|
|
|
|
}; |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub parseini { |
142
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
143
|
|
|
|
|
|
|
# attribute => 'Section' |
144
|
|
|
|
|
|
|
# beginRegion => 'Section' |
145
|
|
|
|
|
|
|
# char => '[' |
146
|
|
|
|
|
|
|
# char1 => ']' |
147
|
|
|
|
|
|
|
# context => '#pop' |
148
|
|
|
|
|
|
|
# endRegion => 'Section' |
149
|
|
|
|
|
|
|
# type => 'RangeDetect' |
150
|
0
|
0
|
|
|
|
|
if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#pop', 'Section')) { |
151
|
0
|
|
|
|
|
|
return 1 |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
# attribute => 'Assignment' |
154
|
|
|
|
|
|
|
# char => '=' |
155
|
|
|
|
|
|
|
# context => 'Value' |
156
|
|
|
|
|
|
|
# type => 'DetectChar' |
157
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Assignment')) { |
158
|
0
|
|
|
|
|
|
return 1 |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
# attribute => 'Comment' |
161
|
|
|
|
|
|
|
# char => ';' |
162
|
|
|
|
|
|
|
# context => 'Comment' |
163
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
164
|
|
|
|
|
|
|
# type => 'DetectChar' |
165
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 1, 'Comment', 'Comment')) { |
166
|
0
|
|
|
|
|
|
return 1 |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
# attribute => 'Comment' |
169
|
|
|
|
|
|
|
# char => '#' |
170
|
|
|
|
|
|
|
# context => 'Comment' |
171
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
172
|
|
|
|
|
|
|
# type => 'DetectChar' |
173
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Comment', 'Comment')) { |
174
|
0
|
|
|
|
|
|
return 1 |
175
|
|
|
|
|
|
|
} |
176
|
0
|
|
|
|
|
|
return 0; |
177
|
|
|
|
|
|
|
}; |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
__END__ |