medit/moo/mooedit/language-specs/octave.lang

191 lines
6.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<language id="octave" _name="Octave" version="2.0" _section="Scripts">
<metadata>
<property name="mimetypes">text/x-octave;text/x-matlab</property>
<property name="globs">*.m</property>
<property name="line-comment-start">#</property>
</metadata>
<styles>
<style id="comment" _name="Comment" map-to="def:comment"/>
<style id="floating-point" _name="Floating Point" map-to="def:floating-point"/>
<style id="string" _name="String" map-to="def:string"/>
<style id="keyword" _name="Keyword" map-to="def:keyword"/>
<style id="base-n-integer" _name="Base-N Integer" map-to="def:base-n-integer"/>
<style id="function" _name="Function" map-to="def:function"/>
<style id="decimal" _name="Decimal" map-to="def:decimal"/>
<style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
</styles>
<definitions>
<context id="line-comment" style-ref="comment" end-at-line-end="true">
<start>#|%</start>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="multiline-double-quoted-string" style-ref="string">
<start>[uUrR]?"""</start>
<end>"""</end>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="multiline-single-quoted-string" style-ref="string">
<start>[uUrR]?'''</start>
<end>'''</end>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="double-quoted-string" style-ref="string" end-at-line-end="true">
<start>[uUrR]?"</start>
<end>"</end>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="single-quoted-string" style-ref="string" end-at-line-end="true">
<start>[uUrR]?'</start>
<end>'</end>
<include>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
</include>
</context>
<context id="reserved-constant" style-ref="preprocessor">
<keyword>false</keyword>
<keyword>true</keyword>
<keyword>Inf</keyword>
<keyword>inf</keyword>
<keyword>NaN</keyword>
<keyword>NA</keyword>
</context>
<context id="keyword" style-ref="keyword">
<keyword>function</keyword>
<keyword>endfunction</keyword>
<keyword>switch</keyword>
<keyword>case</keyword>
<keyword>endswitch</keyword>
<keyword>otherwise</keyword>
<keyword>unwind_protect</keyword>
<keyword>unwind_protect_cleanup</keyword>
<keyword>end_unwind_protect</keyword>
<keyword>try</keyword>
<keyword>catch</keyword>
<keyword>end_try_catch</keyword>
<keyword>end</keyword>
<keyword>if</keyword>
<keyword>else</keyword>
<keyword>elseif</keyword>
<keyword>endif</keyword>
<keyword>break</keyword>
<keyword>continue</keyword>
<keyword>for</keyword>
<keyword>endfor</keyword>
<keyword>return</keyword>
<keyword>do</keyword>
<keyword>until</keyword>
<keyword>while</keyword>
<keyword>endwhile</keyword>
<keyword>global</keyword>
<keyword>nargin</keyword>
<keyword>nargout</keyword>
<keyword>assert</keyword>
</context>
<context id="decimal" style-ref="decimal">
<match>\b([1-9][0-9]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
</context>
<context id="floating-point-number" style-ref="floating-point">
<match>\b([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFlL]?</match>
</context>
<context id="octal-number" style-ref="base-n-integer">
<match>\b0[0-7]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
</context>
<context id="hex-number" style-ref="base-n-integer">
<match>\b0[xX][0-9a-fA-F]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
</context>
<context id="function" style-ref="function">
<keyword>size</keyword>
<keyword>zeros</keyword>
<keyword>ones</keyword>
<keyword>min</keyword>
<keyword>max</keyword>
<keyword>varargs</keyword>
<keyword>sqrt</keyword>
<keyword>atan2</keyword>
<keyword>asin</keyword>
<keyword>acos</keyword>
<keyword>log10</keyword>
<keyword>log</keyword>
<keyword>real</keyword>
<keyword>error</keyword>
<keyword>isscalar</keyword>
<keyword>isstr</keyword>
<keyword>strcmp</keyword>
<keyword>log2</keyword>
<keyword>Inf</keyword>
<keyword>isvector</keyword>
<keyword>strcat</keyword>
<keyword>fsolve</keyword>
<keyword>islogical</keyword>
<keyword>isempty</keyword>
<keyword>isnumeric</keyword>
<keyword>prod</keyword>
<keyword>round</keyword>
<keyword>dims</keyword>
<keyword>cumprod</keyword>
<keyword>ismatrix</keyword>
<keyword>floor</keyword>
<keyword>sort</keyword>
<keyword>ceil</keyword>
<keyword>linspace</keyword>
<keyword>isnan</keyword>
<keyword>isinf</keyword>
<keyword>nan_inf</keyword>
<keyword>repmat</keyword>
<keyword>colums</keyword>
<keyword>rows</keyword>
<keyword>sum</keyword>
<keyword>rem</keyword>
<keyword>reshape</keyword>
<keyword>conv</keyword>
<keyword>length</keyword>
<keyword>usage</keyword>
<keyword>log2</keyword>
<keyword>abs</keyword>
<keyword>setstr</keyword>
<keyword>printf</keyword>
<keyword>sprintf</keyword>
<keyword>fprintf</keyword>
<keyword>fread</keyword>
<keyword>fopen</keyword>
<keyword>fclose</keyword>
<keyword>system</keyword>
<keyword>unlink</keyword>
<keyword>error</keyword>
<keyword>warning</keyword>
</context>
<context id="octave">
<include>
<context ref="line-comment"/>
<context ref="multiline-double-quoted-string"/>
<context ref="multiline-single-quoted-string"/>
<context ref="double-quoted-string"/>
<context ref="single-quoted-string"/>
<context ref="reserved-constant"/>
<context ref="keyword"/>
<context ref="decimal"/>
<context ref="floating-point-number"/>
<context ref="octal-number"/>
<context ref="hex-number"/>
<context ref="function"/>
</include>
</context>
</definitions>
</language>