home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / R.lang < prev    next >
Encoding:
Extensible Markup Language  |  2010-08-16  |  4.1 KB  |  129 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Vaidotas Zemlys <mpiktas@gmail.com>
  5.  Copyright (C) 2005 Vaidotas Zemlys <mpiktas@gmail.com>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="r" _name="R" version="2.0" _section="Scientific">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-R</property>
  26.     <property name="globs">*.R;*.Rout;*.r;*.Rhistory;*.Rt;*.Rout.save;*.Rout.fail</property>
  27.     <property name="line-comment-start">#</property>
  28.   </metadata>
  29.  
  30.   <styles>
  31.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  32.     <style id="reserved-classes" _name="Reserved Class" map-to="def:type"/>
  33.     <style id="assignment-operator" _name="Assignment Operator" map-to="def:operator"/>
  34.     <style id="delimiter" _name="Delimiter" map-to="def:operator"/>
  35.     <style id="special-constant" _name="Special Constant" map-to="def:special-constant"/>
  36.     <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
  37.     <style id="integer-number" _name="Integer Number" map-to="def:base-n-integer"/>
  38.     <style id="floating-point" _name="Floating point number" map-to="def:floating-point"/>
  39.   </styles>
  40.  
  41.   <definitions>
  42.  
  43.     <context id="keywords" style-ref="keyword">
  44.       <keyword>break</keyword>
  45.       <keyword>else</keyword>
  46.       <keyword>for</keyword>
  47.       <keyword>if</keyword>
  48.       <keyword>in</keyword>
  49.       <keyword>next</keyword>
  50.       <keyword>repeat</keyword>
  51.       <keyword>return</keyword>
  52.       <keyword>switch</keyword>
  53.       <keyword>try</keyword>
  54.       <keyword>while</keyword>
  55.     </context>
  56.  
  57.     <context id="reserved-classes" style-ref="reserved-classes">
  58.       <keyword>array</keyword>
  59.       <keyword>character</keyword>
  60.       <keyword>complex</keyword>
  61.       <keyword>data.frame</keyword>
  62.       <keyword>double</keyword>
  63.       <keyword>factor</keyword>
  64.       <keyword>function</keyword>
  65.       <keyword>integer</keyword>
  66.       <keyword>list</keyword>
  67.       <keyword>logical</keyword>
  68.       <keyword>matrix</keyword>
  69.       <keyword>numeric</keyword>
  70.       <keyword>vector</keyword>
  71.     </context>
  72.  
  73.     <context id="assignment-operator" style-ref="assignment-operator">
  74.       <match>(<){1,2}-</match>
  75.     </context>
  76.  
  77.     <context id="delimiters" style-ref="delimiter">
  78.       <match>[\)\(]+|[\{\}]+|[][]+</match>
  79.     </context>
  80.  
  81.     <context id="special-constants" style-ref="special-constant">
  82.       <keyword>Inf</keyword>
  83.       <keyword>NA</keyword>
  84.       <keyword>NaN</keyword>
  85.       <keyword>NULL</keyword>
  86.     </context>
  87.  
  88.     <context id="boolean" style-ref="boolean">
  89.       <keyword>FALSE</keyword>
  90.       <keyword>TRUE</keyword>
  91.     </context>
  92.  
  93.     <context id="integer-number" style-ref="integer-number">
  94.       <match extended="true">
  95.         (?<![\w\.])
  96.         ([1-9][0-9]*|0)[i]?
  97.         (?![\w\.])
  98.       </match>
  99.     </context>
  100.  
  101.     <context id="floating-point" style-ref="floating-point">
  102.       <match extended="true">
  103.         (?<![\w\.])
  104.         ([0-9]+[Ee][-+]?[0-9]+|
  105.          ([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-+]?[0-9]+)?)
  106.         [i]?
  107.         (?![\w\.])
  108.       </match>
  109.     </context>
  110.  
  111.     <context id="r">
  112.       <include>
  113.         <context ref="def:shell-like-comment"/>
  114.         <context ref="def:string"/>
  115.         <context ref="def:single-quoted-string"/>
  116.         <context ref="keywords"/>
  117.         <context ref="assignment-operator"/>
  118.         <context ref="delimiters"/>
  119.         <context ref="special-constants"/>
  120.         <context ref="boolean"/>
  121.         <context ref="integer-number"/>
  122.         <context ref="floating-point"/>
  123.       </include>
  124.     </context>
  125.  
  126.   </definitions>
  127.  
  128. </language>
  129.