"Fossies" - the Fresh Open Source Software Archive

Member "gretl/gtksourceview/octave.lang" (20 Jun 2018, 8296 Bytes) of package /windows/misc/gretl-2020e-win32.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <?xml version="1.0" encoding="UTF-8"?>
    2 <!--
    3 
    4  Authors: Søren Hauberg, Muthiah Annamalai
    5  Copyright (C) 2006 Søren Hauberg <soren@hauberg.org>
    6  Copyright (C) 2006 Muthiah Annamalai <gnumuthu@users.sf.net>
    7 
    8  This library is free software; you can redistribute it and/or
    9  modify it under the terms of the GNU Library General Public
   10  License as published by the Free Software Foundation; either
   11  version 2 of the License, or (at your option) any later version.
   12 
   13  This library is distributed in the hope that it will be useful,
   14  but WITHOUT ANY WARRANTY; without even the implied warranty of
   15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16  Library General Public License for more details.
   17 
   18  You should have received a copy of the GNU Library General Public
   19  License along with this library; if not, write to the
   20  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   21  Boston, MA 02111-1307, USA.
   22 
   23 -->
   24 <language id="octave" _name="Octave" version="2.0" _section="Scientific">
   25   <metadata>
   26     <property name="mimetypes">text/x-octave;text/x-matlab</property>
   27     <property name="globs">*.m</property>
   28     <property name="line-comment-start">%</property>
   29   </metadata>
   30 
   31   <styles>
   32     <style id="comment" _name="Comment" map-to="def:comment"/>
   33     <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/>
   34     <style id="string" _name="String" map-to="def:string"/>
   35     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
   36     <style id="base-n-integer" _name="Base-N Integer" map-to="def:base-n-integer"/>
   37     <style id="function" _name="Function" map-to="def:function"/>
   38     <style id="decimal" _name="Decimal" map-to="def:decimal"/>
   39     <style id="boolean" _name="Boolean" map-to="def:boolean"/>
   40     <style id="reserved-constant" _name="Reserved Constant" map-to="def:special-constant"/>
   41   </styles>
   42 
   43   <definitions>
   44 
   45     <!--
   46       this is not yet supported by octave, but it's supported
   47       by matlab - http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f0-41244.html#f0-45380
   48     -->
   49     <context id="multiline-comment" style-ref="comment" class="comment" class-disabled="no-spell-check">
   50       <start>^\s*%{\s*$</start>
   51       <end>^\s*%}\s*$</end>
   52       <include>
   53         <context ref="def:in-comment"/>
   54       </include>
   55     </context>
   56 
   57     <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
   58       <start>#|%</start>
   59       <include>
   60         <context ref="def:in-comment"/>
   61       </include>
   62     </context>
   63 
   64     <context id="double-quoted-string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
   65       <start>"</start>
   66       <end>"</end>
   67       <include>
   68         <context ref="def:escape"/>
   69         <context ref="def:line-continue"/>
   70       </include>
   71     </context>
   72 
   73     <context id="single-quoted-string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
   74       <!--
   75        To do not misdetect the transpose operator ' as the start of a string
   76        we assert to not follow a variable name (letters, digits and underscores)
   77        or a closing bracket (round, square or curly) or a dot (to form the
   78        array transpose operator ".'" ). -->
   79       <start>(?&lt;![0-9a-zA-Z_)\]}\.])'</start>
   80       <end>'</end>
   81       <include>
   82         <context style-ref="def:special-char">
   83           <match>''</match>
   84         </context>
   85         <context ref="def:line-continue"/>
   86       </include>
   87     </context>
   88 
   89     <context id="boolean" style-ref="boolean">
   90       <keyword>false</keyword>
   91       <keyword>true</keyword>
   92     </context>
   93 
   94     <context id="reserved-constant" style-ref="reserved-constant">
   95       <keyword>pi</keyword>
   96       <keyword>eps</keyword>
   97       <keyword>Inf</keyword>
   98       <keyword>inf</keyword>
   99       <keyword>NaN</keyword>
  100       <keyword>nan</keyword>
  101       <keyword>NA</keyword>
  102     </context>
  103 
  104     <context id="keyword" style-ref="keyword">
  105       <keyword>assert</keyword>
  106       <keyword>break</keyword>
  107       <keyword>case</keyword>
  108       <keyword>catch</keyword>
  109       <keyword>continue</keyword>
  110       <keyword>do</keyword>
  111       <keyword>elseif</keyword>
  112       <keyword>else</keyword>
  113       <keyword>endfor</keyword>
  114       <keyword>endfunction</keyword>
  115       <keyword>endif</keyword>
  116       <keyword>end</keyword>
  117       <keyword>endswitch</keyword>
  118       <keyword>end_try_catch</keyword>
  119       <keyword>end_unwind_protect</keyword>
  120       <keyword>endwhile</keyword>
  121       <keyword>for</keyword>
  122       <keyword>function</keyword>
  123       <keyword>global</keyword>
  124       <keyword>if</keyword>
  125       <keyword>nargin</keyword>
  126       <keyword>nargout</keyword>
  127       <keyword>otherwise</keyword>
  128       <keyword>return</keyword>
  129       <keyword>switch</keyword>
  130       <keyword>try</keyword>
  131       <keyword>until</keyword>
  132       <keyword>unwind_protect_cleanup</keyword>
  133       <keyword>unwind_protect</keyword>
  134       <keyword>while</keyword>
  135     </context>
  136 
  137     <context id="decimal" style-ref="decimal">
  138       <match>\b([1-9][0-9]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
  139     </context>
  140 
  141     <context id="floating-point-number" style-ref="floating-point">
  142       <match>\b([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFlL]?</match>
  143     </context>
  144 
  145     <context id="octal-number" style-ref="base-n-integer">
  146       <match>\b0[0-7]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
  147     </context>
  148 
  149     <context id="hex-number" style-ref="base-n-integer">
  150       <match>\b0[xX][0-9a-fA-F]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
  151     </context>
  152 
  153     <context id="function" style-ref="function">
  154       <keyword>abs</keyword>
  155       <keyword>acos</keyword>
  156       <keyword>asin</keyword>
  157       <keyword>atan2</keyword>
  158       <keyword>atan</keyword>
  159       <keyword>ceil</keyword>
  160       <keyword>columns</keyword>
  161       <keyword>conv</keyword>
  162       <keyword>cosh</keyword>
  163       <keyword>cos</keyword>
  164       <keyword>cumprod</keyword>
  165       <keyword>dims</keyword>
  166       <keyword>error</keyword>
  167       <keyword>fclose</keyword>
  168       <keyword>floor</keyword>
  169       <keyword>fopen</keyword>
  170       <keyword>fprintf</keyword>
  171       <keyword>fread</keyword>
  172       <keyword>fsolve</keyword>
  173       <keyword>imag</keyword>
  174       <keyword>isempty</keyword>
  175       <keyword>isinf</keyword>
  176       <keyword>islogical</keyword>
  177       <keyword>ismatrix</keyword>
  178       <keyword>isnan</keyword>
  179       <keyword>isna</keyword>
  180       <keyword>isnumeric</keyword>
  181       <keyword>isscalar</keyword>
  182       <keyword>isstr</keyword>
  183       <keyword>isvector</keyword>
  184       <keyword>length</keyword>
  185       <keyword>linspace</keyword>
  186       <keyword>log10</keyword>
  187       <keyword>log2</keyword>
  188       <keyword>log</keyword>
  189       <keyword>max</keyword>
  190       <keyword>min</keyword>
  191       <keyword>ones</keyword>
  192       <keyword>printf</keyword>
  193       <keyword>prod</keyword>
  194       <keyword>real</keyword>
  195       <keyword>rem</keyword>
  196       <keyword>repmat</keyword>
  197       <keyword>reshape</keyword>
  198       <keyword>round</keyword>
  199       <keyword>rows</keyword>
  200       <keyword>setstr</keyword>
  201       <keyword>sinh</keyword>
  202       <keyword>sin</keyword>
  203       <keyword>size</keyword>
  204       <keyword>sort</keyword>
  205       <keyword>sprintf</keyword>
  206       <keyword>sqrt</keyword>
  207       <keyword>strcat</keyword>
  208       <keyword>strcmp</keyword>
  209       <keyword>sum</keyword>
  210       <keyword>system</keyword>
  211       <keyword>tanh</keyword>
  212       <keyword>tan</keyword>
  213       <keyword>unlink</keyword>
  214       <keyword>usage</keyword>
  215       <keyword>varargin</keyword>
  216       <keyword>varargout</keyword>
  217       <keyword>warning</keyword>
  218       <keyword>zeros</keyword>
  219     </context>
  220 
  221     <context id="octave" class="no-spell-check">
  222       <include>
  223         <context ref="multiline-comment"/>
  224         <context ref="line-comment"/>
  225         <context ref="double-quoted-string"/>
  226         <context ref="single-quoted-string"/>
  227         <context ref="boolean"/>
  228         <context ref="reserved-constant"/>
  229         <context ref="keyword"/>
  230         <context ref="decimal"/>
  231         <context ref="floating-point-number"/>
  232         <context ref="octal-number"/>
  233         <context ref="hex-number"/>
  234         <context ref="function"/>
  235       </include>
  236     </context>
  237   </definitions>
  238 </language>