summaryrefslogtreecommitdiffstats
path: root/kate
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2018-06-21 23:36:49 +0900
committerMichele Calgaro <[email protected]>2018-06-21 23:36:49 +0900
commit6734f5e47f496ca1b89e2fd6c51e46ec447e3de1 (patch)
treef093226e23d2d772451f3047e112997bae10d4b6 /kate
parentf52b584fa9f1990da99c3d3f39e164d02ec1c0b9 (diff)
downloadtdelibs-6734f5e47f496ca1b89e2fd6c51e46ec447e3de1.tar.gz
tdelibs-6734f5e47f496ca1b89e2fd6c51e46ec447e3de1.zip
Added G-code Kate syntax highlight file.
Taken from: https://raw.githubusercontent.com/FernV/Gcode-highlight-for-Kate/master/gcode.xml Work from: Copyright © 2016 by Fernand Veilleux ([email protected]) License: Library GPL Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'kate')
-rw-r--r--kate/data/CMakeLists.txt6
-rw-r--r--kate/data/Makefile.am6
-rw-r--r--kate/data/gcode.xml211
-rw-r--r--kate/data/update-files.xml1
4 files changed, 218 insertions, 6 deletions
diff --git a/kate/data/CMakeLists.txt b/kate/data/CMakeLists.txt
index 6689852b8..5ba7b5d88 100644
--- a/kate/data/CMakeLists.txt
+++ b/kate/data/CMakeLists.txt
@@ -35,9 +35,9 @@ install( FILES
desktop.xml diff.xml djangotemplate.xml dockerfile.xml dosbat.xml dot.xml
doxygenlua.xml doxygen.xml dtd.xml d.xml eiffel.xml email.xml erlang.xml
euphoria.xml e.xml fasm.xml ferite.xml fgl-4gl.xml fgl-per.xml fortran.xml freebasic.xml
- fsharp.xml fstab.xml ftl.xml gap.xml gcc.xml gdb.xml gdl.xml gettext.xml git-ignore.xml
- git-rebase.xml gitolite.xml glosstex.xml glsl.xml gnuassembler.xml gnuplot.xml go.xml
- grammar.xml groovy.xml hamlet.xml haml.xml haskell.xml haxe.xml html.xml
+ fsharp.xml fstab.xml ftl.xml gap.xml gcc.xml gcode.xml gdb.xml gdl.xml gettext.xml
+ git-ignore.xml git-rebase.xml gitolite.xml glosstex.xml glsl.xml gnuassembler.xml gnuplot.xml
+ go.xml grammar.xml groovy.xml hamlet.xml haml.xml haskell.xml haxe.xml html.xml
hunspell-aff.xml hunspell-dat.xml hunspell-dic.xml hunspell-idx.xml
idconsole.xml idl.xml ilerpg.xml inform.xml
ini.xml isocpp.xml jam.xml javadoc.xml javascript.xml java.xml json.xml
diff --git a/kate/data/Makefile.am b/kate/data/Makefile.am
index cd37bb5d2..cbc01cce1 100644
--- a/kate/data/Makefile.am
+++ b/kate/data/Makefile.am
@@ -15,9 +15,9 @@ syntaxkate_DATA = language.dtd syntax.template \
desktop.xml diff.xml djangotemplate.xml dockerfile.xml dosbat.xml dot.xml \
doxygenlua.xml doxygen.xml dtd.xml d.xml eiffel.xml email.xml erlang.xml \
euphoria.xml e.xml fasm.xml ferite.xml fgl-4gl.xml fgl-per.xml fortran.xml freebasic.xml \
- fsharp.xml fstab.xml ftl.xml gap.xml gcc.xml gdb.xml gdl.xml gettext.xml git-ignore.xml \
- git-rebase.xml gitolite.xml glosstex.xml glsl.xml gnuassembler.xml gnuplot.xml go.xml \
- grammar.xml groovy.xml hamlet.xml haml.xml haskell.xml haxe.xml html.xml html-php.xml \
+ fsharp.xml fstab.xml ftl.xml gap.xml gcc.xml gcode.xml gdb.xml gdl.xml gettext.xml \
+ git-ignore.xml git-rebase.xml gitolite.xml glosstex.xml glsl.xml gnuassembler.xml gnuplot.xml \
+ go.xml grammar.xml groovy.xml hamlet.xml haml.xml haskell.xml haxe.xml html.xml html-php.xml \
hunspell-aff.xml hunspell-dat.xml hunspell-dic.xml hunspell-idx.xml \
idconsole.xml idl.xml ilerpg.xml inform.xml \
ini.xml isocpp.xml jam.xml javadoc.xml javascript.xml javascript-php.xml java.xml json.xml \
diff --git a/kate/data/gcode.xml b/kate/data/gcode.xml
new file mode 100644
index 000000000..029ec0446
--- /dev/null
+++ b/kate/data/gcode.xml
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+
+ G-code syntax highlighting for KatePart
+
+ Copy this file to : ~/.tde/share/apps/katepart/syntax/
+
+ Copyright © 2016 by Fernand Veilleux ([email protected])
+ All rights reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ -->
+<language name="G-Code"
+ version="1.00-1"
+ kateversion="3.8"
+ section="Other"
+ extensions="*.ngc"
+ mimetype="text/ngc"
+ author="Fernand Veilleux ([email protected])"
+ license="LGPL">
+
+ <highlighting>
+ <list name="operators">
+ <item>and</item>
+ <item>or</item>
+ <item>xor</item>
+ <item>eq</item>
+ <item>ne</item>
+ <item>gt</item>
+ <item>ge</item>
+ <item>lt</item>
+ <item>le</item>
+ <item>mod</item>
+ </list>
+
+ <list name="functions">
+ <item>atan</item>
+ <item>abs</item>
+ <item>acos</item>
+ <item>asin</item>
+ <item>cos</item>
+ <item>exp</item>
+ <item>exists</item>
+ <item>fix</item>
+ <item>fup</item>
+ <item>ln</item>
+ <item>round</item>
+ <item>sin</item>
+ <item>sqrt</item>
+ <item>tan</item>
+ </list>
+
+ <list name="o_sub">
+ <item>sub</item>
+ <item>endsub</item>
+ <item>call</item>
+ <item>return</item>
+ </list>
+
+ <list name="keyword">
+ <item>do</item>
+ <item>while</item>
+ <item>endwhile</item>
+ <item>repeat</item>
+ <item>endrepeat</item>
+ <item>break</item>
+ <item>continue</item>
+ <item>if</item>
+ <item>elseif</item>
+ <item>else</item>
+ <item>endif</item>
+ </list>
+
+ <contexts>
+ <context name="Alert" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="^[\s\t]*[nN][\s\t]*[\d]{1,5}" attribute="Line Number"/>
+ <DetectSpaces attribute="Normal Text"/>
+ <DetectChar char="%" attribute="M-word"/>
+ <DetectChar char="[" attribute="Brackets"/>
+ <DetectChar char="]" attribute="Brackets"/>
+ <DetectChar char="(" lookAhead="1" context="parenthese"/>
+ <DetectChar char="#" lookAhead="1" context="hash1"/>
+ <RegExpr String="[.][\d\s\t]*[.]" lookAhead="1" context="alert"/>
+ <RegExpr String="[.][\d\s\t]*" attribute="Number"/>
+ <RegExpr String="[\d][\d\s\t]*[.][\d\s\t]*[.]" lookAhead="1" context="alert"/>
+ <RegExpr String="[\d][\d\s\t]*[.]?[\d\s\t]*" attribute="Number"/>
+ <RegExpr String="[+\-*/=]" attribute="Operator"/>
+ <RegExpr String=";.*$" attribute="Comment"/>
+ <keyword String="functions" attribute="Function"/>
+ <keyword String="operators" attribute="Operator"/>
+ <keyword String="o_sub" attribute="Sub-program"/>
+ <keyword String="keyword" attribute="Keyword"/>
+ <RegExpr String="[oO][\s\t]*&lt;[\s\t]*&gt;" lookAhead="1" context="alert"/>
+ <RegExpr String="[oO][\s\t]*([\d]+|&lt;[^>]*&gt;)" attribute="O-word"/>
+ <RegExpr String="[abcu-z][\s\t]*[+\-\d#\[.]" insensitive="1" lookAhead="1" context="coords"/>
+ <RegExpr String="[abcu-z].*$" insensitive="1" attribute="Alert"/>
+ <RegExpr String="[deh-lpqr@^][\s\t]*[+\-\d#\[.]" insensitive="1" lookAhead="1" context="opts"/>
+ <RegExpr String="[deh-lpqr@^].*$" insensitive="1" attribute="Alert"/>
+ <RegExpr String="[gG][\s\t]*[\d]+[\s\t]*[.]?[\s\t]*[\d]*" attribute="G-word"/>
+ <RegExpr String="[gG][\s\t]*[\[#]" lookAhead="1" context="gword"/>
+ <RegExpr String="[tsTS][\s\t]*[+\d#\[]" lookAhead="1" context="tools"/>
+ <RegExpr String="[fF][\s\t]*[+\d#\[.]" lookAhead="1" context="feed"/>
+ <RegExpr String="[mM][\s\t]*[1][\s\t]*[\d][\s\t]*[\d]" attribute="M-word (user)"/>
+ <RegExpr String="[mM][\s\t]*([\d][\s\t]*[\d]?|[+#\[])" lookAhead="1" context="mword"/>
+ <RegExpr String=".*$" attribute="Alert"/>
+ </context>
+
+ <context name="feed" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="[fF]" attribute="Tool" context="#pop"/>
+ </context>
+
+ <context name="tools" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="[tsTS]" attribute="Tool" context="#pop"/>
+ </context>
+
+ <context name="gword" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="[gG]" attribute="G-word" context="#pop"/>
+ </context>
+
+ <context name="mword" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="[mM]" attribute="M-word" context="#pop"/>
+ </context>
+
+ <context name="coords" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="[abcu-z]" insensitive="1" attribute="Coordinate" context="#pop"/>
+ </context>
+
+ <context name="opts" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="[deh-lpqr@^]" insensitive="1" attribute="G-options" context="#pop"/>
+ </context>
+
+ <context name="parenthese" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="\([\s\t]*(PRINT|DEBUG|MSG|AXIS|(PROBE(CLOSE|OPEN))|(LOG(OPEN|CLOSE|APPEND|[\s]|[\,])))[^\)]*\)"
+ insensitive="1" attribute="Message" context="#pop"/>
+ <RegExpr String="\([^\)]*\)" attribute="Comment" context="#pop"/>
+ </context>
+
+ <context name="hash1" attribute="Alert" lineEndContext="#pop">
+ <RegExpr String="#[\s\t]*&lt;[\s\t]*&gt;" context="alert"/>
+ <RegExpr String="#[0\s\t]*(5000)" attribute="Param (global)" context="#pop"/>
+ <RegExpr String="#[0\s\t]*[1-4][0-9]{3}" attribute="Param (global)" context="#pop"/>
+ <RegExpr String="#[0\s\t]*[1-9][\d]{2}" attribute="Param (global)" context="#pop"/>
+ <RegExpr String="#[0\s\t]*[4-9][\d]{1}" attribute="Param (global)" context="#pop"/>
+ <RegExpr String="#[0\s\t]*[3][1-9]" attribute="Param (global)" context="#pop"/>
+ <RegExpr String="#[0\s\t]*(30)" attribute="Param (local)" context="#pop"/>
+ <RegExpr String="#[0\s\t]*[12][0-9]{1}" attribute="Param (local)" context="#pop"/>
+ <RegExpr String="#[0\s\t]*[1-9]{1}" attribute="Param (local)" context="#pop"/>
+ <RegExpr String="#[\s\t]*&lt;[\s\t]*_[^>]*&gt;" attribute="Param (global)" context="#pop"/>
+ <RegExpr String="#[\s\t]*&lt;[^>]*&gt;" attribute="Param (local)" context="#pop"/>
+ <RegExpr String="[#][\s\t]*[#][\s\t]*[#]+" lookAhead="1" context="alert"/>
+ <RegExpr String="#[\s\t]*#[\s\t]*[&lt;\[]" lookAhead="1" context="hash2"/>
+ <RegExpr String="#[\s\t]*#" attribute="Param (local)" context="#pop"/>
+ <RegExpr String="#[\s\t]*\[" lookAhead="1" context="hash2"/>
+ </context>
+
+ <context name="hash2" attribute= "Alert" lineEndContext="#pop">
+ <RegExpr String="#" attribute="Param (local)" context="#pop#pop"/>
+ </context>
+
+ <context name="alert" attribute="Alert" lineEndContext="#pop">
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Brackets" defStyleNum="dsNormal"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Coordinate" defStyleNum="dsNormal" color="#A57800" bold="1" italic="0"/>
+ <itemData name="Function" defStyleNum="dsFunction" color="#800080" bold="1" italic="1"/>
+ <itemData name="G-options" defStyleNum="dsNormal" color="#800080" bold="1" italic="0"/>
+ <itemData name="G-word" defStyleNum="dsNormal" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="Keyword" defStyleNum="dsNormal" bold="1" italic="1"/>
+ <itemData name="Line Number" defStyleNum="dsComment"/>
+ <itemData name="Message" defStyleNum="dsNormal" italic="1" />
+ <itemData name="M-word" defStyleNum="dsNormal" color="#A07400" bold="0" italic="0" />
+ <itemData name="M-word (user)" defStyleNum="dsNormal" color="#A07400" bold="1" italic="1"/>
+ <itemData name="Number" defStyleNum="dsDecVal" color="#A64C00" bold="1" italic="0"/>
+ <itemData name="Operator" defStyleNum="dsOperator" color="#000080" bold="1" italic="0"/>
+ <itemData name="O-word" defStyleNum="dsControlFlow" color="#BB7B40" bold="0" italic="0"/>
+ <itemData name="Param (global)" defStyleNum="dsVariable" color="#149E05" bold="0" italic="0"/>
+ <itemData name="Param (local)" defStyleNum="dsVariable" color="#0950AB" bold="0" italic="0"/>
+ <itemData name="Sub-program" defStyleNum="dsKeyword" color="#700070" bold="0" italic="0"/>
+ <itemData name="Tool" defStyleNum="dsNormal" color="#0000D6" bold="1" italic="0"/>
+ <itemData name="Alert" defStyleNum="dsError"/>
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <folding indentationsensitive="1"/>
+ <comments>
+ <comment name="singleLine" start=";"/>
+ </comments>
+ <keywords casesensitive="0"/>
+ </general>
+</language>
+
diff --git a/kate/data/update-files.xml b/kate/data/update-files.xml
index 66a842757..48805a566 100644
--- a/kate/data/update-files.xml
+++ b/kate/data/update-files.xml
@@ -77,6 +77,7 @@
<Definition name="FTL" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/ftl.xml" version="1.10"/>
<Definition name="GAP" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/gap.xml" version="0.2-1"/>
<Definition name="GCCExtensions" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/gcc.xml" version="0.4"/>
+<Definition name="G-Code" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/gcode.xml" version="1.00-1"/>
<Definition name="GDB Backtrace" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/gdb.xml" version="1.0-1"/>
<Definition name="GDL" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/gdl.xml" version="2"/>
<Definition name="GNU Gettext" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/gettext.xml" version="2.01-1"/>