| 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 'm3u.xml' file of the syntax highlight |
|
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.10 |
|
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::M3U; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
1008
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
47
|
|
|
17
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
36
|
|
|
18
|
1
|
|
|
1
|
|
7
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
434
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
|
21
|
2
|
|
|
2
|
0
|
720
|
my $proto = shift; |
|
22
|
2
|
|
33
|
|
|
15
|
my $class = ref($proto) || $proto; |
|
23
|
2
|
|
|
|
|
18
|
my $self = $class->SUPER::new(@_); |
|
24
|
2
|
|
|
|
|
23
|
$self->attributes({ |
|
25
|
|
|
|
|
|
|
'Comment' => 'Comment', |
|
26
|
|
|
|
|
|
|
'Descr' => 'String', |
|
27
|
|
|
|
|
|
|
'EXTINF' => 'Others', |
|
28
|
|
|
|
|
|
|
'Lenght' => 'DecVal', |
|
29
|
|
|
|
|
|
|
'M3USpec' => 'Keyword', |
|
30
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
|
31
|
|
|
|
|
|
|
}); |
|
32
|
2
|
|
|
|
|
23
|
$self->contextdata({ |
|
33
|
|
|
|
|
|
|
'FindEXTINF' => { |
|
34
|
|
|
|
|
|
|
callback => \&parseFindEXTINF, |
|
35
|
|
|
|
|
|
|
attribute => 'Normal Text', |
|
36
|
|
|
|
|
|
|
}, |
|
37
|
|
|
|
|
|
|
'M3U' => { |
|
38
|
|
|
|
|
|
|
callback => \&parseM3U, |
|
39
|
|
|
|
|
|
|
attribute => 'Normal Text', |
|
40
|
|
|
|
|
|
|
}, |
|
41
|
|
|
|
|
|
|
}); |
|
42
|
2
|
|
|
|
|
15
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
|
43
|
2
|
|
|
|
|
9
|
$self->basecontext('M3U'); |
|
44
|
2
|
|
|
|
|
15
|
$self->keywordscase(1); |
|
45
|
2
|
|
|
|
|
10
|
$self->initialize; |
|
46
|
2
|
|
|
|
|
6
|
bless ($self, $class); |
|
47
|
2
|
|
|
|
|
12
|
return $self; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub language { |
|
51
|
0
|
|
|
0
|
0
|
0
|
return 'M3U'; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub parseFindEXTINF { |
|
55
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
|
56
|
|
|
|
|
|
|
# String => ':\d+' |
|
57
|
|
|
|
|
|
|
# attribute => 'Lenght' |
|
58
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
59
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, ':\\d+', 0, 0, 0, undef, 0, '#stay', 'Lenght')) { |
|
60
|
0
|
|
|
|
|
0
|
return 1 |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
# String => ',.*$' |
|
63
|
|
|
|
|
|
|
# attribute => 'Descr' |
|
64
|
|
|
|
|
|
|
# context => '#pop' |
|
65
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
66
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, ',.*$', 0, 0, 0, undef, 0, '#pop', 'Descr')) { |
|
67
|
0
|
|
|
|
|
0
|
return 1 |
|
68
|
|
|
|
|
|
|
} |
|
69
|
0
|
|
|
|
|
0
|
return 0; |
|
70
|
|
|
|
|
|
|
}; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub parseM3U { |
|
73
|
2
|
|
|
2
|
0
|
4
|
my ($self, $text) = @_; |
|
74
|
|
|
|
|
|
|
# String => '#EXTM3U' |
|
75
|
|
|
|
|
|
|
# attribute => 'M3USpec' |
|
76
|
|
|
|
|
|
|
# column => '0' |
|
77
|
|
|
|
|
|
|
# context => '#pop' |
|
78
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
79
|
2
|
50
|
|
|
|
19
|
if ($self->testStringDetect($text, '#EXTM3U', 0, 0, 0, 0, 0, '#pop', 'M3USpec')) { |
|
80
|
2
|
|
|
|
|
6
|
return 1 |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
# String => '#EXTINF' |
|
83
|
|
|
|
|
|
|
# attribute => 'EXTINF' |
|
84
|
|
|
|
|
|
|
# column => '0' |
|
85
|
|
|
|
|
|
|
# context => 'FindEXTINF' |
|
86
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
87
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '#EXTINF', 0, 0, 0, 0, 0, 'FindEXTINF', 'EXTINF')) { |
|
88
|
0
|
|
|
|
|
|
return 1 |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
# String => '#.*$' |
|
91
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
92
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
|
93
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
94
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) { |
|
95
|
0
|
|
|
|
|
|
return 1 |
|
96
|
|
|
|
|
|
|
} |
|
97
|
0
|
|
|
|
|
|
return 0; |
|
98
|
|
|
|
|
|
|
}; |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
1; |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
__END__ |