summaryrefslogtreecommitdiff
path: root/mc
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2020-04-12 14:43:48 +0200
committerJonas Smedegaard <dr@jones.dk>2020-04-12 14:43:48 +0200
commit6d782c199c4566ee4684fb61f3f64729eaee68ca (patch)
tree398fe7d28ffcff98a61506036495e0b556413232 /mc
parent0b6ded513adda502b62561dd7d403e9ff477de4b (diff)
add Turtle syntax highlighting for mc
Diffstat (limited to 'mc')
-rw-r--r--mc/syntax/Syntax.diff11
-rw-r--r--mc/syntax/turtle.syntax120
2 files changed, 131 insertions, 0 deletions
diff --git a/mc/syntax/Syntax.diff b/mc/syntax/Syntax.diff
new file mode 100644
index 0000000..dd0904d
--- /dev/null
+++ b/mc/syntax/Syntax.diff
@@ -0,0 +1,11 @@
+--- a/Syntax
++++ b/Syntax
+@@ -301,5 +301,8 @@
+ file ..\*\\.(?i:yab)$ Yabasic\s(Yet\sAnother\sBASIC)
+ include markdown.syntax
+
++file ..\*\\.ttl$ Turtle/RDF\sFile
++include turtle.syntax
++
+ file .\* unknown
+ include unknown.syntax
diff --git a/mc/syntax/turtle.syntax b/mc/syntax/turtle.syntax
new file mode 100644
index 0000000..8e08933
--- /dev/null
+++ b/mc/syntax/turtle.syntax
@@ -0,0 +1,120 @@
+#
+# Turtle syntax highlighting
+# for MC Editor/CoolEdit
+#
+# Copyright 2020, Jonas Smedegaard <dr@jones.dk>
+#
+# This program is free software:
+# you can redistribute it and/or modify it
+# under the terms of the GNU General Public License
+# as published by the Free Software Foundation,
+# either version 3 of the License,
+# or (at your option) any later version.
+#
+# 2020-04-12 Jonas Smedegaard <dr@jones.dk>
+# * Initial public release.
+#
+# Reference:
+# https://www.w3.org/TeamSubmission/turtle/
+
+context default lightgray
+ spellcheck
+
+# declarations
+ keyword whole @base magenta
+ keyword whole @prefix magenta
+
+ keyword whole a yellow
+
+ keyword ^^ brightmagenta
+
+# Collection
+ keyword ( brightmagenta
+ keyword ) brightmagenta
+
+# Shorthand prefix
+ keyword wholeleft \{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[\abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-\]: cyan
+ keyword wholeleft : cyan
+
+# Anonymous node
+ keyword wholeleft _: cyan
+ keyword [ cyan
+ keyword ] cyan
+
+# Decimal integers
+ keyword whole \{0123456789\}\[0123456789\] yellow
+ keyword whole \{-+\}\{0123456789\}\[0123456789\] yellow
+
+# Decimal floating point arbitrary precision number
+ keyword whole \{0123456789\}.\[0123456789\] yellow
+ keyword whole .\{0123456789\}\[0123456789\] yellow
+ keyword whole \{-+\}\{0123456789\}.\[0123456789\] yellow
+ keyword whole \{-+\}.\{0123456789\}\[0123456789\] yellow
+
+# Decimal floating point double/fixed precision number
+ keyword whole \{0123456789\}.\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] yellow
+ keyword whole \{0123456789\}.\[0123456789\]\{-+\}\{eE\}\{0123456789\}\[0123456789\] yellow
+ keyword whole .\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] yellow
+ keyword whole .\{0123456789\}\[0123456789\]\{-+\}\{eE\}\{0123456789\}\[0123456789\] yellow
+ keyword whole \{-+\}\{0123456789\}.\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] yellow
+ keyword whole \{-+\}\{0123456789\}.\[0123456789\]\{-+\}\{eE\}\{0123456789\}\[0123456789\] yellow
+ keyword whole \{-+\}.\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] yellow
+ keyword whole \{-+\}.\{0123456789\}\[0123456789\]\{-+\}\{eE\}\{0123456789\}\[0123456789\] yellow
+
+# Boolean
+ keyword whole true yellow
+ keyword whole false yellow
+
+# Language
+ keyword wholeright @\{abcdefghijklmnopqrstuvwxyz\}\[abcdefghijklmnopqrstuvwxyz0123456789-\]\[abcdefghijklmnopqrstuvwxyz0123456789\] brightmagenta
+ keyword wholeright @\{abcdefghijklmnopqrstuvwxyz\}\[abcdefghijklmnopqrstuvwxyz0123456789\] brightmagenta
+
+# Punctuation
+ keyword , white
+ keyword ; white
+# keyword . black white
+ keyword . white brightmagenta
+
+# URL
+# keyword whole <*> brightred
+context < > brightred
+
+# TODO: enable when context ending at newline doesn't ruin next context
+# syntax violation
+# keyword +\n black red
+
+# String escape
+ keyword \\u\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
+ keyword \\U\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
+ keyword \\\{tnr>\\} brightgreen
+
+# Single-line literals
+context exclusive " " green
+ spellcheck
+
+# TODO: enable when context ending at newline doesn't ruin next context
+# syntax violation
+# keyword +\n black red
+
+# String escape
+ keyword \\u\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
+ keyword \\U\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
+ keyword \\\{tnr"\\} brightgreen
+
+# Multi-line literals
+context """ """ green
+ spellcheck
+
+# String escape
+ keyword \\u\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
+ keyword \\U\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\}\{0123456789abcdef\} brightgreen
+ keyword \\\{tnr"\\} brightgreen
+
+# Comment
+context linestart # \n brown
+ spellcheck
+
+# Ideally we would have defined comments with "context linestart \[\s\]# ...",
+# but contexts can't start with a character class. So we define comments twice.
+context linestart \s\[\s\]# \n brown
+ spellcheck