Damson/assets/syntax/gcode.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
8.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE language><language name="G-Code" version="12" kateversion="5.62" section="3D" extensions="*.ngc;*.gcode" mimetype="text/ngc" author="Fernand Veilleux ([email protected])" license="LGPLv2+"><highlighting><list name="operators"><item>and</item><item>eq</item><item>ge</item><item>gt</item><item>le</item><item>lt</item><item>mod</item><item>ne</item><item>or</item><item>xor</item></list><list name="functions"><item>abs</item><item>acos</item><item>asin</item><item>atan</item><item>atan2</item><item>cos</item><item>datetime</item><item>degrees</item><item>exists</item><item>exp</item><item>fix</item><item>floor</item><item>fup</item><item>isnan</item><item>ln</item><item>max</item><item>min</item><item>mod</item><item>radians</item><item>random</item><item>round</item><item>sin</item><item>sqrt</item><item>tan</item></list><list name="o_sub"><item>call</item><item>endsub</item><item>return</item><item>sub</item></list><list name="keyword"><item>abort</item><item>break</item><item>continue</item><item>do</item><item>echo</item><item>else</item><item>elseif</item><item>endif</item><item>endrepeat</item><item>endwhile</item><item>global</item><item>if</item><item>repeat</item><item>set</item><item>var</item><item>while</item></list><list name="named constants"><item>false</item><item>iterations</item><item>line</item><item>null</item><item>pi</item><item>result</item><item>true</item></list><contexts><context name="Alert" attribute="Alert" fallthroughContext="alert" lineEndContext="#pop"><RegExpr String="^\s*[nN]\s*\d[\s\d]*+(?![.])" attribute="Line Number" column="0"/><DetectSpaces attribute="Normal Text"/><DetectChar char="%" attribute="M-word"/><AnyChar String="[]" attribute="Brackets"/><DetectChar char="(" context="parenthese" lookAhead="1"/><DetectChar char="#" context="hash1" lookAhead="1"/><AnyChar String="+-*/=:" attribute="Operator"/><DetectChar char='"' attribute="String" context="string"/><DetectChar char="{" attribute="Operator" context="expression"/><DetectChar char=";" attribute="Comment" context="comment"/><RegExpr String="\d[\s\d]*+([.][\s\d]*+)?(?![.])|[.]\s*(\d[\s\d]*+)?(?![.])" attribute="Number"/><RegExpr String="[abcu-z](?=[\s+\-\d#\[.{;]|$)" attribute="Coordinate" insensitive="1"/><RegExpr String="[gG]\s*(\d[\s\d]*+([.][\s\d]*+)?(?![.])|(?=[\[#]))" attribute="G-word"/><RegExpr String='[deh-lpqr@^](?=[\s+\-\d#\[."{;]|$)' attribute="G-options" insensitive="1"/><RegExpr String="[mM]\s*((?!1\s*\d\s*\d\s*(?=[^\d.]|$))\d[\s\d]*+([.][\s\d]*+)?(?![.])|[+#\[])" attribute="M-word"/><RegExpr String='[fF](?=\s*[+\d#\[."{])|[tsTS](?=\s*[+\d#\["{])' attribute="Tool"/><RegExpr String="[mM]\d[\s\d]*+([.][\s\d]*+)?(?![.])" attribute="M-word (user)"/><RegExpr String="[oO](\s*(\d[\s\d]*+([.][\s\d]*+)?(?![.])|[.]\s*(\d[\s\d]*+)?(?![.])|&lt;\s*+[^>]+>|$|(?=;))|\s+|(?=;))" attribute="O-word"/><keyword String="functions" attribute="Function"/><keyword String="operators" attribute="Operator"/><keyword String="o_sub" attribute="Sub-program"/><keyword String="keyword" attribute="Keyword" context="meta_command"/></context><context name="alert" attribute="Alert" lineEndContext="#pop"><RegExpr String="[^;(]+" attribute="Alert"/><DetectChar char=";" attribute="Comment" context="comment"/><DetectChar char="(" context="parenthese" lookAhead="1"/></context><context name="comment" attribute="Comment" lineEndContext="#pop"><DetectSpaces/><IncludeRules context="##Comments"/><DetectIdentifier/></context><context name="parenthese" attribute="Alert" lineEndContext="#pop"><RegExpr String="\(\s*(PRINT|DEBUG|MSG|AXIS|(PROBE(CLOSE|OPEN))|(LOG(OPEN|CLOSE|APPEND|[\s,])))[^\)]*\)" attribute="Message" context="#pop" insensitive="1"/><RangeDetect char1=")" char="(" attribute="Comment" context="#pop"/><DetectChar char="(" attribute="Alert" context="#pop!alert"/></context><context name="expression" attribute="Normal Text" lineEndContext="#pop"><keyword String="functions" attribute="Function"/><DetectIdentifier attribute="Normal Text"/><DetectSpaces attribute="Normal Text"/><DetectChar char="}" attribute="Operator" context="#pop"/><IncludeRules context="expression_common"/></context><context name="expression_common" attribute="Normal Text" lineEndContext="#pop"><AnyChar String="+-*/=:!#&lt;>&amp;|^,?" attribute="Operator"/><AnyChar String="[]" attribute="Brackets"/><DetectChar char='"' attribute="String" context="string"/><DetectChar char="{" attribute="Operator" context="expression"/><DetectChar char=";" attribute="Comment" context="comment"/><RegExpr String="\d[\s\d]*+([.][\s\d]*+)?(?![.])|[.]\s*\d[\s\d]*+(?![.])" attribute="Number"/><Int attribute="Alert"/></context><context name="hash1" attribute="Alert" fallthroughContext="#pop!alert" lineEndContext="#pop"><RegExpr String="#\s*(\d[\s\d]*+(?![.])|&lt;\s*_[^>]*>)" attribute="Param (global)" context="#pop"/><RegExpr String="#(?=\s*+(\[|#\s*[&lt;\[]))|#\s*+(#(?!\s*#)|&lt;\s*+[^>]+>)" attribute="Param (local)" context="#pop"/></context><context name="string" attribute="String" lineEndContext="#pop"><StringDetect String='""' context="quot1" lookAhead="1"/><DetectChar char='"' attribute="String" context="#pop"/><DetectChar char="'" attribute="Special String Char"/><RegExpr String="[^'&#34;]+" attribute="String"/></context><context name="meta_command" attribute="Normal Text" lineEndContext="#pop"><DetectSpaces attribute="Normal Text"/><keyword String="named constants" attribute="Constant"/><keyword String="functions" attribute="Function"/><keyword String="operators" attribute="Operator"/><DetectIdentifier attribute="Normal Text"/><DetectChar char="#" context="hash1" lookAhead="1"/><DetectChar char="(" context="parenthese" lookAhead="1"/><IncludeRules context="expression_common"/></context><context name="quot1" attribute="String" lineEndContext="#pop"><DetectChar char='"' attribute="Special String Char" context="quot2"/></context><context name="quot2" attribute="String" lineEndContext="#pop"><DetectChar char='"' attribute="String" context="#pop#pop"/></context></contexts><itemDatas><itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="0"/><itemData name="Brackets" defStyleNum="dsNormal" spellChecking="0"/><itemData name="Comment" defStyleNum="dsComment"/><itemData name="Coordinate" defStyleNum="dsNormal" color="#A57800" bold="1" italic="0" spellChecking="0"/><itemData name="Function" defStyleNum="dsFunction" color="#800080" bold="1" italic="1" spellChecking="0"/><itemData name="G-options" defStyleNum="dsNormal" color="#800080" bold="1" italic="0" spellChecking="0"/><itemData name="G-word" defStyleNum="dsNormal" selColor="#FFFFFF" bold="1" italic="0" spellChecking="0"/><itemData name="Keyword" defStyleNum="dsNormal" bold="1" italic="1" spellChecking="0"/><itemData name="Line Number" defStyleNum="dsComment" spellChecking="0"/><itemData name="Message" defStyleNum="dsNormal" italic="1"/><itemData name="M-word" defStyleNum="dsNormal" color="#A07400" bold="0" italic="0" spellChecking="0"/><itemData name="M-word (user)" defStyleNum="dsNormal" color="#A07400" bold="1" italic="1" spellChecking="0"/><itemData name="String" defStyleNum="dsString"/><itemData name="Special String Char" defStyleNum="dsSpecialChar" spellChecking="0"/><itemData name="Number" defStyleNum="dsDecVal" color="#A64C00" bold="1" italic="0" spellChecking="0"/><itemData name="Operator" defStyleNum="dsOperator" color="#000080" bold="1" italic="0" spellChecking="0"/><itemData name="O-word" defStyleNum="dsControlFlow" color="#BB7B40" bold="0" italic="0" spellChecking="0"/><itemData name="Param (global)" defStyleNum="dsVariable" color="#149E05" bold="0" italic="0" spellChecking="0"/><itemData name="Param (local)" defStyleNum="dsVariable" color="#0950AB" bold="0" italic="0" spellChecking="0"/><itemData name="Sub-program" defStyleNum="dsKeyword" color="#700070" bold="0" italic="0" spellChecking="0"/><itemData name="Tool" defStyleNum="dsNormal" color="#0000D6" bold="1" italic="0" spellChecking="0"/><itemData name="Alert" defStyleNum="dsError" spellChecking="0"/><itemData name="Constant" defStyleNum="dsConstant" spellChecking="0"/></itemDatas></highlighting><general><folding indentationsensitive="1"/><comments><comment name="singleLine" start=";"/></comments><keywords casesensitive="0"/></general></language>