Damson/assets/syntax/nix.xml
astar76 11c1a7808b Build the syntax definitions into the app
Highlighting relied on the syntax-highlighting package, so removing it
left every file uncoloured. The 462 definitions now live in assets/syntax
and are compressed into the binary at build time, unpacked per language
when used. User .xml files still add to or replace them, and the licence
each file declares is recorded in assets/syntax/LICENSES.md.

Also moves files to the trash without needing gio.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 20:35:27 -06:00

1 line
No EOL
9.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE language><language name="Nix" version="5" kateversion="5.79" section="Scripts" extensions="*.nix" author="Katalin Rebhan &lt;[email protected]>" license="MIT" priority="1"><highlighting><list name="keywords"><item>and</item><item>or</item><item>rec</item></list><list name="builtins"><item>abort</item><item>baseNameOf</item><item>builtins</item><item>derivation</item><item>dirOf</item><item>fetchTarball</item><item>import</item><item>isNull</item><item>map</item><item>removeAttrs</item><item>throw</item><item>toString</item></list><contexts><context name="Expression" attribute="Normal Text"><IncludeRules context="Single Expression"/><keyword String="keywords" attribute="Keyword"/><WordDetect String="let" attribute="Keyword" context="Let"/><WordDetect String="if" attribute="Keyword" context="If"/><WordDetect String="with" attribute="Keyword" context="With"/><WordDetect String="assert" attribute="Keyword" context="Assert"/><StringDetect String="//" attribute="Operator"/><StringDetect String="??" attribute="Operator"/><StringDetect String="++" attribute="Operator"/><StringDetect String="||" attribute="Operator"/><StringDetect String="&amp;&amp;" attribute="Operator"/><AnyChar String="+-*/?!" attribute="Operator"/><RegExpr String="\b[a-zA-Z_][a-zA-Z0-9_\-']*(?=\s*:)" attribute="Identifier" context="Function"/><DetectIdentifier/></context><context name="Set" attribute="Normal Text"><DetectSpaces/><DetectChar char="}" attribute="Symbol" context="#pop" endRegion="Set"/><WordDetect String="inherit" attribute="Keyword" context="Inherit"/><IncludeRules context="Set-Like"/></context><context name="Interpolated String" attribute="Normal Text"><DetectChar char="}" attribute="Special Char" context="#pop"/><IncludeRules context="Expression"/></context><context name="String" attribute="String"><RegExpr String="\\." attribute="Special Char"/><DetectChar char='"' attribute="String" context="#pop"/><StringDetect String="${" attribute="Special Char" context="Interpolated String"/></context><context name="Comment Rules" attribute="Normal Text"><DetectChar char="#" attribute="Comment" context="Comment"/><StringDetect String="/*" attribute="Comment" context="Multi-Line Comment" beginRegion="Comment"/></context><context name="Set Expansion" attribute="Normal Text"><DetectSpaces/><DetectChar char="}" attribute="Symbol" context="#pop" endRegion="Set"/><DetectChar char="," attribute="Symbol"/><DetectChar char="?" attribute="Symbol" context="Default Value"/><StringDetect String="..." attribute="Symbol"/><RegExpr String="[a-zA-Z_][a-zA-Z0-9_\-']*" attribute="Identifier"/><IncludeRules context="Comment Rules"/></context><context name="Comment" attribute="Comment" lineEndContext="#pop"><DetectSpaces attribute="Comment"/><IncludeRules context="##Comments"/><DetectIdentifier attribute="Comment"/></context><context name="Default Value" attribute="Normal Text"><DetectChar char="," attribute="Symbol" context="#pop"/><DetectChar char="}" attribute="Symbol" context="#pop#pop"/><IncludeRules context="Expression"/></context><context name="Inherit" attribute="Normal Text"><DetectChar char="(" attribute="Symbol" context="Inherit - Source"/><DetectIdentifier attribute="Identifier" context="Inherit - Keys"/></context><context name="Inherit - Keys" attribute="Normal Text"><DetectChar char=";" attribute="Symbol" context="#pop#pop"/><DetectChar char="(" attribute="Error"/><DetectIdentifier attribute="Identifier"/></context><context name="Parentheses" attribute="Normal Text"><DetectChar char=")" attribute="Symbol" context="#pop"/><IncludeRules context="Expression"/></context><context name="Set Value" attribute="Normal Text"><DetectChar char=";" attribute="Symbol" context="#pop"/><DetectChar char="}" attribute="Error" context="#pop#pop" endRegion="Set"/><IncludeRules context="Expression"/></context><context name="Set-Like" attribute="Normal Text"><DetectChar char='"' attribute="String" context="String"/><StringDetect String="''" attribute="String" context="String2"/><DetectChar char="=" attribute="Operator" context="Set Value"/><StringDetect String="${" attribute="Special Char" context="Interpolated String"/><RegExpr String="[a-zA-Z_][a-zA-Z0-9_\-']*" attribute="Identifier"/><IncludeRules context="Comment Rules"/></context><context name="Single Expression" attribute="Normal Text"><DetectSpaces/><IncludeRules context="Comment Rules"/><keyword String="builtins" attribute="Builtin"/><DetectChar char='"' attribute="String" context="String"/><StringDetect String="''" attribute="String" context="String2"/><DetectChar char="{" attribute="Symbol" context="Any Brace" beginRegion="Set"/><DetectChar char="[" attribute="Symbol" context="List" beginRegion="List"/><DetectChar char="(" attribute="Symbol" context="Parentheses"/><RegExpr String="[a-zA-Z0-9-_.]*(/[a-zA-Z0-9-_.]+)+" attribute="Path"/><Float attribute="Float"/><Int attribute="Int"/><DetectChar char="." attribute="Symbol" context="Set Access"/><WordDetect String="true" attribute="Constant"/><WordDetect String="false" attribute="Constant"/><WordDetect String="null" attribute="Constant"/></context><context name="String2" attribute="String"><RegExpr String="''(?:['$]|\\.)" attribute="Special Char"/><StringDetect String="''" attribute="String" context="#pop"/><StringDetect String="${" attribute="Special Char" context="Interpolated String"/></context><context name="Any Brace" attribute="Normal Text"><DetectSpaces/><DetectChar char="}" attribute="Symbol" context="#pop" endRegion="Set"/><WordDetect String="inherit" attribute="Keyword" context="Any Brace - Inherit"/><DetectChar char=";" attribute="Symbol" context="#pop!Set"/><DetectChar char="=" attribute="Operator" context="Any Brace - Set Value"/><DetectChar char='"' attribute="String" context="Any Brace - String"/><StringDetect String="''" attribute="String" context="Any Brace - String2"/><StringDetect String="${" attribute="Special Char" context="Any Brace - Interpolated String"/><DetectChar char="," attribute="Symbol" context="#pop!Set Expansion"/><DetectChar char="?" attribute="Symbol" context="Any Brace - Default Value"/><StringDetect String="..." attribute="Symbol" context="#pop!Set Expansion"/><RegExpr String="[a-zA-Z_][a-zA-Z0-9_\-']*" attribute="Identifier"/><IncludeRules context="Comment Rules"/></context><context name="Any Brace - Default Value" attribute="Normal Text"><DetectChar char="," attribute="Symbol" context="#pop#pop!Set Expansion"/><IncludeRules context="Default Value"/></context><context name="Any Brace - Inherit" attribute="Normal Text"><DetectChar char=";" attribute="Symbol" context="#pop#pop!Set"/><IncludeRules context="Inherit"/></context><context name="Any Brace - Interpolated String" attribute="Normal Text"><DetectChar char="}" attribute="Special Char" context="#pop!Set"/><IncludeRules context="Interpolated String"/></context><context name="Any Brace - Set Value" attribute="Normal Text"><DetectChar char=";" attribute="Symbol" context="#pop#pop!Set"/><IncludeRules context="Set Value"/></context><context name="Any Brace - String" attribute="String"><DetectChar char='"' attribute="String" context="#pop#pop!Set"/><IncludeRules context="String"/></context><context name="Any Brace - String2" attribute="String"><StringDetect String="''" attribute="String" context="#pop#pop!Set"/><IncludeRules context="String"/></context><context name="Assert" attribute="Normal Text"><DetectChar char=";" attribute="Symbol" context="#pop"/><IncludeRules context="Expression"/></context><context name="Function" attribute="Normal Text"><DetectChar char=":" attribute="Symbol" context="#pop"/><DetectSpaces attribute="Normal Text"/></context><context name="If" attribute="Normal Text"><WordDetect String="then" attribute="Keyword" context="#pop!Then"/><IncludeRules context="Expression"/></context><context name="Inherit - Source" attribute="Normal Text"><DetectChar char=")" attribute="Symbol" context="#pop!Inherit - Keys"/><IncludeRules context="Parentheses"/></context><context name="Let" attribute="Normal Text"><DetectSpaces/><WordDetect String="in" attribute="Keyword" context="#pop"/><IncludeRules context="Set-Like"/></context><context name="List" attribute="Normal Text"><DetectChar char="]" attribute="Symbol" context="#pop" endRegion="List"/><IncludeRules context="Single Expression"/></context><context name="Multi-Line Comment" attribute="Comment"><StringDetect String="*/" attribute="Comment" context="#pop" endRegion="Comment"/><IncludeRules context="Comment"/></context><context name="Set Access" attribute="Normal Text"><StringDetect String="${" attribute="Special Char" context="#pop!Interpolated String"/><DetectChar char='"' attribute="String" context="#pop!String"/><DetectIdentifier context="#pop"/></context><context name="Then" attribute="Normal Text"><WordDetect String="else" attribute="Keyword" context="#pop"/><IncludeRules context="Expression"/></context><context name="With" attribute="Normal Text"><DetectChar char=";" attribute="Symbol" context="#pop"/><IncludeRules context="Expression"/></context></contexts><itemDatas><itemData name="Normal Text" defStyleNum="dsNormal"/><itemData name="Builtin" defStyleNum="dsBuiltIn"/><itemData name="Int" defStyleNum="dsDecVal"/><itemData name="Float" defStyleNum="dsFloat"/><itemData name="Constant" defStyleNum="dsConstant"/><itemData name="String" defStyleNum="dsString"/><itemData name="Special Char" defStyleNum="dsSpecialChar"/><itemData name="Path" defStyleNum="dsSpecialString"/><itemData name="Keyword" defStyleNum="dsKeyword"/><itemData name="Comment" defStyleNum="dsComment"/><itemData name="Symbol" defStyleNum="dsOperator"/><itemData name="Operator" defStyleNum="dsOperator"/><itemData name="Identifier" defStyleNum="dsVariable"/><itemData name="Error" defStyleNum="dsError"/></itemDatas></highlighting><general><comments><comment name="singleLine" start="#"/><comment name="multiLine" start="/*" end="*/" region="Comment"/></comments><keywords casesensitive="1"/></general></language>