| 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 'mason.xml' file of the syntax highlight |
|
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.04 |
|
9
|
|
|
|
|
|
|
#kate version 2.1 |
|
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:05 2008, localtime |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::Mason; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
1059
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
53
|
|
|
17
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
36
|
|
|
18
|
1
|
|
|
1
|
|
6
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
2315
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
|
21
|
1
|
|
|
1
|
0
|
845
|
my $proto = shift; |
|
22
|
1
|
|
33
|
|
|
9
|
my $class = ref($proto) || $proto; |
|
23
|
1
|
|
|
|
|
13
|
my $self = $class->SUPER::new(@_); |
|
24
|
1
|
|
|
|
|
24
|
$self->attributes({ |
|
25
|
|
|
|
|
|
|
'Char' => 'Char', |
|
26
|
|
|
|
|
|
|
'Comment' => 'Comment', |
|
27
|
|
|
|
|
|
|
'Data Type' => 'DataType', |
|
28
|
|
|
|
|
|
|
'Decimal' => 'DecVal', |
|
29
|
|
|
|
|
|
|
'Float' => 'Float', |
|
30
|
|
|
|
|
|
|
'HTML' => 'String', |
|
31
|
|
|
|
|
|
|
'Hex' => 'BaseN', |
|
32
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
|
33
|
|
|
|
|
|
|
'Mason Method' => 'Keyword', |
|
34
|
|
|
|
|
|
|
'Mason Tag' => 'Keyword', |
|
35
|
|
|
|
|
|
|
'Octal' => 'BaseN', |
|
36
|
|
|
|
|
|
|
'Pattern' => 'Others', |
|
37
|
|
|
|
|
|
|
'String' => 'String', |
|
38
|
|
|
|
|
|
|
'String Char' => 'Char', |
|
39
|
|
|
|
|
|
|
'Symbol' => 'Normal', |
|
40
|
|
|
|
|
|
|
'normal' => 'Normal', |
|
41
|
|
|
|
|
|
|
}); |
|
42
|
1
|
|
|
|
|
10
|
$self->listAdd('keywords', |
|
43
|
|
|
|
|
|
|
'!', |
|
44
|
|
|
|
|
|
|
'and', |
|
45
|
|
|
|
|
|
|
'bless', |
|
46
|
|
|
|
|
|
|
'caller', |
|
47
|
|
|
|
|
|
|
'chomp', |
|
48
|
|
|
|
|
|
|
'chop', |
|
49
|
|
|
|
|
|
|
'close', |
|
50
|
|
|
|
|
|
|
'cmp', |
|
51
|
|
|
|
|
|
|
'continue', |
|
52
|
|
|
|
|
|
|
'dbmclose', |
|
53
|
|
|
|
|
|
|
'dbmopen', |
|
54
|
|
|
|
|
|
|
'die', |
|
55
|
|
|
|
|
|
|
'do', |
|
56
|
|
|
|
|
|
|
'dump', |
|
57
|
|
|
|
|
|
|
'each', |
|
58
|
|
|
|
|
|
|
'echo', |
|
59
|
|
|
|
|
|
|
'else', |
|
60
|
|
|
|
|
|
|
'elsif', |
|
61
|
|
|
|
|
|
|
'eq', |
|
62
|
|
|
|
|
|
|
'eval', |
|
63
|
|
|
|
|
|
|
'for', |
|
64
|
|
|
|
|
|
|
'foreach', |
|
65
|
|
|
|
|
|
|
'ge', |
|
66
|
|
|
|
|
|
|
'goto', |
|
67
|
|
|
|
|
|
|
'gt', |
|
68
|
|
|
|
|
|
|
'if', |
|
69
|
|
|
|
|
|
|
'import', |
|
70
|
|
|
|
|
|
|
'last', |
|
71
|
|
|
|
|
|
|
'le', |
|
72
|
|
|
|
|
|
|
'local', |
|
73
|
|
|
|
|
|
|
'lt', |
|
74
|
|
|
|
|
|
|
'my', |
|
75
|
|
|
|
|
|
|
'ne', |
|
76
|
|
|
|
|
|
|
'new', |
|
77
|
|
|
|
|
|
|
'next', |
|
78
|
|
|
|
|
|
|
'no', |
|
79
|
|
|
|
|
|
|
'not', |
|
80
|
|
|
|
|
|
|
'open', |
|
81
|
|
|
|
|
|
|
'or', |
|
82
|
|
|
|
|
|
|
'pop', |
|
83
|
|
|
|
|
|
|
'print', |
|
84
|
|
|
|
|
|
|
'push', |
|
85
|
|
|
|
|
|
|
'redo', |
|
86
|
|
|
|
|
|
|
'ref', |
|
87
|
|
|
|
|
|
|
'require', |
|
88
|
|
|
|
|
|
|
'return', |
|
89
|
|
|
|
|
|
|
'split', |
|
90
|
|
|
|
|
|
|
'sub', |
|
91
|
|
|
|
|
|
|
'switch', |
|
92
|
|
|
|
|
|
|
'tie', |
|
93
|
|
|
|
|
|
|
'tied', |
|
94
|
|
|
|
|
|
|
'undef', |
|
95
|
|
|
|
|
|
|
'unless', |
|
96
|
|
|
|
|
|
|
'unlink', |
|
97
|
|
|
|
|
|
|
'untie', |
|
98
|
|
|
|
|
|
|
'use', |
|
99
|
|
|
|
|
|
|
'wantarray', |
|
100
|
|
|
|
|
|
|
'while', |
|
101
|
|
|
|
|
|
|
'xor', |
|
102
|
|
|
|
|
|
|
'||', |
|
103
|
|
|
|
|
|
|
); |
|
104
|
1
|
|
|
|
|
40
|
$self->contextdata({ |
|
105
|
|
|
|
|
|
|
'Commentar 1' => { |
|
106
|
|
|
|
|
|
|
callback => \&parseCommentar1, |
|
107
|
|
|
|
|
|
|
attribute => 'Comment', |
|
108
|
|
|
|
|
|
|
lineending => '#pop', |
|
109
|
|
|
|
|
|
|
}, |
|
110
|
|
|
|
|
|
|
'Commentar 2' => { |
|
111
|
|
|
|
|
|
|
callback => \&parseCommentar2, |
|
112
|
|
|
|
|
|
|
attribute => 'Comment', |
|
113
|
|
|
|
|
|
|
}, |
|
114
|
|
|
|
|
|
|
'Documentation' => { |
|
115
|
|
|
|
|
|
|
callback => \&parseDocumentation, |
|
116
|
|
|
|
|
|
|
attribute => 'Comment', |
|
117
|
|
|
|
|
|
|
}, |
|
118
|
|
|
|
|
|
|
'EmbeddedPerl' => { |
|
119
|
|
|
|
|
|
|
callback => \&parseEmbeddedPerl, |
|
120
|
|
|
|
|
|
|
attribute => 'normal', |
|
121
|
|
|
|
|
|
|
}, |
|
122
|
|
|
|
|
|
|
'HTML' => { |
|
123
|
|
|
|
|
|
|
callback => \&parseHTML, |
|
124
|
|
|
|
|
|
|
attribute => 'HTML', |
|
125
|
|
|
|
|
|
|
}, |
|
126
|
|
|
|
|
|
|
'MethodCall' => { |
|
127
|
|
|
|
|
|
|
callback => \&parseMethodCall, |
|
128
|
|
|
|
|
|
|
attribute => 'Mason Method', |
|
129
|
|
|
|
|
|
|
}, |
|
130
|
|
|
|
|
|
|
'Pattern' => { |
|
131
|
|
|
|
|
|
|
callback => \&parsePattern, |
|
132
|
|
|
|
|
|
|
attribute => 'Pattern', |
|
133
|
|
|
|
|
|
|
}, |
|
134
|
|
|
|
|
|
|
'Pattern2' => { |
|
135
|
|
|
|
|
|
|
callback => \&parsePattern2, |
|
136
|
|
|
|
|
|
|
attribute => 'Pattern', |
|
137
|
|
|
|
|
|
|
}, |
|
138
|
|
|
|
|
|
|
'Pattern3' => { |
|
139
|
|
|
|
|
|
|
callback => \&parsePattern3, |
|
140
|
|
|
|
|
|
|
attribute => 'Pattern', |
|
141
|
|
|
|
|
|
|
}, |
|
142
|
|
|
|
|
|
|
'PerlOneLiner' => { |
|
143
|
|
|
|
|
|
|
callback => \&parsePerlOneLiner, |
|
144
|
|
|
|
|
|
|
attribute => 'String', |
|
145
|
|
|
|
|
|
|
lineending => '#pop', |
|
146
|
|
|
|
|
|
|
}, |
|
147
|
|
|
|
|
|
|
'Something' => { |
|
148
|
|
|
|
|
|
|
callback => \&parseSomething, |
|
149
|
|
|
|
|
|
|
attribute => 'String Char', |
|
150
|
|
|
|
|
|
|
}, |
|
151
|
|
|
|
|
|
|
'String' => { |
|
152
|
|
|
|
|
|
|
callback => \&parseString, |
|
153
|
|
|
|
|
|
|
attribute => 'String', |
|
154
|
|
|
|
|
|
|
}, |
|
155
|
|
|
|
|
|
|
'String2' => { |
|
156
|
|
|
|
|
|
|
callback => \&parseString2, |
|
157
|
|
|
|
|
|
|
attribute => 'String', |
|
158
|
|
|
|
|
|
|
}, |
|
159
|
|
|
|
|
|
|
}); |
|
160
|
1
|
|
|
|
|
9
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
|
161
|
1
|
|
|
|
|
4
|
$self->basecontext('HTML'); |
|
162
|
1
|
|
|
|
|
8
|
$self->keywordscase(0); |
|
163
|
1
|
|
|
|
|
3
|
$self->initialize; |
|
164
|
1
|
|
|
|
|
3
|
bless ($self, $class); |
|
165
|
1
|
|
|
|
|
3
|
return $self; |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub language { |
|
169
|
0
|
|
|
0
|
0
|
|
return 'Mason'; |
|
170
|
|
|
|
|
|
|
} |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub parseCommentar1 { |
|
173
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
174
|
0
|
|
|
|
|
|
return 0; |
|
175
|
|
|
|
|
|
|
}; |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
sub parseCommentar2 { |
|
178
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
179
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
180
|
|
|
|
|
|
|
# char => '*' |
|
181
|
|
|
|
|
|
|
# char1 => '/' |
|
182
|
|
|
|
|
|
|
# context => '#pop' |
|
183
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
184
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
|
185
|
0
|
|
|
|
|
|
return 1 |
|
186
|
|
|
|
|
|
|
} |
|
187
|
0
|
|
|
|
|
|
return 0; |
|
188
|
|
|
|
|
|
|
}; |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
sub parseDocumentation { |
|
191
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
192
|
|
|
|
|
|
|
# String => '%doc>' |
|
193
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
194
|
|
|
|
|
|
|
# context => '#pop' |
|
195
|
|
|
|
|
|
|
# insensitive => 'FALSE' |
|
196
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
197
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '%doc>', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
|
198
|
0
|
|
|
|
|
|
return 1 |
|
199
|
|
|
|
|
|
|
} |
|
200
|
0
|
|
|
|
|
|
return 0; |
|
201
|
|
|
|
|
|
|
}; |
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
sub parseEmbeddedPerl { |
|
204
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
205
|
|
|
|
|
|
|
# attribute => 'Mason Tag' |
|
206
|
|
|
|
|
|
|
# char => '%' |
|
207
|
|
|
|
|
|
|
# char1 => '>' |
|
208
|
|
|
|
|
|
|
# context => '#pop' |
|
209
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
210
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '%', '>', 0, 0, 0, undef, 0, '#pop', 'Mason Tag')) { |
|
211
|
0
|
|
|
|
|
|
return 1 |
|
212
|
|
|
|
|
|
|
} |
|
213
|
|
|
|
|
|
|
# String => '%perl>' |
|
214
|
|
|
|
|
|
|
# attribute => 'Mason Tag' |
|
215
|
|
|
|
|
|
|
# context => '#pop' |
|
216
|
|
|
|
|
|
|
# insensitive => 'FALSE' |
|
217
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
218
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '%perl>', 0, 0, 0, undef, 0, '#pop', 'Mason Tag')) { |
|
219
|
0
|
|
|
|
|
|
return 1 |
|
220
|
|
|
|
|
|
|
} |
|
221
|
|
|
|
|
|
|
# String => '%method>' |
|
222
|
|
|
|
|
|
|
# attribute => 'Mason Tag' |
|
223
|
|
|
|
|
|
|
# context => '#pop' |
|
224
|
|
|
|
|
|
|
# insensitive => 'FALSE' |
|
225
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
226
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '%method>', 0, 0, 0, undef, 0, '#pop', 'Mason Tag')) { |
|
227
|
0
|
|
|
|
|
|
return 1 |
|
228
|
|
|
|
|
|
|
} |
|
229
|
|
|
|
|
|
|
# String => 'keywords' |
|
230
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
231
|
|
|
|
|
|
|
# context => '#stay' |
|
232
|
|
|
|
|
|
|
# type => 'keyword' |
|
233
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
|
234
|
0
|
|
|
|
|
|
return 1 |
|
235
|
|
|
|
|
|
|
} |
|
236
|
|
|
|
|
|
|
# attribute => 'Octal' |
|
237
|
|
|
|
|
|
|
# context => '#stay' |
|
238
|
|
|
|
|
|
|
# type => 'HlCOct' |
|
239
|
0
|
0
|
|
|
|
|
if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { |
|
240
|
0
|
|
|
|
|
|
return 1 |
|
241
|
|
|
|
|
|
|
} |
|
242
|
|
|
|
|
|
|
# attribute => 'Hex' |
|
243
|
|
|
|
|
|
|
# context => '#stay' |
|
244
|
|
|
|
|
|
|
# type => 'HlCHex' |
|
245
|
0
|
0
|
|
|
|
|
if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { |
|
246
|
0
|
|
|
|
|
|
return 1 |
|
247
|
|
|
|
|
|
|
} |
|
248
|
|
|
|
|
|
|
# attribute => 'Decimal' |
|
249
|
|
|
|
|
|
|
# context => '#stay' |
|
250
|
|
|
|
|
|
|
# type => 'Int' |
|
251
|
0
|
0
|
|
|
|
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { |
|
252
|
0
|
|
|
|
|
|
return 1 |
|
253
|
|
|
|
|
|
|
} |
|
254
|
|
|
|
|
|
|
# attribute => 'Char' |
|
255
|
|
|
|
|
|
|
# context => '#stay' |
|
256
|
|
|
|
|
|
|
# type => 'HlCChar' |
|
257
|
0
|
0
|
|
|
|
|
if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { |
|
258
|
0
|
|
|
|
|
|
return 1 |
|
259
|
|
|
|
|
|
|
} |
|
260
|
|
|
|
|
|
|
# String => '^#!.*' |
|
261
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
262
|
|
|
|
|
|
|
# context => '#stay' |
|
263
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
264
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '^#!.*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { |
|
265
|
0
|
|
|
|
|
|
return 1 |
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
# attribute => 'String' |
|
268
|
|
|
|
|
|
|
# char => '"' |
|
269
|
|
|
|
|
|
|
# context => 'String' |
|
270
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
271
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
|
272
|
0
|
|
|
|
|
|
return 1 |
|
273
|
|
|
|
|
|
|
} |
|
274
|
|
|
|
|
|
|
# attribute => 'String' |
|
275
|
|
|
|
|
|
|
# char => ''' |
|
276
|
|
|
|
|
|
|
# context => 'String2' |
|
277
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
278
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String2', 'String')) { |
|
279
|
0
|
|
|
|
|
|
return 1 |
|
280
|
|
|
|
|
|
|
} |
|
281
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
282
|
|
|
|
|
|
|
# char => '`' |
|
283
|
|
|
|
|
|
|
# context => 'String' |
|
284
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
285
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'String', 'String Char')) { |
|
286
|
0
|
|
|
|
|
|
return 1 |
|
287
|
|
|
|
|
|
|
} |
|
288
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
289
|
|
|
|
|
|
|
# char => '/' |
|
290
|
|
|
|
|
|
|
# char1 => '/' |
|
291
|
|
|
|
|
|
|
# context => 'Commentar 1' |
|
292
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
293
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { |
|
294
|
0
|
|
|
|
|
|
return 1 |
|
295
|
|
|
|
|
|
|
} |
|
296
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
297
|
|
|
|
|
|
|
# char => '/' |
|
298
|
|
|
|
|
|
|
# char1 => '*' |
|
299
|
|
|
|
|
|
|
# context => 'Commentar 2' |
|
300
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
301
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { |
|
302
|
0
|
|
|
|
|
|
return 1 |
|
303
|
|
|
|
|
|
|
} |
|
304
|
|
|
|
|
|
|
# attribute => 'Pattern' |
|
305
|
|
|
|
|
|
|
# char => 's' |
|
306
|
|
|
|
|
|
|
# char1 => '/' |
|
307
|
|
|
|
|
|
|
# context => 'Pattern2' |
|
308
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
309
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, 's', '/', 0, 0, 0, undef, 0, 'Pattern2', 'Pattern')) { |
|
310
|
0
|
|
|
|
|
|
return 1 |
|
311
|
|
|
|
|
|
|
} |
|
312
|
|
|
|
|
|
|
# attribute => 'Pattern' |
|
313
|
|
|
|
|
|
|
# char => '/' |
|
314
|
|
|
|
|
|
|
# context => 'Pattern' |
|
315
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
316
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '/', 0, 0, 0, undef, 0, 'Pattern', 'Pattern')) { |
|
317
|
0
|
|
|
|
|
|
return 1 |
|
318
|
|
|
|
|
|
|
} |
|
319
|
|
|
|
|
|
|
# String => '!%&()+,-<=>?[]^{|}~' |
|
320
|
|
|
|
|
|
|
# attribute => 'Symbol' |
|
321
|
|
|
|
|
|
|
# context => '#stay' |
|
322
|
|
|
|
|
|
|
# type => 'AnyChar' |
|
323
|
0
|
0
|
|
|
|
|
if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) { |
|
324
|
0
|
|
|
|
|
|
return 1 |
|
325
|
|
|
|
|
|
|
} |
|
326
|
|
|
|
|
|
|
# String => '\$[0-9]+' |
|
327
|
|
|
|
|
|
|
# attribute => 'Decimal' |
|
328
|
|
|
|
|
|
|
# context => '#stay' |
|
329
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
330
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { |
|
331
|
0
|
|
|
|
|
|
return 1 |
|
332
|
|
|
|
|
|
|
} |
|
333
|
|
|
|
|
|
|
# String => '\$\#?[a-zA-Z_]+[a-zA-Z0-9_]*' |
|
334
|
|
|
|
|
|
|
# attribute => 'Data Type' |
|
335
|
|
|
|
|
|
|
# context => '#stay' |
|
336
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
337
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\$\\#?[a-zA-Z_]+[a-zA-Z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { |
|
338
|
0
|
|
|
|
|
|
return 1 |
|
339
|
|
|
|
|
|
|
} |
|
340
|
|
|
|
|
|
|
# String => '\s+\:' |
|
341
|
|
|
|
|
|
|
# attribute => 'Pattern' |
|
342
|
|
|
|
|
|
|
# context => '#stay' |
|
343
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
344
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\s+\\:', 0, 0, 0, undef, 0, '#stay', 'Pattern')) { |
|
345
|
0
|
|
|
|
|
|
return 1 |
|
346
|
|
|
|
|
|
|
} |
|
347
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
348
|
|
|
|
|
|
|
# char => '#' |
|
349
|
|
|
|
|
|
|
# context => 'Commentar 1' |
|
350
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
351
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { |
|
352
|
0
|
|
|
|
|
|
return 1 |
|
353
|
|
|
|
|
|
|
} |
|
354
|
0
|
|
|
|
|
|
return 0; |
|
355
|
|
|
|
|
|
|
}; |
|
356
|
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
sub parseHTML { |
|
358
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
359
|
|
|
|
|
|
|
# String => '<\%method[^>]*>' |
|
360
|
|
|
|
|
|
|
# attribute => 'Mason Tag' |
|
361
|
|
|
|
|
|
|
# context => 'EmbeddedPerl' |
|
362
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
363
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '<\\%method[^>]*>', 0, 0, 0, undef, 0, 'EmbeddedPerl', 'Mason Tag')) { |
|
364
|
0
|
|
|
|
|
|
return 1 |
|
365
|
|
|
|
|
|
|
} |
|
366
|
|
|
|
|
|
|
# String => '<%method>' |
|
367
|
|
|
|
|
|
|
# attribute => 'Mason Tag' |
|
368
|
|
|
|
|
|
|
# context => 'EmbeddedPerl' |
|
369
|
|
|
|
|
|
|
# insensitive => 'FALSE' |
|
370
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
371
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '<%method>', 0, 0, 0, undef, 0, 'EmbeddedPerl', 'Mason Tag')) { |
|
372
|
0
|
|
|
|
|
|
return 1 |
|
373
|
|
|
|
|
|
|
} |
|
374
|
|
|
|
|
|
|
# String => '<%doc>' |
|
375
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
376
|
|
|
|
|
|
|
# context => 'Documentation' |
|
377
|
|
|
|
|
|
|
# insensitive => 'FALSE' |
|
378
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
379
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '<%doc>', 0, 0, 0, undef, 0, 'Documentation', 'Comment')) { |
|
380
|
0
|
|
|
|
|
|
return 1 |
|
381
|
|
|
|
|
|
|
} |
|
382
|
|
|
|
|
|
|
# String => '<%perl>' |
|
383
|
|
|
|
|
|
|
# attribute => 'Mason Tag' |
|
384
|
|
|
|
|
|
|
# context => 'EmbeddedPerl' |
|
385
|
|
|
|
|
|
|
# insensitive => 'FALSE' |
|
386
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
387
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '<%perl>', 0, 0, 0, undef, 0, 'EmbeddedPerl', 'Mason Tag')) { |
|
388
|
0
|
|
|
|
|
|
return 1 |
|
389
|
|
|
|
|
|
|
} |
|
390
|
|
|
|
|
|
|
# attribute => 'Mason Tag' |
|
391
|
|
|
|
|
|
|
# char => '<' |
|
392
|
|
|
|
|
|
|
# char1 => '%' |
|
393
|
|
|
|
|
|
|
# context => 'EmbeddedPerl' |
|
394
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
395
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '<', '%', 0, 0, 0, undef, 0, 'EmbeddedPerl', 'Mason Tag')) { |
|
396
|
0
|
|
|
|
|
|
return 1 |
|
397
|
|
|
|
|
|
|
} |
|
398
|
|
|
|
|
|
|
# attribute => 'Mason Method' |
|
399
|
|
|
|
|
|
|
# char => '<' |
|
400
|
|
|
|
|
|
|
# char1 => '&' |
|
401
|
|
|
|
|
|
|
# context => 'MethodCall' |
|
402
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
403
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '<', '&', 0, 0, 0, undef, 0, 'MethodCall', 'Mason Method')) { |
|
404
|
0
|
|
|
|
|
|
return 1 |
|
405
|
|
|
|
|
|
|
} |
|
406
|
|
|
|
|
|
|
# String => '^%' |
|
407
|
|
|
|
|
|
|
# attribute => 'Mason Tag' |
|
408
|
|
|
|
|
|
|
# context => 'PerlOneLiner' |
|
409
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
410
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '^%', 0, 0, 0, undef, 0, 'PerlOneLiner', 'Mason Tag')) { |
|
411
|
0
|
|
|
|
|
|
return 1 |
|
412
|
|
|
|
|
|
|
} |
|
413
|
0
|
|
|
|
|
|
return 0; |
|
414
|
|
|
|
|
|
|
}; |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
sub parseMethodCall { |
|
417
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
418
|
|
|
|
|
|
|
# attribute => 'Mason Method' |
|
419
|
|
|
|
|
|
|
# char => '&' |
|
420
|
|
|
|
|
|
|
# char1 => '>' |
|
421
|
|
|
|
|
|
|
# context => '#pop' |
|
422
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
423
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '&', '>', 0, 0, 0, undef, 0, '#pop', 'Mason Method')) { |
|
424
|
0
|
|
|
|
|
|
return 1 |
|
425
|
|
|
|
|
|
|
} |
|
426
|
0
|
|
|
|
|
|
return 0; |
|
427
|
|
|
|
|
|
|
}; |
|
428
|
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
sub parsePattern { |
|
430
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
431
|
|
|
|
|
|
|
# String => '\\[\/\[\]dDwWsSnrtfb0\$@]?' |
|
432
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
433
|
|
|
|
|
|
|
# context => '#stay' |
|
434
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
435
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\\\[\\/\\[\\]dDwWsSnrtfb0\\$@]?', 0, 0, 0, undef, 0, '#stay', 'String Char')) { |
|
436
|
0
|
|
|
|
|
|
return 1 |
|
437
|
|
|
|
|
|
|
} |
|
438
|
|
|
|
|
|
|
# String => '\^[\/\[\]]?' |
|
439
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
440
|
|
|
|
|
|
|
# context => '#stay' |
|
441
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
442
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\^[\\/\\[\\]]?', 0, 0, 0, undef, 0, '#stay', 'String Char')) { |
|
443
|
0
|
|
|
|
|
|
return 1 |
|
444
|
|
|
|
|
|
|
} |
|
445
|
|
|
|
|
|
|
# attribute => 'Pattern' |
|
446
|
|
|
|
|
|
|
# char => '/' |
|
447
|
|
|
|
|
|
|
# context => '#pop' |
|
448
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
449
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '/', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { |
|
450
|
0
|
|
|
|
|
|
return 1 |
|
451
|
|
|
|
|
|
|
} |
|
452
|
0
|
|
|
|
|
|
return 0; |
|
453
|
|
|
|
|
|
|
}; |
|
454
|
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
sub parsePattern2 { |
|
456
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
457
|
|
|
|
|
|
|
# String => '\\[\/\[\]dDwWsSnrtfb0\$@]?' |
|
458
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
459
|
|
|
|
|
|
|
# context => '#stay' |
|
460
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
461
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\\\[\\/\\[\\]dDwWsSnrtfb0\\$@]?', 0, 0, 0, undef, 0, '#stay', 'String Char')) { |
|
462
|
0
|
|
|
|
|
|
return 1 |
|
463
|
|
|
|
|
|
|
} |
|
464
|
|
|
|
|
|
|
# String => '\^[\/\[\]]?' |
|
465
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
466
|
|
|
|
|
|
|
# context => '#stay' |
|
467
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
468
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\^[\\/\\[\\]]?', 0, 0, 0, undef, 0, '#stay', 'String Char')) { |
|
469
|
0
|
|
|
|
|
|
return 1 |
|
470
|
|
|
|
|
|
|
} |
|
471
|
|
|
|
|
|
|
# String => '\/' |
|
472
|
|
|
|
|
|
|
# attribute => 'Pattern' |
|
473
|
|
|
|
|
|
|
# context => 'Pattern3' |
|
474
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
475
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\/', 0, 0, 0, undef, 0, 'Pattern3', 'Pattern')) { |
|
476
|
0
|
|
|
|
|
|
return 1 |
|
477
|
|
|
|
|
|
|
} |
|
478
|
0
|
|
|
|
|
|
return 0; |
|
479
|
|
|
|
|
|
|
}; |
|
480
|
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
sub parsePattern3 { |
|
482
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
483
|
|
|
|
|
|
|
# String => '\\[\/\[\]dDwWsSnrtfb0\$@]?' |
|
484
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
485
|
|
|
|
|
|
|
# context => '#stay' |
|
486
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
487
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\\\[\\/\\[\\]dDwWsSnrtfb0\\$@]?', 0, 0, 0, undef, 0, '#stay', 'String Char')) { |
|
488
|
0
|
|
|
|
|
|
return 1 |
|
489
|
|
|
|
|
|
|
} |
|
490
|
|
|
|
|
|
|
# String => '\^[\/\[\]]?' |
|
491
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
492
|
|
|
|
|
|
|
# context => '#stay' |
|
493
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
494
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\^[\\/\\[\\]]?', 0, 0, 0, undef, 0, '#stay', 'String Char')) { |
|
495
|
0
|
|
|
|
|
|
return 1 |
|
496
|
|
|
|
|
|
|
} |
|
497
|
|
|
|
|
|
|
# String => '\/g?' |
|
498
|
|
|
|
|
|
|
# attribute => 'Pattern' |
|
499
|
|
|
|
|
|
|
# context => '#pop#pop' |
|
500
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
501
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\/g?', 0, 0, 0, undef, 0, '#pop#pop', 'Pattern')) { |
|
502
|
0
|
|
|
|
|
|
return 1 |
|
503
|
|
|
|
|
|
|
} |
|
504
|
0
|
|
|
|
|
|
return 0; |
|
505
|
|
|
|
|
|
|
}; |
|
506
|
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
sub parsePerlOneLiner { |
|
508
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
509
|
|
|
|
|
|
|
# String => 'keywords' |
|
510
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
511
|
|
|
|
|
|
|
# context => '#stay' |
|
512
|
|
|
|
|
|
|
# type => 'keyword' |
|
513
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
|
514
|
0
|
|
|
|
|
|
return 1 |
|
515
|
|
|
|
|
|
|
} |
|
516
|
|
|
|
|
|
|
# attribute => 'Octal' |
|
517
|
|
|
|
|
|
|
# context => '#stay' |
|
518
|
|
|
|
|
|
|
# type => 'HlCOct' |
|
519
|
0
|
0
|
|
|
|
|
if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { |
|
520
|
0
|
|
|
|
|
|
return 1 |
|
521
|
|
|
|
|
|
|
} |
|
522
|
|
|
|
|
|
|
# attribute => 'Hex' |
|
523
|
|
|
|
|
|
|
# context => '#stay' |
|
524
|
|
|
|
|
|
|
# type => 'HlCHex' |
|
525
|
0
|
0
|
|
|
|
|
if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { |
|
526
|
0
|
|
|
|
|
|
return 1 |
|
527
|
|
|
|
|
|
|
} |
|
528
|
|
|
|
|
|
|
# attribute => 'Decimal' |
|
529
|
|
|
|
|
|
|
# context => '#stay' |
|
530
|
|
|
|
|
|
|
# type => 'Int' |
|
531
|
0
|
0
|
|
|
|
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { |
|
532
|
0
|
|
|
|
|
|
return 1 |
|
533
|
|
|
|
|
|
|
} |
|
534
|
|
|
|
|
|
|
# attribute => 'Char' |
|
535
|
|
|
|
|
|
|
# context => '#stay' |
|
536
|
|
|
|
|
|
|
# type => 'HlCChar' |
|
537
|
0
|
0
|
|
|
|
|
if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { |
|
538
|
0
|
|
|
|
|
|
return 1 |
|
539
|
|
|
|
|
|
|
} |
|
540
|
|
|
|
|
|
|
# String => '^#!.*' |
|
541
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
542
|
|
|
|
|
|
|
# context => '#stay' |
|
543
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
544
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '^#!.*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { |
|
545
|
0
|
|
|
|
|
|
return 1 |
|
546
|
|
|
|
|
|
|
} |
|
547
|
|
|
|
|
|
|
# String => '"[^"]*"' |
|
548
|
|
|
|
|
|
|
# attribute => 'String' |
|
549
|
|
|
|
|
|
|
# context => '#stay' |
|
550
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
551
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'String')) { |
|
552
|
0
|
|
|
|
|
|
return 1 |
|
553
|
|
|
|
|
|
|
} |
|
554
|
|
|
|
|
|
|
# String => ''[^']*'' |
|
555
|
|
|
|
|
|
|
# attribute => 'String' |
|
556
|
|
|
|
|
|
|
# context => '#stay' |
|
557
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
558
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'String')) { |
|
559
|
0
|
|
|
|
|
|
return 1 |
|
560
|
|
|
|
|
|
|
} |
|
561
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
562
|
|
|
|
|
|
|
# char => '`' |
|
563
|
|
|
|
|
|
|
# context => 'Something' |
|
564
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
565
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Something', 'String Char')) { |
|
566
|
0
|
|
|
|
|
|
return 1 |
|
567
|
|
|
|
|
|
|
} |
|
568
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
569
|
|
|
|
|
|
|
# char => '/' |
|
570
|
|
|
|
|
|
|
# char1 => '/' |
|
571
|
|
|
|
|
|
|
# context => 'Commentar 1' |
|
572
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
573
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { |
|
574
|
0
|
|
|
|
|
|
return 1 |
|
575
|
|
|
|
|
|
|
} |
|
576
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
577
|
|
|
|
|
|
|
# char => '/' |
|
578
|
|
|
|
|
|
|
# char1 => '*' |
|
579
|
|
|
|
|
|
|
# context => 'Commentar 2' |
|
580
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
581
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { |
|
582
|
0
|
|
|
|
|
|
return 1 |
|
583
|
|
|
|
|
|
|
} |
|
584
|
|
|
|
|
|
|
# attribute => 'Pattern' |
|
585
|
|
|
|
|
|
|
# char => 's' |
|
586
|
|
|
|
|
|
|
# char1 => '/' |
|
587
|
|
|
|
|
|
|
# context => 'Pattern2' |
|
588
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
589
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, 's', '/', 0, 0, 0, undef, 0, 'Pattern2', 'Pattern')) { |
|
590
|
0
|
|
|
|
|
|
return 1 |
|
591
|
|
|
|
|
|
|
} |
|
592
|
|
|
|
|
|
|
# String => '!%&()+,-<=>?[]^{|}~' |
|
593
|
|
|
|
|
|
|
# attribute => 'Symbol' |
|
594
|
|
|
|
|
|
|
# context => '#stay' |
|
595
|
|
|
|
|
|
|
# type => 'AnyChar' |
|
596
|
0
|
0
|
|
|
|
|
if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) { |
|
597
|
0
|
|
|
|
|
|
return 1 |
|
598
|
|
|
|
|
|
|
} |
|
599
|
|
|
|
|
|
|
# String => '\$[0-9]+' |
|
600
|
|
|
|
|
|
|
# attribute => 'Decimal' |
|
601
|
|
|
|
|
|
|
# context => '#stay' |
|
602
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
603
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { |
|
604
|
0
|
|
|
|
|
|
return 1 |
|
605
|
|
|
|
|
|
|
} |
|
606
|
|
|
|
|
|
|
# String => '\$\#?[a-zA-Z_]+[a-zA-Z0-9_]*' |
|
607
|
|
|
|
|
|
|
# attribute => 'Data Type' |
|
608
|
|
|
|
|
|
|
# context => '#stay' |
|
609
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
610
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\$\\#?[a-zA-Z_]+[a-zA-Z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { |
|
611
|
0
|
|
|
|
|
|
return 1 |
|
612
|
|
|
|
|
|
|
} |
|
613
|
|
|
|
|
|
|
# String => '\s+\:' |
|
614
|
|
|
|
|
|
|
# attribute => 'Pattern' |
|
615
|
|
|
|
|
|
|
# context => '#stay' |
|
616
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
617
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\s+\\:', 0, 0, 0, undef, 0, '#stay', 'Pattern')) { |
|
618
|
0
|
|
|
|
|
|
return 1 |
|
619
|
|
|
|
|
|
|
} |
|
620
|
|
|
|
|
|
|
# String => '\#.*' |
|
621
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
622
|
|
|
|
|
|
|
# context => '#stay' |
|
623
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
624
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
|
625
|
0
|
|
|
|
|
|
return 1 |
|
626
|
|
|
|
|
|
|
} |
|
627
|
0
|
|
|
|
|
|
return 0; |
|
628
|
|
|
|
|
|
|
}; |
|
629
|
|
|
|
|
|
|
|
|
630
|
|
|
|
|
|
|
sub parseSomething { |
|
631
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
632
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
633
|
|
|
|
|
|
|
# char => '`' |
|
634
|
|
|
|
|
|
|
# context => '#pop' |
|
635
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
636
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'String Char')) { |
|
637
|
0
|
|
|
|
|
|
return 1 |
|
638
|
|
|
|
|
|
|
} |
|
639
|
0
|
|
|
|
|
|
return 0; |
|
640
|
|
|
|
|
|
|
}; |
|
641
|
|
|
|
|
|
|
|
|
642
|
|
|
|
|
|
|
sub parseString { |
|
643
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
644
|
|
|
|
|
|
|
# attribute => 'String' |
|
645
|
|
|
|
|
|
|
# context => '#stay' |
|
646
|
|
|
|
|
|
|
# type => 'LineContinue' |
|
647
|
0
|
0
|
|
|
|
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { |
|
648
|
0
|
|
|
|
|
|
return 1 |
|
649
|
|
|
|
|
|
|
} |
|
650
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
651
|
|
|
|
|
|
|
# context => '#stay' |
|
652
|
|
|
|
|
|
|
# type => 'HlCStringChar' |
|
653
|
0
|
0
|
|
|
|
|
if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { |
|
654
|
0
|
|
|
|
|
|
return 1 |
|
655
|
|
|
|
|
|
|
} |
|
656
|
|
|
|
|
|
|
# attribute => 'String' |
|
657
|
|
|
|
|
|
|
# char => '"' |
|
658
|
|
|
|
|
|
|
# context => '#pop' |
|
659
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
660
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
|
661
|
0
|
|
|
|
|
|
return 1 |
|
662
|
|
|
|
|
|
|
} |
|
663
|
|
|
|
|
|
|
# String => '\$[0-9]+' |
|
664
|
|
|
|
|
|
|
# attribute => 'Decimal' |
|
665
|
|
|
|
|
|
|
# context => '#stay' |
|
666
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
667
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { |
|
668
|
0
|
|
|
|
|
|
return 1 |
|
669
|
|
|
|
|
|
|
} |
|
670
|
|
|
|
|
|
|
# String => '\$[a-zA-Z_]*[a-zA-Z0-9_]*' |
|
671
|
|
|
|
|
|
|
# attribute => 'Data Type' |
|
672
|
|
|
|
|
|
|
# context => '#stay' |
|
673
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
674
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\$[a-zA-Z_]*[a-zA-Z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { |
|
675
|
0
|
|
|
|
|
|
return 1 |
|
676
|
|
|
|
|
|
|
} |
|
677
|
0
|
|
|
|
|
|
return 0; |
|
678
|
|
|
|
|
|
|
}; |
|
679
|
|
|
|
|
|
|
|
|
680
|
|
|
|
|
|
|
sub parseString2 { |
|
681
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
682
|
|
|
|
|
|
|
# attribute => 'String' |
|
683
|
|
|
|
|
|
|
# context => '#stay' |
|
684
|
|
|
|
|
|
|
# type => 'LineContinue' |
|
685
|
0
|
0
|
|
|
|
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { |
|
686
|
0
|
|
|
|
|
|
return 1 |
|
687
|
|
|
|
|
|
|
} |
|
688
|
|
|
|
|
|
|
# attribute => 'String Char' |
|
689
|
|
|
|
|
|
|
# char => '\' |
|
690
|
|
|
|
|
|
|
# char1 => ''' |
|
691
|
|
|
|
|
|
|
# context => '#stay' |
|
692
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
693
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'String Char')) { |
|
694
|
0
|
|
|
|
|
|
return 1 |
|
695
|
|
|
|
|
|
|
} |
|
696
|
|
|
|
|
|
|
# attribute => 'String' |
|
697
|
|
|
|
|
|
|
# char => ''' |
|
698
|
|
|
|
|
|
|
# context => '#pop' |
|
699
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
700
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { |
|
701
|
0
|
|
|
|
|
|
return 1 |
|
702
|
|
|
|
|
|
|
} |
|
703
|
0
|
|
|
|
|
|
return 0; |
|
704
|
|
|
|
|
|
|
}; |
|
705
|
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
1; |
|
708
|
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
__END__ |