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 'tibasic.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.01 |
9
|
|
|
|
|
|
|
#kate version 2.3 |
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:06 2008, localtime |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::TI_Basic; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
637
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
17
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
18
|
1
|
|
|
1
|
|
4
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
444
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
0
|
663
|
my $proto = shift; |
22
|
1
|
|
33
|
|
|
7
|
my $class = ref($proto) || $proto; |
23
|
1
|
|
|
|
|
9
|
my $self = $class->SUPER::new(@_); |
24
|
1
|
|
|
|
|
9
|
$self->attributes({ |
25
|
|
|
|
|
|
|
'Assignment' => 'Others', |
26
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
27
|
|
|
|
|
|
|
'Matrix' => 'Normal', |
28
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
29
|
|
|
|
|
|
|
'Special operators' => 'Normal', |
30
|
|
|
|
|
|
|
'String' => 'String', |
31
|
|
|
|
|
|
|
}); |
32
|
1
|
|
|
|
|
7
|
$self->listAdd('keywords', |
33
|
|
|
|
|
|
|
'ClrHome', |
34
|
|
|
|
|
|
|
'ClrTable', |
35
|
|
|
|
|
|
|
'DS<', |
36
|
|
|
|
|
|
|
'DelVar', |
37
|
|
|
|
|
|
|
'Disp', |
38
|
|
|
|
|
|
|
'DispGraph', |
39
|
|
|
|
|
|
|
'DispTable', |
40
|
|
|
|
|
|
|
'Else', |
41
|
|
|
|
|
|
|
'End', |
42
|
|
|
|
|
|
|
'For', |
43
|
|
|
|
|
|
|
'Get', |
44
|
|
|
|
|
|
|
'GetCalc', |
45
|
|
|
|
|
|
|
'Goto', |
46
|
|
|
|
|
|
|
'GraphStyle', |
47
|
|
|
|
|
|
|
'IS>', |
48
|
|
|
|
|
|
|
'If', |
49
|
|
|
|
|
|
|
'Input', |
50
|
|
|
|
|
|
|
'Lbl', |
51
|
|
|
|
|
|
|
'Menu', |
52
|
|
|
|
|
|
|
'Output', |
53
|
|
|
|
|
|
|
'Pause', |
54
|
|
|
|
|
|
|
'Prompt', |
55
|
|
|
|
|
|
|
'Repeat', |
56
|
|
|
|
|
|
|
'Return', |
57
|
|
|
|
|
|
|
'Send', |
58
|
|
|
|
|
|
|
'Then', |
59
|
|
|
|
|
|
|
'While', |
60
|
|
|
|
|
|
|
'getKey', |
61
|
|
|
|
|
|
|
'prgm', |
62
|
|
|
|
|
|
|
'prgm', |
63
|
|
|
|
|
|
|
); |
64
|
1
|
|
|
|
|
4
|
$self->listAdd('special_sym', |
65
|
|
|
|
|
|
|
'%THETA', |
66
|
|
|
|
|
|
|
'eogt', |
67
|
|
|
|
|
|
|
'eolt', |
68
|
|
|
|
|
|
|
'net', |
69
|
|
|
|
|
|
|
'sqrt', |
70
|
|
|
|
|
|
|
); |
71
|
1
|
|
|
|
|
10
|
$self->contextdata({ |
72
|
|
|
|
|
|
|
'Normal' => { |
73
|
|
|
|
|
|
|
callback => \&parseNormal, |
74
|
|
|
|
|
|
|
attribute => 'Normal Text', |
75
|
|
|
|
|
|
|
}, |
76
|
|
|
|
|
|
|
'String' => { |
77
|
|
|
|
|
|
|
callback => \&parseString, |
78
|
|
|
|
|
|
|
attribute => 'String', |
79
|
|
|
|
|
|
|
}, |
80
|
|
|
|
|
|
|
}); |
81
|
1
|
|
|
|
|
6
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|=|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\%|<|>'); |
82
|
1
|
|
|
|
|
4
|
$self->basecontext('Normal'); |
83
|
1
|
|
|
|
|
6
|
$self->keywordscase(0); |
84
|
1
|
|
|
|
|
3
|
$self->initialize; |
85
|
1
|
|
|
|
|
2
|
bless ($self, $class); |
86
|
1
|
|
|
|
|
4
|
return $self; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub language { |
90
|
0
|
|
|
0
|
0
|
|
return 'TI Basic'; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub parseNormal { |
94
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
95
|
|
|
|
|
|
|
# String => 'keywords' |
96
|
|
|
|
|
|
|
# attribute => 'Keyword' |
97
|
|
|
|
|
|
|
# context => '#stay' |
98
|
|
|
|
|
|
|
# type => 'keyword' |
99
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
100
|
0
|
|
|
|
|
|
return 1 |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
# String => 'special_sym' |
103
|
|
|
|
|
|
|
# attribute => 'Special operators' |
104
|
|
|
|
|
|
|
# context => '#stay' |
105
|
|
|
|
|
|
|
# type => 'keyword' |
106
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'special_sym', 0, undef, 0, '#stay', 'Special operators')) { |
107
|
0
|
|
|
|
|
|
return 1 |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
# attribute => 'Assignment' |
110
|
|
|
|
|
|
|
# char => '-' |
111
|
|
|
|
|
|
|
# char1 => '>' |
112
|
|
|
|
|
|
|
# context => '#stay' |
113
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
114
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Assignment')) { |
115
|
0
|
|
|
|
|
|
return 1 |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
# attribute => 'Assignment' |
118
|
|
|
|
|
|
|
# char => 's' |
119
|
|
|
|
|
|
|
# char1 => 't' |
120
|
|
|
|
|
|
|
# context => '#stay' |
121
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
122
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, 's', 't', 0, 0, 0, undef, 0, '#stay', 'Assignment')) { |
123
|
0
|
|
|
|
|
|
return 1 |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
# String => '\[\w\]' |
126
|
|
|
|
|
|
|
# attribute => 'Matrix' |
127
|
|
|
|
|
|
|
# context => '#stay' |
128
|
|
|
|
|
|
|
# type => 'RegExpr' |
129
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\[\\w\\]', 0, 0, 0, undef, 0, '#stay', 'Matrix')) { |
130
|
0
|
|
|
|
|
|
return 1 |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
# attribute => 'String' |
133
|
|
|
|
|
|
|
# char => '"' |
134
|
|
|
|
|
|
|
# context => 'String' |
135
|
|
|
|
|
|
|
# type => 'DetectChar' |
136
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
137
|
0
|
|
|
|
|
|
return 1 |
138
|
|
|
|
|
|
|
} |
139
|
0
|
|
|
|
|
|
return 0; |
140
|
|
|
|
|
|
|
}; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub parseString { |
143
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
144
|
|
|
|
|
|
|
# attribute => 'String' |
145
|
|
|
|
|
|
|
# char => '"' |
146
|
|
|
|
|
|
|
# context => '#pop' |
147
|
|
|
|
|
|
|
# type => 'DetectChar' |
148
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
149
|
0
|
|
|
|
|
|
return 1 |
150
|
|
|
|
|
|
|
} |
151
|
0
|
|
|
|
|
|
return 0; |
152
|
|
|
|
|
|
|
}; |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
1; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
__END__ |