Skip to content

Commit

Permalink
Improved kate syntax highlighting
Browse files Browse the repository at this point in the history
Should ultimately not rely on hardcoded math symbols
  • Loading branch information
marvinborner committed Nov 2, 2023
1 parent b89634f commit 027fc0f
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions editors/kate/bruijn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,53 @@
<highlighting>
<contexts>
<context attribute="Text" lineEndContext="#pop" name="text" >
<RegExpr attribute="Command" String="^:" context="command" beginRegion="Command" />
<RegExpr attribute="Command" String="^:" context="command" />
<Detect2Chars attribute="Comment" char="#" char1=" " context="comment" beginRegion="Comment"/>
<RegExpr attribute="Definition" String="^[^ [(:#]+ " context="#pop" />
<RegExpr attribute="Definition" String="^ *[^ [(:#]+ " />
<Detect2Chars attribute="Number" char="(" char1="+" context="number" beginRegion="Number"/>
<Detect2Chars attribute="Number" char="(" char1="-" context="number" beginRegion="Number"/>
<RegExpr attribute="Index" String="[0-9]" />
<RegExpr attribute="Namespace" String="[α-ωΑ-ΩA-Z]+[α-ωΑ-Ωa-zA-Z]*" context="#stay"/>
<RegExpr attribute="Identifier" String="(…|[α-ωΑ-Ωa-z])+[^ \])]*" context="#stay"/>
<AnyChar attribute="Mixfix" String="!?*@.,:;+-_#$%^&amp;&lt;&gt;/\\|{}~=" context="#stay" />
<Detect2Chars attribute="Type" char="" char1=" " context="type" />
<RegExpr attribute="Namespace" String="[α-ωΑ-ΩA-Z]+[α-ωΑ-Ωa-zA-Z]*" />
<AnyChar attribute="Mixfix" String="!?*@.,:;+-_#$%^&amp;&lt;&gt;/\\|{}~=⋀⋁∘→∏∑⋅≠≥≤" />
<RegExpr attribute="Identifier" String="[^ \[\(\]\)0-9'&quot;]+[^ \[\(\]\)]*" />
<DetectChar attribute="String" context="string" char="&quot;" />
<DetectChar attribute="Char" context="char" char="&apos;" />
<DetectChar attribute="Abstraction" context="#stay" char="[" />
<DetectChar attribute="Abstraction" context="#stay" char="]" />
<DetectChar attribute="Application" context="#stay" char="(" />
<DetectChar attribute="Application" context="#stay" char=")" />
<RegExpr attribute="Char" String="'[^']'" />
<DetectChar attribute="Abs" context="#stay" char="[" beginRegion="abs" />
<DetectChar attribute="Abs" context="#pop" char="]" endRegion="abs" />
<DetectChar attribute="App" context="#stay" char="(" beginRegion="app" />
<DetectChar attribute="App" context="#pop" char=")" endRegion="app" />
<DetectSpaces />
</context>
<context attribute="String" lineEndContext="#stay" name="string" >
<context attribute="String" lineEndContext="#pop" name="string" >
<DetectChar attribute="String" context="#pop" char="&quot;" />
</context>
<context attribute="Char" lineEndContext="#stay" name="char" >
<DetectChar attribute="Char" context="#pop" char="&apos;" />
</context>
<context attribute="Number" lineEndContext="#stay" name="number" >
<context attribute="Number" lineEndContext="#pop" name="number" >
<DetectChar attribute="Number" context="#pop" char=")" />
</context>
<context attribute="Comment" lineEndContext="#pop" name="comment">
</context>
<context attribute="Type" lineEndContext="#pop" name="type"/>
<context attribute="Command" lineEndContext="#pop" name="command">
<DetectChar attribute="App" context="#pop" char="(" />
<DetectChar attribute="Abs" context="#pop" char="[" />
</context>
</contexts>
<itemDatas>
<itemData name="Abstraction" defStyleNum="dsControlFlow" />
<itemData name="Application" defStyleNum="dsKeyword" />
<itemData name="Abs" defStyleNum="dsControlFlow" />
<itemData name="App" defStyleNum="dsKeyword" />
<itemData name="Char" defStyleNum="dsChar" />
<itemData name="Command" defStyleNum="dsPreprocessor" />
<itemData name="Comment" defStyleNum="dsComment" />
<itemData name="Definition" defStyleNum="dsVariable" />
<itemData name="Identifier" defStyleNum="dsFunction" />
<itemData name="Index" defStyleNum="dsSpecialChar" />
<itemData name="Mixfix" defStyleNum="dsOperator" />
<itemData name="Mixfix" defStyleNum="dsAttribute" />
<itemData name="Namespace" defStyleNum="dsExtension" />
<itemData name="Number" defStyleNum="dsBaseN" />
<itemData name="String" defStyleNum="dsString" />
<itemData name="Text" defStyleNum="dsNormal" />
<itemData name="Type" defStyleNum="dsDocumentation" />
</itemDatas>
</highlighting>
</language>

0 comments on commit 027fc0f

Please sign in to comment.