| 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 'sgml.xml' file of the syntax highlight |
|
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.02 |
|
9
|
|
|
|
|
|
|
#kate version 2.1 |
|
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:06 2008, localtime |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::SGML; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
589
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
30
|
|
|
17
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
36
|
|
|
18
|
1
|
|
|
1
|
|
5
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
542
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
|
21
|
1
|
|
|
1
|
0
|
659
|
my $proto = shift; |
|
22
|
1
|
|
33
|
|
|
7
|
my $class = ref($proto) || $proto; |
|
23
|
1
|
|
|
|
|
11
|
my $self = $class->SUPER::new(@_); |
|
24
|
1
|
|
|
|
|
9
|
$self->attributes({ |
|
25
|
|
|
|
|
|
|
'Attribute Name' => 'Others', |
|
26
|
|
|
|
|
|
|
'Attribute Value' => 'DataType', |
|
27
|
|
|
|
|
|
|
'Comment' => 'Comment', |
|
28
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
|
29
|
|
|
|
|
|
|
'Tag' => 'Keyword', |
|
30
|
|
|
|
|
|
|
}); |
|
31
|
1
|
|
|
|
|
13
|
$self->contextdata({ |
|
32
|
|
|
|
|
|
|
'Attribute' => { |
|
33
|
|
|
|
|
|
|
callback => \&parseAttribute, |
|
34
|
|
|
|
|
|
|
attribute => 'Attribute Name', |
|
35
|
|
|
|
|
|
|
}, |
|
36
|
|
|
|
|
|
|
'Comment' => { |
|
37
|
|
|
|
|
|
|
callback => \&parseComment, |
|
38
|
|
|
|
|
|
|
attribute => 'Comment', |
|
39
|
|
|
|
|
|
|
}, |
|
40
|
|
|
|
|
|
|
'Normal Text' => { |
|
41
|
|
|
|
|
|
|
callback => \&parseNormalText, |
|
42
|
|
|
|
|
|
|
attribute => 'Normal Text', |
|
43
|
|
|
|
|
|
|
}, |
|
44
|
|
|
|
|
|
|
'Value' => { |
|
45
|
|
|
|
|
|
|
callback => \&parseValue, |
|
46
|
|
|
|
|
|
|
attribute => 'Attribute Value', |
|
47
|
|
|
|
|
|
|
}, |
|
48
|
|
|
|
|
|
|
'Value 2' => { |
|
49
|
|
|
|
|
|
|
callback => \&parseValue2, |
|
50
|
|
|
|
|
|
|
attribute => 'Attribute Value', |
|
51
|
|
|
|
|
|
|
}, |
|
52
|
|
|
|
|
|
|
}); |
|
53
|
1
|
|
|
|
|
5
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
|
54
|
1
|
|
|
|
|
4
|
$self->basecontext('Normal Text'); |
|
55
|
1
|
|
|
|
|
5
|
$self->keywordscase(0); |
|
56
|
1
|
|
|
|
|
4
|
$self->initialize; |
|
57
|
1
|
|
|
|
|
2
|
bless ($self, $class); |
|
58
|
1
|
|
|
|
|
3
|
return $self; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub language { |
|
62
|
0
|
|
|
0
|
0
|
|
return 'SGML'; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub parseAttribute { |
|
66
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
67
|
|
|
|
|
|
|
# attribute => 'Tag' |
|
68
|
|
|
|
|
|
|
# char => '/' |
|
69
|
|
|
|
|
|
|
# char1 => '>' |
|
70
|
|
|
|
|
|
|
# context => '#pop' |
|
71
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
|
72
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) { |
|
73
|
0
|
|
|
|
|
|
return 1 |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
# attribute => 'Tag' |
|
76
|
|
|
|
|
|
|
# char => '>' |
|
77
|
|
|
|
|
|
|
# context => '#pop' |
|
78
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
79
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) { |
|
80
|
0
|
|
|
|
|
|
return 1 |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
# String => '\s*=\s*' |
|
83
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
|
84
|
|
|
|
|
|
|
# context => 'Value' |
|
85
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
86
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) { |
|
87
|
0
|
|
|
|
|
|
return 1 |
|
88
|
|
|
|
|
|
|
} |
|
89
|
0
|
|
|
|
|
|
return 0; |
|
90
|
|
|
|
|
|
|
}; |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub parseComment { |
|
93
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
94
|
|
|
|
|
|
|
# String => '-->' |
|
95
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
96
|
|
|
|
|
|
|
# context => '#pop' |
|
97
|
|
|
|
|
|
|
# type => 'StringDetect' |
|
98
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
|
99
|
0
|
|
|
|
|
|
return 1 |
|
100
|
|
|
|
|
|
|
} |
|
101
|
0
|
|
|
|
|
|
return 0; |
|
102
|
|
|
|
|
|
|
}; |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub parseNormalText { |
|
105
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
106
|
|
|
|
|
|
|
# String => ' |