Add Kate syntax highlighting
This commit is contained in:
parent
e0bc4a361d
commit
9456b4ca8d
1 changed files with 80 additions and 0 deletions
80
syntax-highlighting/kate/pslang.xml
Normal file
80
syntax-highlighting/kate/pslang.xml
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<language name="PSLang" version="1.0" kateversion="5.0"
|
||||||
|
section="Sources" extensions="*.psl"
|
||||||
|
mimetype="text/x-pslang"
|
||||||
|
license="MIT">
|
||||||
|
<highlighting>
|
||||||
|
<list name="keywords">
|
||||||
|
<item>func</item><item>foreign</item><item>struct</item>
|
||||||
|
<item>if</item><item>then</item><item>else</item><item>while</item>
|
||||||
|
<item>return</item><item>let</item><item>mut</item><item>const</item>
|
||||||
|
<item>as</item><item>break</item><item>continue</item>
|
||||||
|
</list>
|
||||||
|
<list name="types">
|
||||||
|
<item>unit</item><item>bool</item>
|
||||||
|
<item>u8</item><item>u16</item><item>u32</item><item>u64</item>
|
||||||
|
<item>i8</item><item>i16</item><item>i32</item><item>i64</item>
|
||||||
|
<item>f16</item><item>f32</item><item>f64</item>
|
||||||
|
</list>
|
||||||
|
|
||||||
|
<contexts>
|
||||||
|
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
|
||||||
|
<Detect2Chars attribute="Comment" context="CommentSingleLine" char="/" char1="/"/>
|
||||||
|
<Detect2Chars attribute="Comment" context="CommentMultiLine" char="/" char1="*"/>
|
||||||
|
<DetectChar char="{" beginRegion="Brace"/>
|
||||||
|
<DetectChar char="}" endRegion="Brace"/>
|
||||||
|
<keyword attribute="Keyword" context="#stay" String="keywords"/>
|
||||||
|
<keyword attribute="DataType" context="#stay" String="types"/>
|
||||||
|
<DetectChar char=":" attribute="Operator" context="TypeName"/>
|
||||||
|
<Detect2Chars char="-" char1=">" attribute="Operator" context="TypeName"/>
|
||||||
|
<WordDetect String="as" attribute="Keyword" context="TypeName"/>
|
||||||
|
<RegExpr attribute="Float" context="#stay" String="\b\d+\.\d+([eE][+-]?\d+)?[hd]?\b"/>
|
||||||
|
<RegExpr attribute="Decimal" context="#stay" String="\b\d+u?[bsl]?\b"/>
|
||||||
|
<RegExpr attribute="Char" context="#stay" String="'([^'\\]|\\.)'"/>
|
||||||
|
<DetectChar attribute="String" context="String" char='"'/>
|
||||||
|
<RegExpr attribute="Function" context="#stay"
|
||||||
|
String="\b[A-Za-z_][A-Za-z0-9_]*(?=\s*\()"/>
|
||||||
|
<RegExpr attribute="Identifier" context="#stay"
|
||||||
|
String="\b[A-Za-z_][A-Za-z0-9_]*\b"/>
|
||||||
|
<AnyChar attribute="Operator" context="#stay"
|
||||||
|
String="+-*/%=!<>|^~.,:;()[]"/>
|
||||||
|
<WordDetect String="struct" attribute="Keyword" context="TypeName"/>
|
||||||
|
</context>
|
||||||
|
|
||||||
|
<context name="String" attribute="String" lineEndContext="#stay">
|
||||||
|
<DetectChar attribute="String" context="#pop" char='"'/>
|
||||||
|
<HlCStringChar attribute="Char"/>
|
||||||
|
</context>
|
||||||
|
|
||||||
|
<context name="TypeName" attribute="Normal Text" lineEndContext="#stay">
|
||||||
|
<RegExpr String="[A-Za-z_][A-Za-z0-9_]*" attribute="DataType" context="#pop"/>
|
||||||
|
</context>
|
||||||
|
|
||||||
|
<context name="CommentSingleLine" attribute="Comment" lineEndContext="#pop"/>
|
||||||
|
<context name="CommentMultiLine" attribute="Comment" lineEndContext="#stay">
|
||||||
|
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
|
||||||
|
</context>
|
||||||
|
</contexts>
|
||||||
|
|
||||||
|
<itemDatas>
|
||||||
|
<itemData name="Normal Text" defStyleNum="dsNormal"/>
|
||||||
|
<itemData name="Keyword" defStyleNum="dsKeyword"/>
|
||||||
|
<itemData name="DataType" defStyleNum="dsDataType"/>
|
||||||
|
<itemData name="Function" defStyleNum="dsFunction"/>
|
||||||
|
<itemData name="Identifier" defStyleNum="dsNormal"/>
|
||||||
|
<itemData name="Operator" defStyleNum="dsOperator"/>
|
||||||
|
<itemData name="Decimal" defStyleNum="dsDecVal"/>
|
||||||
|
<itemData name="Float" defStyleNum="dsFloat"/>
|
||||||
|
<itemData name="String" defStyleNum="dsString"/>
|
||||||
|
<itemData name="Char" defStyleNum="dsChar"/>
|
||||||
|
<itemData name="Comment" defStyleNum="dsComment"/>
|
||||||
|
</itemDatas>
|
||||||
|
</highlighting>
|
||||||
|
|
||||||
|
<general>
|
||||||
|
<comments>
|
||||||
|
<comment name="singleLine" start="//"/>
|
||||||
|
<comment name="multiLine" start="/*" end="*/"/>
|
||||||
|
</comments>
|
||||||
|
</general>
|
||||||
|
</language>
|
||||||
Loading…
Add table
Reference in a new issue