| 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 'modula-2.xml' file of the syntax highlight |
|
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.03 |
|
9
|
|
|
|
|
|
|
#kate version 2.1 |
|
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:05 2008, localtime |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::Modulaminus2; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
1099
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
47
|
|
|
17
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
39
|
|
|
18
|
1
|
|
|
1
|
|
7
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
1027
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
|
21
|
1
|
|
|
1
|
0
|
678
|
my $proto = shift; |
|
22
|
1
|
|
33
|
|
|
11
|
my $class = ref($proto) || $proto; |
|
23
|
1
|
|
|
|
|
12
|
my $self = $class->SUPER::new(@_); |
|
24
|
1
|
|
|
|
|
18
|
$self->attributes({ |
|
25
|
|
|
|
|
|
|
'Comment' => 'Comment', |
|
26
|
|
|
|
|
|
|
'Directive' => 'Others', |
|
27
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
|
28
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
|
29
|
|
|
|
|
|
|
'Number' => 'DecVal', |
|
30
|
|
|
|
|
|
|
'String' => 'String', |
|
31
|
|
|
|
|
|
|
'Type' => 'DataType', |
|
32
|
|
|
|
|
|
|
}); |
|
33
|
1
|
|
|
|
|
11
|
$self->listAdd('directives', |
|
34
|
|
|
|
|
|
|
'ALLOCATE', |
|
35
|
|
|
|
|
|
|
'ASSEMBLER', |
|
36
|
|
|
|
|
|
|
'Accessible', |
|
37
|
|
|
|
|
|
|
'Append', |
|
38
|
|
|
|
|
|
|
'Assign', |
|
39
|
|
|
|
|
|
|
'CAPS', |
|
40
|
|
|
|
|
|
|
'Close', |
|
41
|
|
|
|
|
|
|
'Concat', |
|
42
|
|
|
|
|
|
|
'Copy', |
|
43
|
|
|
|
|
|
|
'DEALLOCATE', |
|
44
|
|
|
|
|
|
|
'Delete', |
|
45
|
|
|
|
|
|
|
'Done', |
|
46
|
|
|
|
|
|
|
'EOF', |
|
47
|
|
|
|
|
|
|
'EmptyString', |
|
48
|
|
|
|
|
|
|
'Erase', |
|
49
|
|
|
|
|
|
|
'GetArgs', |
|
50
|
|
|
|
|
|
|
'GetCard', |
|
51
|
|
|
|
|
|
|
'GetChar', |
|
52
|
|
|
|
|
|
|
'GetEnv', |
|
53
|
|
|
|
|
|
|
'GetInt', |
|
54
|
|
|
|
|
|
|
'GetLongReal', |
|
55
|
|
|
|
|
|
|
'GetReal', |
|
56
|
|
|
|
|
|
|
'GetString', |
|
57
|
|
|
|
|
|
|
'Insert', |
|
58
|
|
|
|
|
|
|
'Length', |
|
59
|
|
|
|
|
|
|
'Open', |
|
60
|
|
|
|
|
|
|
'OpenInput', |
|
61
|
|
|
|
|
|
|
'OpenOutput', |
|
62
|
|
|
|
|
|
|
'PutBf', |
|
63
|
|
|
|
|
|
|
'PutCard', |
|
64
|
|
|
|
|
|
|
'PutChar', |
|
65
|
|
|
|
|
|
|
'PutInt', |
|
66
|
|
|
|
|
|
|
'PutLn', |
|
67
|
|
|
|
|
|
|
'PutLongReal', |
|
68
|
|
|
|
|
|
|
'PutReal', |
|
69
|
|
|
|
|
|
|
'PutString', |
|
70
|
|
|
|
|
|
|
'Read', |
|
71
|
|
|
|
|
|
|
'ReadCard', |
|
72
|
|
|
|
|
|
|
'ReadInt', |
|
73
|
|
|
|
|
|
|
'ReadLongReal', |
|
74
|
|
|
|
|
|
|
'ReadReal', |
|
75
|
|
|
|
|
|
|
'ReadString', |
|
76
|
|
|
|
|
|
|
'ResetClock', |
|
77
|
|
|
|
|
|
|
'SIZE', |
|
78
|
|
|
|
|
|
|
'StrEq', |
|
79
|
|
|
|
|
|
|
'SystemTime', |
|
80
|
|
|
|
|
|
|
'UserTime', |
|
81
|
|
|
|
|
|
|
'Write', |
|
82
|
|
|
|
|
|
|
'WriteBf', |
|
83
|
|
|
|
|
|
|
'WriteCard', |
|
84
|
|
|
|
|
|
|
'WriteInt', |
|
85
|
|
|
|
|
|
|
'WriteLn', |
|
86
|
|
|
|
|
|
|
'WriteLongReal', |
|
87
|
|
|
|
|
|
|
'WriteReal', |
|
88
|
|
|
|
|
|
|
'WriteString', |
|
89
|
|
|
|
|
|
|
'compare', |
|
90
|
|
|
|
|
|
|
'pos', |
|
91
|
|
|
|
|
|
|
); |
|
92
|
1
|
|
|
|
|
7
|
$self->listAdd('keywords', |
|
93
|
|
|
|
|
|
|
'ABS', |
|
94
|
|
|
|
|
|
|
'AND', |
|
95
|
|
|
|
|
|
|
'ARRAY', |
|
96
|
|
|
|
|
|
|
'ASM', |
|
97
|
|
|
|
|
|
|
'BEGIN', |
|
98
|
|
|
|
|
|
|
'BITSET', |
|
99
|
|
|
|
|
|
|
'BY', |
|
100
|
|
|
|
|
|
|
'CAP', |
|
101
|
|
|
|
|
|
|
'CASE', |
|
102
|
|
|
|
|
|
|
'CHR', |
|
103
|
|
|
|
|
|
|
'CONST', |
|
104
|
|
|
|
|
|
|
'DEC', |
|
105
|
|
|
|
|
|
|
'DEFINITION', |
|
106
|
|
|
|
|
|
|
'DIV', |
|
107
|
|
|
|
|
|
|
'DO', |
|
108
|
|
|
|
|
|
|
'ELSE', |
|
109
|
|
|
|
|
|
|
'ELSIF', |
|
110
|
|
|
|
|
|
|
'END', |
|
111
|
|
|
|
|
|
|
'EXCL', |
|
112
|
|
|
|
|
|
|
'EXIT', |
|
113
|
|
|
|
|
|
|
'EXPORT', |
|
114
|
|
|
|
|
|
|
'FALSE', |
|
115
|
|
|
|
|
|
|
'FOR', |
|
116
|
|
|
|
|
|
|
'FOREIGN', |
|
117
|
|
|
|
|
|
|
'FROM', |
|
118
|
|
|
|
|
|
|
'HALT', |
|
119
|
|
|
|
|
|
|
'HIGH', |
|
120
|
|
|
|
|
|
|
'IF', |
|
121
|
|
|
|
|
|
|
'IMPLEMENTATION', |
|
122
|
|
|
|
|
|
|
'IMPORT', |
|
123
|
|
|
|
|
|
|
'IN', |
|
124
|
|
|
|
|
|
|
'INC', |
|
125
|
|
|
|
|
|
|
'INCL', |
|
126
|
|
|
|
|
|
|
'IOTRANSFER', |
|
127
|
|
|
|
|
|
|
'LOOP', |
|
128
|
|
|
|
|
|
|
'MAX', |
|
129
|
|
|
|
|
|
|
'MIN', |
|
130
|
|
|
|
|
|
|
'MOD', |
|
131
|
|
|
|
|
|
|
'MODULE', |
|
132
|
|
|
|
|
|
|
'NEWPROCESS', |
|
133
|
|
|
|
|
|
|
'NIL', |
|
134
|
|
|
|
|
|
|
'NOT', |
|
135
|
|
|
|
|
|
|
'ODD', |
|
136
|
|
|
|
|
|
|
'OF', |
|
137
|
|
|
|
|
|
|
'OR', |
|
138
|
|
|
|
|
|
|
'ORD', |
|
139
|
|
|
|
|
|
|
'PROC', |
|
140
|
|
|
|
|
|
|
'PROCEDURE', |
|
141
|
|
|
|
|
|
|
'QUALIFIED', |
|
142
|
|
|
|
|
|
|
'RECORD', |
|
143
|
|
|
|
|
|
|
'REPEAT', |
|
144
|
|
|
|
|
|
|
'RETURN', |
|
145
|
|
|
|
|
|
|
'SET', |
|
146
|
|
|
|
|
|
|
'THEN', |
|
147
|
|
|
|
|
|
|
'TO', |
|
148
|
|
|
|
|
|
|
'TRANSFER', |
|
149
|
|
|
|
|
|
|
'TRUE', |
|
150
|
|
|
|
|
|
|
'TRUNC', |
|
151
|
|
|
|
|
|
|
'TYPE', |
|
152
|
|
|
|
|
|
|
'UNTIL', |
|
153
|
|
|
|
|
|
|
'VAL', |
|
154
|
|
|
|
|
|
|
'VAR', |
|
155
|
|
|
|
|
|
|
'WHILE', |
|
156
|
|
|
|
|
|
|
'WITH', |
|
157
|
|
|
|
|
|
|
); |
|
158
|
1
|
|
|
|
|
7
|
$self->listAdd('types', |
|
159
|
|
|
|
|
|
|
'ADDRESS', |
|
160
|
|
|
|
|
|
|
'ADR', |
|
161
|
|
|
|
|
|
|
'BOOLEAN', |
|
162
|
|
|
|
|
|
|
'CARDINAL', |
|
163
|
|
|
|
|
|
|
'CHAR', |
|
164
|
|
|
|
|
|
|
'File', |
|
165
|
|
|
|
|
|
|
'INTEGER', |
|
166
|
|
|
|
|
|
|
'LONGINT', |
|
167
|
|
|
|
|
|
|
'LONGREAL', |
|
168
|
|
|
|
|
|
|
'POINTER', |
|
169
|
|
|
|
|
|
|
'REAL', |
|
170
|
|
|
|
|
|
|
'SHORTCARD', |
|
171
|
|
|
|
|
|
|
'SHORTINT', |
|
172
|
|
|
|
|
|
|
); |
|
173
|
1
|
|
|
|
|
32
|
$self->contextdata({ |
|
174
|
|
|
|
|
|
|
'Comment2' => { |
|
175
|
|
|
|
|
|
|
callback => \&parseComment2, |
|
176
|
|
|
|
|
|
|
attribute => 'Comment', |
|
177
|
|
|
|
|
|
|
}, |
|
178
|
|
|
|
|
|
|
'Comment3' => { |
|
179
|
|
|
|
|
|
|
callback => \&parseComment3, |
|
180
|
|
|
|
|
|
|
attribute => 'Comment', |
|
181
|
|
|
|
|
|
|
lineending => '#pop', |
|
182
|
|
|
|
|
|
|
}, |
|
183
|
|
|
|
|
|
|
'Normal' => { |
|
184
|
|
|
|
|
|
|
callback => \&parseNormal, |
|
185
|
|
|
|
|
|
|
attribute => 'Normal Text', |
|
186
|
|
|
|
|
|
|
}, |
|
187
|
|
|
|
|
|
|
'Prep1' => { |
|
188
|
|
|
|
|
|
|
callback => \&parsePrep1, |
|
189
|
|
|
|
|
|
|
attribute => 'Directive', |
|
190
|
|
|
|
|
|
|
}, |
|
191
|
|
|
|
|
|
|
'String1' => { |
|
192
|
|
|
|
|
|
|
callback => \&parseString1, |
|
193
|
|
|
|
|
|
|
attribute => 'String', |
|
194
|
|
|
|
|
|
|
lineending => '#pop', |
|
195
|
|
|
|
|
|
|
}, |
|
196
|
|
|
|
|
|
|
'String2' => { |
|
197
|
|
|
|
|
|
|
callback => \&parseString2, |
|
198
|
|
|
|
|
|
|
attribute => 'String', |
|
199
|
|
|
|
|
|
|
lineending => '#pop', |
|
200
|
|
|
|
|
|
|
}, |
|
201
|
|
|
|
|
|
|
}); |
|
202
|
1
|
|
|
|
|
9
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
|
203
|
1
|
|
|
|
|
4
|
$self->basecontext('Normal'); |
|
204
|
1
|
|
|
|
|
9
|
$self->keywordscase(0); |
|
205
|
1
|
|
|
|
|
6
|
$self->initialize; |
|
206
|
1
|
|
|
|
|
4
|
bless ($self, $class); |
|
207
|
1
|
|
|
|
|
5
|
return $self; |
|
208
|
|
|
|
|
|
|
} |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub language { |
|
211
|
0
|
|
|
0
|
0
|
|
return 'Modula-2'; |
|
212
|
|
|
|
|
|
|
} |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
sub parseComment2 { |
|
215
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
216
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
217
|
|
|
|
|
|
|
# char => '*' |
|
218
|
|
|
|
|
|
|
# char1 => ')' |
|
219
|
|
|
|
|
|
|
# context => '#pop' |
|
220
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
221
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
|
222
|
0
|
|
|
|
|
|
return 1 |
|
223
|
|
|
|
|
|
|
} |
|
224
|
0
|
|
|
|
|
|
return 0; |
|
225
|
|
|
|
|
|
|
}; |
|
226
|
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
sub parseComment3 { |
|
228
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
229
|
0
|
|
|
|
|
|
return 0; |
|
230
|
|
|
|
|
|
|
}; |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
sub parseNormal { |
|
233
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
234
|
|
|
|
|
|
|
# String => 'keywords' |
|
235
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
236
|
|
|
|
|
|
|
# context => '#stay' |
|
237
|
|
|
|
|
|
|
# type => 'keyword' |
|
238
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
|
239
|
0
|
|
|
|
|
|
return 1 |
|
240
|
|
|
|
|
|
|
} |
|
241
|
|
|
|
|
|
|
# String => 'directives' |
|
242
|
|
|
|
|
|
|
# attribute => 'Directive' |
|
243
|
|
|
|
|
|
|
# context => '#stay' |
|
244
|
|
|
|
|
|
|
# type => 'keyword' |
|
245
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'directives', 0, undef, 0, '#stay', 'Directive')) { |
|
246
|
0
|
|
|
|
|
|
return 1 |
|
247
|
|
|
|
|
|
|
} |
|
248
|
|
|
|
|
|
|
# String => 'types' |
|
249
|
|
|
|
|
|
|
# attribute => 'Type' |
|
250
|
|
|
|
|
|
|
# context => '#stay' |
|
251
|
|
|
|
|
|
|
# type => 'keyword' |
|
252
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) { |
|
253
|
0
|
|
|
|
|
|
return 1 |
|
254
|
|
|
|
|
|
|
} |
|
255
|
|
|
|
|
|
|
# attribute => 'Number' |
|
256
|
|
|
|
|
|
|
# context => '#stay' |
|
257
|
|
|
|
|
|
|
# type => 'Float' |
|
258
|
0
|
0
|
|
|
|
|
if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) { |
|
259
|
0
|
|
|
|
|
|
return 1 |
|
260
|
|
|
|
|
|
|
} |
|
261
|
|
|
|
|
|
|
# attribute => 'Number' |
|
262
|
|
|
|
|
|
|
# context => '#stay' |
|
263
|
|
|
|
|
|
|
# type => 'Int' |
|
264
|
0
|
0
|
|
|
|
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) { |
|
265
|
0
|
|
|
|
|
|
return 1 |
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
# attribute => 'String' |
|
268
|
|
|
|
|
|
|
# char => '"' |
|
269
|
|
|
|
|
|
|
# context => 'String1' |
|
270
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
271
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String1', '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
|
|
|
|
|
|
|
# String => '(*$' |
|
282
|
|
|
|
|
|
|
# attribute => 'Directive' |
|
283
|
|
|
|
|
|
|
# context => 'Prep1' |
|
284
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
285
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '(*$', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) { |
|
286
|
0
|
|
|
|
|
|
return 1 |
|
287
|
|
|
|
|
|
|
} |
|
288
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
289
|
|
|
|
|
|
|
# char => '(' |
|
290
|
|
|
|
|
|
|
# char1 => '*' |
|
291
|
|
|
|
|
|
|
# context => 'Comment2' |
|
292
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
293
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'Comment')) { |
|
294
|
0
|
|
|
|
|
|
return 1 |
|
295
|
|
|
|
|
|
|
} |
|
296
|
0
|
|
|
|
|
|
return 0; |
|
297
|
|
|
|
|
|
|
}; |
|
298
|
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
sub parsePrep1 { |
|
300
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
301
|
|
|
|
|
|
|
# String => '$*)' |
|
302
|
|
|
|
|
|
|
# attribute => 'Directive' |
|
303
|
|
|
|
|
|
|
# context => 'Prep1' |
|
304
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
305
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '$*)', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) { |
|
306
|
0
|
|
|
|
|
|
return 1 |
|
307
|
|
|
|
|
|
|
} |
|
308
|
0
|
|
|
|
|
|
return 0; |
|
309
|
|
|
|
|
|
|
}; |
|
310
|
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
sub parseString1 { |
|
312
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
313
|
|
|
|
|
|
|
# attribute => 'String' |
|
314
|
|
|
|
|
|
|
# char => '"' |
|
315
|
|
|
|
|
|
|
# context => '#pop' |
|
316
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
317
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
|
318
|
0
|
|
|
|
|
|
return 1 |
|
319
|
|
|
|
|
|
|
} |
|
320
|
0
|
|
|
|
|
|
return 0; |
|
321
|
|
|
|
|
|
|
}; |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
sub parseString2 { |
|
324
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
325
|
|
|
|
|
|
|
# attribute => 'String' |
|
326
|
|
|
|
|
|
|
# char => ''' |
|
327
|
|
|
|
|
|
|
# context => '#pop' |
|
328
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
329
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { |
|
330
|
0
|
|
|
|
|
|
return 1 |
|
331
|
|
|
|
|
|
|
} |
|
332
|
0
|
|
|
|
|
|
return 0; |
|
333
|
|
|
|
|
|
|
}; |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
1; |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
__END__ |