Damson/assets/syntax/typst.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
14 KiB
XML

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE language><language name="Typst" version="1" kateversion="5.79" section="Markup" extensions="*.typ" author="Katalin Rebhan &lt;[email protected]>" license="MIT" priority="1"><highlighting><list name="bool"><item>false</item><item>true</item></list><contexts><context name="Markup" attribute="Normal Text"><IncludeRules context="Comment Rules"/><RegExpr String="(?&lt;=\W|^)\*" attribute="Strong" context="Strong"/><RegExpr String="(?&lt;=\W|^)_" attribute="Emphasis" context="Emphasis"/><RegExpr String="```(`*)" attribute="Raw Text" context="Big Raw Text"/><DetectChar char="`" attribute="Raw Text" context="Raw Text"/><RegExpr String="^\s*=+.*" attribute="Heading" column="0"/><RegExpr String="^\s*[-+]" attribute="List" column="0"/><RegExpr String="\\(u\{[0-9A-Za-z]+\}|.?)" attribute="Special Char"/><RegExpr String="https?://[0-9A-Za-z-._~:/?#\[\]@!\$&amp;'\(\)\*\+,;%=]+" attribute="URL Literal"/><DetectChar char="$" attribute="Math" context="Math" beginRegion="Math"/><DetectChar char="#" attribute="Code Keyword" context="Code"/><RegExpr String="&lt;[a-zA-Z_][a-zA-Z0-9_\-]*>" attribute="Label"/><RegExpr String="@[a-zA-Z_][a-zA-Z0-9_\-]*" attribute="Label Reference"/><DetectChar char="[" context="Markup Inner []"/></context><context name="Continued Expression" attribute="Code" fallthroughContext="#pop" lineEndContext="#pop"><DetectChar char="(" attribute="Operator" context="#pop!Function Call"/><DetectChar char="[" attribute="Operator" context="#pop!Markup Block Call" beginRegion="Markup Block"/><DetectChar char="." attribute="Operator" context="Value Access"/></context><context name="Line Error" attribute="Error" lineEndContext="#pop"/><context name="Nested Code" attribute="Code"><DetectSpaces/><IncludeRules context="Comment Rules"/><WordDetect String="none" attribute="Builtin" context="Continued Expression"/><WordDetect String="auto" attribute="Builtin" context="Continued Expression"/><keyword String="bool" attribute="Builtin" context="Continued Expression"/><RegExpr String="(\.?[0-9]+|[0-9]+\.[0-9]*)(fr|em|pt|mm|cm|in|%)" attribute="Float" context="Continued Expression"/><Float attribute="Float" context="Continued Expression"/><Int attribute="Int" context="Continued Expression"/><DetectChar char='"' attribute="String" context="String"/><RegExpr String="```(`*)" attribute="Raw Text" context="Big Raw Text"/><DetectChar char="`" attribute="Raw Text" context="Raw Text"/><DetectChar char="$" attribute="Math" context="Math" beginRegion="Math"/><RegExpr String="&lt;[a-zA-Z_][a-zA-Z0-9_\-]*>" attribute="Label" context="Continued Expression"/><DetectChar char="(" attribute="Operator" context="Parentheses" beginRegion="Parentheses"/><DetectChar char="[" attribute="Operator" context="Markup Block" beginRegion="Markup Block"/><DetectChar char="{" attribute="Operator" context="Code Block" beginRegion="Code Block"/><StringDetect String="!=" attribute="Operator"/><StringDetect String=">=" attribute="Operator"/><StringDetect String="&lt;=" attribute="Operator"/><StringDetect String="+=" attribute="Operator"/><StringDetect String="-=" attribute="Operator"/><StringDetect String="==" attribute="Operator"/><AnyChar String="!>&lt;+-=" attribute="Operator"/><WordDetect String="in" attribute="Operator"/><WordDetect String="import" attribute="Import" context="Import"/><WordDetect String="show" attribute="Code Keyword" context="Show"/><WordDetect String="set" attribute="Code Keyword" context="Set"/><WordDetect String="let" attribute="Code Keyword" context="Let"/><WordDetect String="if" attribute="Control Flow" context="If"/><WordDetect String="else" attribute="Control Flow"/><WordDetect String="while" attribute="Control Flow" context="While"/><WordDetect String="for" attribute="Control Flow" context="For"/><WordDetect String="break" attribute="Control Flow"/><WordDetect String="continue" attribute="Control Flow"/><WordDetect String="return" attribute="Control Flow"/><RegExpr String="(?&lt;![a-zA-Z_])[a-zA-Z_][a-zA-Z0-9_\-]*(?![a-zA-Z0-9_\-])" context="Continued Expression"/></context><context name="Markup Block" attribute="Normal Text"><DetectChar char="]" attribute="Operator" context="#pop" endRegion="Markup Block"/><IncludeRules context="Markup"/></context><context name="Code" attribute="Code" fallthroughContext="#pop!Line Error" lineEndContext="#pop!Line Error"><DetectSpaces/><IncludeRules context="Comment Rules"/><WordDetect String="none" attribute="Builtin" context="#pop!Continued Expression"/><WordDetect String="auto" attribute="Builtin" context="#pop!Continued Expression"/><keyword String="bool" attribute="Builtin" context="#pop!Continued Expression"/><RegExpr String="(\.?[0-9]+|[0-9]+\.[0-9]*)(fr|em|pt|mm|cm|in|%)" attribute="Float" context="#pop!Continued Expression"/><Float attribute="Float" context="#pop!Continued Expression"/><Int attribute="Int" context="#pop!Continued Expression"/><DetectChar char='"' attribute="String" context="#pop!String"/><RegExpr String="```(`*)" attribute="Raw Text" context="#pop!Big Raw Text"/><DetectChar char="`" attribute="Raw Text" context="#pop!Raw Text"/><DetectChar char="$" attribute="Math" context="#pop!Math" beginRegion="Math"/><RegExpr String="&lt;[a-zA-Z_][a-zA-Z0-9_\-]*>" attribute="Label" context="Continued Expression"/><DetectChar char="(" attribute="Operator" context="#pop!Parentheses" beginRegion="Parentheses"/><DetectChar char="[" attribute="Operator" context="#pop!Markup Block" beginRegion="Markup Block"/><DetectChar char="{" attribute="Operator" context="#pop!Code Block" beginRegion="Code Block"/><StringDetect String="!=" attribute="Operator"/><StringDetect String=">=" attribute="Operator"/><StringDetect String="&lt;=" attribute="Operator"/><StringDetect String="+=" attribute="Operator"/><StringDetect String="-=" attribute="Operator"/><StringDetect String="==" attribute="Operator"/><AnyChar String="!>&lt;+-=" attribute="Operator"/><WordDetect String="in" attribute="Operator"/><WordDetect String="import" attribute="Import" context="#pop!Import"/><WordDetect String="show" attribute="Code Keyword" context="#pop!Show"/><WordDetect String="set" attribute="Code Keyword" context="#pop!Set"/><WordDetect String="let" attribute="Code Keyword" context="#pop!Let"/><WordDetect String="if" attribute="Control Flow" context="#pop!If"/><WordDetect String="else" attribute="Control Flow"/><WordDetect String="while" attribute="Control Flow" context="#pop!While"/><WordDetect String="for" attribute="Control Flow" context="#pop!For"/><WordDetect String="break" attribute="Control Flow"/><WordDetect String="continue" attribute="Control Flow"/><WordDetect String="return" attribute="Control Flow"/><RegExpr String="(?&lt;![a-zA-Z_])[a-zA-Z_][a-zA-Z0-9_\-]*(?![a-zA-Z0-9_\-])" context="#pop!Continued Expression"/></context><context name="Code Block" attribute="Code"><DetectChar char="}" attribute="Operator" context="#pop" endRegion="Code Block"/><IncludeRules context="Nested Code"/></context><context name="Big Raw Text" attribute="Raw Text"><StringDetect String="```%1" attribute="Raw Text" context="#pop" dynamic="1"/></context><context name="Comment Rules" attribute="Normal Text"><StringDetect String="//" attribute="Comment" context="Comment"/><StringDetect String="/*" attribute="Comment" context="Multi-Line Comment" beginRegion="Comment"/></context><context name="Function Call" attribute="Code"><DetectChar char=":" attribute="Operator" context="Function Call - Parameter"/><IncludeRules context="Parentheses"/></context><context name="Math" attribute="Math"><DetectChar char="$" attribute="Math" context="#pop" endRegion="Math"/><DetectChar char="#" attribute="Code Keyword" context="Code"/></context><context name="Parentheses" attribute="Code"><DetectChar char=")" attribute="Operator" context="#pop!Continued Expression" endRegion="Parentheses"/><DetectChar char="," attribute="Operator"/><IncludeRules context="Nested Code"/></context><context name="Raw Text" attribute="Raw Text"><DetectChar char="`" attribute="Raw Text" context="#pop"/></context><context name="Comment" attribute="Comment" lineEndContext="#pop"><DetectSpaces attribute="Comment"/><IncludeRules context="##Comments"/><DetectIdentifier attribute="Comment"/></context><context name="For" attribute="Code"><DetectChar char="{" attribute="Operator" context="#pop!Code Block" beginRegion="Code Block"/><DetectChar char="[" attribute="Operator" context="#pop!Markup Block" beginRegion="Markup Block"/><WordDetect String="in" attribute="Control Flow"/><IncludeRules context="Nested Code"/></context><context name="If" attribute="Code"><DetectChar char="{" attribute="Operator" context="#pop!Code Block" beginRegion="Code Block"/><DetectChar char="[" attribute="Operator" context="#pop!Markup Block" beginRegion="Markup Block"/><IncludeRules context="Nested Code"/></context><context name="Import" attribute="Code" fallthroughContext="#pop" lineEndContext="#pop"><DetectChar char=":" attribute="Operator" context="#pop!Import 1"/><IncludeRules context="Nested Code"/></context><context name="Import 1" attribute="Code" fallthroughContext="#pop!Line Error"><DetectSpaces/><DetectChar char="*" attribute="Operator" context="#pop"/><RegExpr String="(?&lt;![a-zA-Z_])[a-zA-Z_][a-zA-Z0-9_\-]*(?![a-zA-Z0-9_\-])" context="#pop!Import 2"/></context><context name="Let" attribute="Code" fallthroughContext="#pop!Line Error"><DetectSpaces/><RegExpr String="(?&lt;![a-zA-Z_])[a-zA-Z_][a-zA-Z0-9_\-]*(?![a-zA-Z0-9_\-])" attribute="Element" context="#pop!Let 1"/></context><context name="Let 3" attribute="Code"><DetectSpaces/><DetectChar char="=" attribute="Operator" context="#pop!Code"/></context><context name="Set" attribute="Code" fallthroughContext="#pop!Line Error" lineEndContext="#pop!Line Error"><DetectSpaces/><RegExpr String="(?&lt;![a-zA-Z_])[a-zA-Z_][a-zA-Z0-9_\-]*(?![a-zA-Z0-9_\-])" attribute="Element" context="#pop!Set 1"/></context><context name="Show" attribute="Code"><DetectSpaces/><DetectChar char=":" attribute="Operator" context="#pop!Code"/><IncludeRules context="Nested Code"/></context><context name="String" attribute="String"><RegExpr String="\\." attribute="Special Char"/><DetectChar char='"' attribute="String" context="#pop!Continued Expression"/></context><context name="While" attribute="Code"><DetectChar char="{" attribute="Operator" context="#pop!Code Block" beginRegion="Code Block"/><DetectChar char="[" attribute="Operator" context="#pop!Markup Block" beginRegion="Markup Block"/><IncludeRules context="Nested Code"/></context><context name="Emphasis" attribute="Emphasis"><RegExpr String="_(?=\W|$)" attribute="Emphasis" context="#pop"/><IncludeRules context="Markup"/></context><context name="Function Call - Parameter" attribute="Code"><DetectChar char="," attribute="Operator" context="#pop"/><IncludeRules context="Code"/></context><context name="Import 2" attribute="Code" fallthroughContext="#pop" lineEndContext="#pop"><DetectSpaces/><DetectChar char="," attribute="Operator" context="#pop!Import 1"/></context><context name="Let 1" attribute="Code"><DetectChar char="(" attribute="Operator" context="#pop!Let 2"/><IncludeRules context="Let 3"/></context><context name="Let 2" attribute="Code"><DetectChar char=")" attribute="Operator" context="#pop!Let 3"/><IncludeRules context="Function Call"/></context><context name="Markup Block Call" attribute="Normal Text"><DetectChar char="]" attribute="Operator" context="#pop!Continued Expression" endRegion="Markup Block"/><IncludeRules context="Markup Block"/></context><context name="Markup Inner []" attribute="Normal Text"><DetectChar char="]" context="#pop"/><IncludeRules context="Markup"/></context><context name="Multi-Line Comment" attribute="Comment"><StringDetect String="*/" attribute="Comment" context="#pop" endRegion="Comment"/><IncludeRules context="Comment"/></context><context name="Set 1" attribute="Code"><DetectSpaces/><DetectChar char="(" attribute="Operator" context="#pop!Function Call"/></context><context name="Strong" attribute="Strong"><RegExpr String="\*(?=\W|$)" attribute="Strong" context="#pop"/><IncludeRules context="Markup"/></context><context name="Value Access" attribute="Code" fallthroughContext="#pop!Line Error" lineEndContext="#pop"><RegExpr String="(?&lt;![a-zA-Z_])[a-zA-Z_][a-zA-Z0-9_\-]*(?![a-zA-Z0-9_\-])" context="#pop!Continued Expression"/></context></contexts><itemDatas><itemData name="Comment" defStyleNum="dsComment"/><itemData name="Error" defStyleNum="dsError"/><itemData name="Normal Text" defStyleNum="dsNormal"/><itemData name="Heading" defStyleNum="dsFunction" bold="1"/><itemData name="List" defStyleNum="dsNormal" bold="1"/><itemData name="Strong" defStyleNum="dsNormal" bold="1"/><itemData name="Emphasis" defStyleNum="dsNormal" italic="1"/><itemData name="Raw Text" defStyleNum="dsSpecialString"/><itemData name="URL Literal" defStyleNum="dsSpecialString"/><itemData name="Code" defStyleNum="dsNormal"/><itemData name="Code Keyword" defStyleNum="dsKeyword"/><itemData name="Builtin" defStyleNum="dsBuiltIn"/><itemData name="Int" defStyleNum="dsDecVal"/><itemData name="Float" defStyleNum="dsFloat"/><itemData name="String" defStyleNum="dsString"/><itemData name="Special Char" defStyleNum="dsSpecialChar"/><itemData name="Label" defStyleNum="dsVariable"/><itemData name="Label Reference" defStyleNum="dsVariable"/><itemData name="Operator" defStyleNum="dsOperator"/><itemData name="Element" defStyleNum="dsVariable"/><itemData name="Control Flow" defStyleNum="dsControlFlow"/><itemData name="Import" defStyleNum="dsImport"/><itemData name="Math" defStyleNum="dsSpecialString"/></itemDatas></highlighting><general><comments><comment name="singleLine" start="//"/><comment name="multiLine" start="/*" end="*/" region="Comment"/></comments><keywords casesensitive="1" weakDeliminator="-" additionalDeliminator="#"/></general></language>