Synced with upstream
parent
c7c8553bf1
commit
2053cc1481
|
@ -15,13 +15,6 @@
|
|||
</styles>
|
||||
|
||||
<definitions>
|
||||
<!-- <context id="stuff">
|
||||
<match>\b(DeclareGlobalVariable|DeclareGlobalFunction)\s*\((\"[\w_]+\")</match>
|
||||
<include>
|
||||
<context sub-pattern="2" style-ref="keyword"/>
|
||||
</include>
|
||||
</context>-->
|
||||
|
||||
<context id="character" style-ref="character">
|
||||
<match>\'(\\[trn\\]|[^\\])\'</match>
|
||||
</context>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language id="octave" _name="Octave" version="2.0" _section="Scripts">
|
||||
<language id="octave" _name="Octave" version="2.0" _section="Scientific">
|
||||
<metadata>
|
||||
<property name="mimetypes">text/x-octave;text/x-matlab</property>
|
||||
<property name="globs">*.m</property>
|
||||
|
|
|
@ -16,31 +16,40 @@
|
|||
</styles>
|
||||
|
||||
<definitions>
|
||||
|
||||
<context id="string" style-ref="string">
|
||||
<start>[uUrR]?'</start>
|
||||
<end>'</end>
|
||||
</context>
|
||||
<context id="number" style-ref="decimal">
|
||||
<match>\b(([0-9]+)|([0-9]+\.[0-9]+([Ee][-]?[0-9]+)?))\b</match>
|
||||
</context>
|
||||
<context id="hex-number" style-ref="decimal">
|
||||
<match>\b\$[0-9a-fA-F]*\b</match>
|
||||
</context>
|
||||
|
||||
<context id="line-comment" style-ref="comment" end-at-line-end="true">
|
||||
<start>\/\/</start>
|
||||
<include>
|
||||
<context ref="def:in-comment"/>
|
||||
</include>
|
||||
</context>
|
||||
|
||||
<context id="block-comment-1" style-ref="comment">
|
||||
<start>\(\*</start>
|
||||
<end>\*\)</end>
|
||||
<include>
|
||||
<context ref="def:in-comment"/>
|
||||
</include>
|
||||
</context>
|
||||
|
||||
<context id="block-comment-2" style-ref="comment">
|
||||
<start>\{[^\$]</start>
|
||||
<end>\}</end>
|
||||
<include>
|
||||
<context ref="def:in-comment"/>
|
||||
</include>
|
||||
</context>
|
||||
|
||||
<context id="preprocessor-defines" style-ref="preprocessor" end-at-line-end="true">
|
||||
<start>\{\$</start>
|
||||
<end>\}</end>
|
||||
</context>
|
||||
|
||||
<context id="general-format" style-ref="keyword">
|
||||
<keyword>Program</keyword>
|
||||
<keyword>Library</keyword>
|
||||
|
@ -55,12 +64,14 @@
|
|||
<keyword>Var</keyword>
|
||||
<keyword>Const</keyword>
|
||||
</context>
|
||||
|
||||
<context id="functions-and-function-modifiers" style-ref="keyword">
|
||||
<keyword>Function</keyword>
|
||||
<keyword>Procedure</keyword>
|
||||
<keyword>Overload</keyword>
|
||||
<keyword>cdecl</keyword>
|
||||
</context>
|
||||
|
||||
<context id="boolean-bitwise-operators" style-ref="keyword">
|
||||
<keyword>if</keyword>
|
||||
<keyword>then</keyword>
|
||||
|
@ -73,10 +84,12 @@
|
|||
<keyword>shr</keyword>
|
||||
<keyword>shl</keyword>
|
||||
</context>
|
||||
|
||||
<context id="math-operators" style-ref="keyword">
|
||||
<keyword>div</keyword>
|
||||
<keyword>mod</keyword>
|
||||
</context>
|
||||
|
||||
<context id="loop-flow-and-exceptions-keywords" style-ref="keyword">
|
||||
<keyword>while</keyword>
|
||||
<keyword>do</keyword>
|
||||
|
@ -93,6 +106,7 @@
|
|||
<keyword>finally</keyword>
|
||||
<keyword>raise</keyword>
|
||||
</context>
|
||||
|
||||
<context id="type-class-and-object-keywords" style-ref="keyword">
|
||||
<keyword>Type</keyword>
|
||||
<keyword>Packed</keyword>
|
||||
|
@ -118,6 +132,7 @@
|
|||
<keyword>self</keyword>
|
||||
<keyword>Inherited</keyword>
|
||||
</context>
|
||||
|
||||
<context id="builtin-types" style-ref="data-type">
|
||||
<keyword>Char</keyword>
|
||||
<keyword>String</keyword>
|
||||
|
@ -126,6 +141,7 @@
|
|||
<keyword>Boolean</keyword>
|
||||
<keyword>Pointer</keyword>
|
||||
</context>
|
||||
|
||||
<context id="builtin-functions" style-ref="keyword">
|
||||
<keyword>chr</keyword>
|
||||
<keyword>ord</keyword>
|
||||
|
@ -145,16 +161,32 @@
|
|||
<keyword>eof</keyword>
|
||||
<keyword>eoln</keyword>
|
||||
</context>
|
||||
|
||||
<context id="builtin-values" style-ref="keyword">
|
||||
<keyword>nil</keyword>
|
||||
<keyword>False</keyword>
|
||||
<keyword>True</keyword>
|
||||
</context>
|
||||
|
||||
<context id="number" style-ref="decimal">
|
||||
<match extended="true">
|
||||
(?<![\w\.])
|
||||
(([0-9]+)|([0-9]+\.[0-9]+([Ee][-]?[0-9]+)?))
|
||||
(?![\w\.])
|
||||
</match>
|
||||
</context>
|
||||
|
||||
<context id="hex-number" style-ref="decimal">
|
||||
<match extended="true">
|
||||
(?<![\w\.])
|
||||
\$[0-9a-fA-F]*
|
||||
(?![\w\.])
|
||||
</match>
|
||||
</context>
|
||||
|
||||
<context id="pascal">
|
||||
<include>
|
||||
<context ref="string"/>
|
||||
<context ref="number"/>
|
||||
<context ref="hex-number"/>
|
||||
<context ref="line-comment"/>
|
||||
<context ref="block-comment-1"/>
|
||||
<context ref="block-comment-2"/>
|
||||
|
@ -168,7 +200,10 @@
|
|||
<context ref="builtin-types"/>
|
||||
<context ref="builtin-functions"/>
|
||||
<context ref="builtin-values"/>
|
||||
<context ref="number"/>
|
||||
<context ref="hex-number"/>
|
||||
</include>
|
||||
</context>
|
||||
|
||||
</definitions>
|
||||
</language>
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
<keyword>\-ge\b</keyword>
|
||||
</context>
|
||||
<context id="variable1" style-ref="variable1">
|
||||
<match>\$+[@?*{a-zA-Z0-9_][}a-zA-Z0-9_]*</match>
|
||||
<match>\$+[@?*#\${a-zA-Z0-9_][}a-zA-Z0-9_]*</match>
|
||||
</context>
|
||||
<context id="variable2" style-ref="variable2">
|
||||
<match>[a-zA-Z_][a-zA-Z0-9_]*\=</match>
|
||||
|
|
Loading…
Reference in New Issue