| 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 | 1 | our $VERSION = '0.16'; | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 18 | 1 | ▶ | use base('Syntax::Highlight::Engine::Kate::Template'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 21 | 2 | my $proto = shift; | |||||||||||||||||||
| 22 | 2 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 23 | 2 | my $self = $class->SUPER::new(@_); | |||||||||||||||||||
| 24 | 2 | $self->attributes({ | |||||||||||||||||||
| 25 | 'Comment' => 'Comment', | ||||||||||||||||||||
| 26 | 'Descr' => 'String', | ||||||||||||||||||||
| 27 | 'EXTINF' => 'Others', | ||||||||||||||||||||
| 28 | 'Lenght' => 'DecVal', | ||||||||||||||||||||
| 29 | 'M3USpec' => 'Keyword', | ||||||||||||||||||||
| 30 | 'Normal Text' => 'Normal', | ||||||||||||||||||||
| 31 | }); | ||||||||||||||||||||
| 32 | 2 | $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 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); | |||||||||||||||||||
| 43 | 2 | $self->basecontext('M3U'); | |||||||||||||||||||
| 44 | 2 | $self->keywordscase(1); | |||||||||||||||||||
| 45 | 2 | $self->initialize; | |||||||||||||||||||
| 46 | 2 | bless ($self, $class); | |||||||||||||||||||
| 47 | 2 | return $self; | |||||||||||||||||||
| 48 | } | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 0 | ▶ | sub language { | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 51 | 0 | return 'M3U'; | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 0 | ▶ | sub parseFindEXTINF { | ||||||||||||||||||
|
Subroutine
parseFindEXTINF: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 55 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 56 | # String => ':\d+' | ||||||||||||||||||||
| 57 | # attribute => 'Lenght' | ||||||||||||||||||||
| 58 | # type => 'RegExpr' | ||||||||||||||||||||
| 59 | 0 | ▶ | if ($self->testRegExpr($text, ':\\d+', 0, 0, 0, undef, 0, '#stay', 'Lenght')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 60 | 0 | return 1 | |||||||||||||||||||
| 61 | } | ||||||||||||||||||||
| 62 | # String => ',.*$' | ||||||||||||||||||||
| 63 | # attribute => 'Descr' | ||||||||||||||||||||
| 64 | # context => '#pop' | ||||||||||||||||||||
| 65 | # type => 'RegExpr' | ||||||||||||||||||||
| 66 | 0 | ▶ | if ($self->testRegExpr($text, ',.*$', 0, 0, 0, undef, 0, '#pop', 'Descr')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 67 | 0 | return 1 | |||||||||||||||||||
| 68 | } | ||||||||||||||||||||
| 69 | 0 | return 0; | |||||||||||||||||||
| 70 | }; | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 2 | ▶ | sub parseM3U { | ||||||||||||||||||
|
Subroutine
parseM3U: called CC=4 SCAR=22.9
Pod
undocumented
| |||||||||||||||||||||
| 73 | 2 | my ($self, $text) = @_; | |||||||||||||||||||
| 74 | # String => '#EXTM3U' | ||||||||||||||||||||
| 75 | # attribute => 'M3USpec' | ||||||||||||||||||||
| 76 | # column => '0' | ||||||||||||||||||||
| 77 | # context => '#pop' | ||||||||||||||||||||
| 78 | # type => 'StringDetect' | ||||||||||||||||||||
| 79 | 2 | ▶ | if ($self->testStringDetect($text, '#EXTM3U', 0, 0, 0, 0, 0, '#pop', 'M3USpec')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 80 | 2 | return 1 | |||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | # String => '#EXTINF' | ||||||||||||||||||||
| 83 | # attribute => 'EXTINF' | ||||||||||||||||||||
| 84 | # column => '0' | ||||||||||||||||||||
| 85 | # context => 'FindEXTINF' | ||||||||||||||||||||
| 86 | # type => 'StringDetect' | ||||||||||||||||||||
| 87 | 0 | ▶ | if ($self->testStringDetect($text, '#EXTINF', 0, 0, 0, 0, 0, 'FindEXTINF', 'EXTINF')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 88 | 0 | return 1 | |||||||||||||||||||
| 89 | } | ||||||||||||||||||||
| 90 | # String => '#.*$' | ||||||||||||||||||||
| 91 | # attribute => 'Comment' | ||||||||||||||||||||
| 92 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 93 | # type => 'RegExpr' | ||||||||||||||||||||
| 94 | 0 | ▶ | if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 95 | 0 | return 1 | |||||||||||||||||||
| 96 | } | ||||||||||||||||||||
| 97 | 0 | return 0; | |||||||||||||||||||
| 98 | }; | ||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | |||||||||||||||||||||
| 101 | 1 | 1; | |||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | __END__ | ||||||||||||||||||||