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.14'; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
508
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
17
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
18
|
1
|
|
|
1
|
|
4
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
386
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
2
|
|
|
2
|
0
|
562
|
my $proto = shift; |
22
|
2
|
|
33
|
|
|
10
|
my $class = ref($proto) || $proto; |
23
|
2
|
|
|
|
|
9
|
my $self = $class->SUPER::new(@_); |
24
|
2
|
|
|
|
|
13
|
$self->attributes({ |
25
|
|
|
|
|
|
|
'Comment' => 'Comment', |
26
|
|
|
|
|
|
|
'Descr' => 'String', |
27
|
|
|
|
|
|
|
'EXTINF' => 'Others', |
28
|
|
|
|
|
|
|
'Lenght' => 'DecVal', |
29
|
|
|
|
|
|
|
'M3USpec' => 'Keyword', |
30
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
31
|
|
|
|
|
|
|
}); |
32
|
2
|
|
|
|
|
12
|
$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
|
|
|
|
|
8
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
43
|
2
|
|
|
|
|
9
|
$self->basecontext('M3U'); |
44
|
2
|
|
|
|
|
6
|
$self->keywordscase(1); |
45
|
2
|
|
|
|
|
6
|
$self->initialize; |
46
|
2
|
|
|
|
|
4
|
bless ($self, $class); |
47
|
2
|
|
|
|
|
9
|
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
|
5
|
my ($self, $text) = @_; |
74
|
|
|
|
|
|
|
# String => '#EXTM3U' |
75
|
|
|
|
|
|
|
# attribute => 'M3USpec' |
76
|
|
|
|
|
|
|
# column => '0' |
77
|
|
|
|
|
|
|
# context => '#pop' |
78
|
|
|
|
|
|
|
# type => 'StringDetect' |
79
|
2
|
50
|
|
|
|
8
|
if ($self->testStringDetect($text, '#EXTM3U', 0, 0, 0, 0, 0, '#pop', 'M3USpec')) { |
80
|
2
|
|
|
|
|
5
|
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__ |