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.
5 # This file was generated from the 'r.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author E.L. Willighagen
11 #generated: Sun Feb 3 22:02:06 2008, localtime
13 package Syntax::Highlight::Engine::Kate::R_Script;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
26 'Comment' => 'Comment',
27 'Control Structure' => 'Normal',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
31 'Operators' => 'Operator',
32 'Reserved Words' => 'Reserved',
35 $self->listAdd('controls',
47 $self->listAdd('words',
57 callback => \&parsectx0,
58 attribute => 'Normal Text',
61 callback => \&parsectx1,
62 attribute => 'String',
65 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
66 $self->basecontext('ctx0');
67 $self->keywordscase(0);
69 bless ($self, $class);
78 my ($self, $text) = @_;
79 # String => 'controls'
80 # attribute => 'Control Structure'
83 if ($self->testKeyword($text, 'controls', 0, undef, 0, '#stay', 'Control Structure')) {
87 # attribute => 'Reserved Words'
90 if ($self->testKeyword($text, 'words', 0, undef, 0, '#stay', 'Reserved Words')) {
93 # attribute => 'String'
96 # type => 'DetectChar'
97 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'ctx1', 'String')) {
100 # String => '[a-zA-Z_]+ *\('
101 # attribute => 'Keyword'
104 if ($self->testRegExpr($text, '[a-zA-Z_]+ *\\(', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
107 # attribute => 'Keyword'
110 # type => 'DetectChar'
111 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
114 # attribute => 'Keyword'
117 # type => 'DetectChar'
118 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
122 # attribute => 'Comment'
125 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
128 # String => '+-*/^:$~!&|=><@'
129 # attribute => 'Operators'
132 if ($self->testAnyChar($text, '+-*/^:$~!&|=><@', 0, 0, undef, 0, '#stay', 'Operators')) {
135 # String => '%[a-zA-Z_]*%'
136 # attribute => 'Operators'
139 if ($self->testRegExpr($text, '%[a-zA-Z_]*%', 0, 0, 0, undef, 0, '#stay', 'Operators')) {
146 my ($self, $text) = @_;
147 # attribute => 'String'
150 # type => 'DetectChar'
151 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
164 Syntax::Highlight::Engine::Kate::R_Script - a Plugin for R Script syntax highlighting
168 require Syntax::Highlight::Engine::Kate::R_Script;
169 my $sh = new Syntax::Highlight::Engine::Kate::R_Script([
174 Syntax::Highlight::Engine::Kate::R_Script is a plugin module that provides syntax highlighting
175 for R Script to the Syntax::Haghlight::Engine::Kate highlighting engine.
177 This code is generated from the syntax definition files used
179 It works quite fine, but can use refinement and optimization.
181 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
187 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
193 Unknown. If you find any, please contact the author