From a13754397478d84820c9638a132c91a5ca5a7e61 Mon Sep 17 00:00:00 2001
From: Sergii Pylypenko <x.pelya.x@gmail.com>
Date: Thu, 27 May 2021 23:12:16 +0300
Subject: [PATCH] mcedit: added syntax highlighting for .json files
---
misc/filehighlight.ini | 2 +-
misc/syntax/Syntax.in | 3 +++
misc/syntax/json.syntax | 39 +++++++++++++++++++++++++++++++++++++++
3 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 misc/syntax/json.syntax
diff --git a/misc/filehighlight.ini b/misc/filehighlight.ini
index b2731d756..014ab6f3a 100644
a
|
b
|
|
28 | 28 | extensions=7z;Z;ace;apk;arc;arj;ark;bz2;cab;cpio;deb;gz;lha;lz;lz4;lzh;lzma;rar;rpm;tar;tbz;tbz2;tgz;tlz;txz;tzst;xz;zip;zoo;zst |
29 | 29 | |
30 | 30 | [doc] |
31 | | extensions=chm;css;ctl;diz;doc;docm;docx;dtd;fodg;fodp;fods;fodt;htm;html;letter;lsm;mail;man;me;msg;nroff;odg;odp;ods;odt;pdf;po;ppt;pptm;pptx;ps;rtf;sgml;shtml;tex;text;txt;xls;xlsm;xlsx;xml;xsd;xslt |
| 31 | extensions=chm;css;ctl;diz;doc;docm;docx;dtd;fodg;fodp;fods;fodt;htm;html;json;letter;lsm;mail;man;me;msg;nroff;odg;odp;ods;odt;pdf;po;ppt;pptm;pptx;ps;rtf;sgml;shtml;tex;text;txt;xls;xlsm;xlsx;xml;xsd;xslt |
32 | 32 | |
33 | 33 | [source] |
34 | 34 | extensions=ada;asm;awk;bash;c;c++;caml;cc;cgi;cpp;cxx;diff;erl;go;h;h++;hh;hi;hpp;hs;inc;jasm;jav;java;js;m4;mak;mjs;ml;mli;mll;mlp;mly;pas;patch;php;phps;pl;pm;prg;py;rb;s;sas;sh;sl;st;swift;tcl;tk;xq |
diff --git a/misc/syntax/Syntax.in b/misc/syntax/Syntax.in
index 5bde4573f..d5b26d50f 100644
a
|
b
|
include cs.syntax |
136 | 136 | file ..\*\\.(?i:m?js)$ JavaScript\sProgram ^#!.\*[\s/](node|nodejs)\\b |
137 | 137 | include js.syntax |
138 | 138 | |
| 139 | file ..\*\\.(?i:json)$ JSON\sFile |
| 140 | include json.syntax |
| 141 | |
139 | 142 | file ..\*\\.(?i:ts)$ TypeScript\sProgram |
140 | 143 | include ts.syntax |
141 | 144 | |
diff --git a/misc/syntax/json.syntax b/misc/syntax/json.syntax
new file mode 100644
index 000000000..906a24749
-
|
+
|
|
| 1 | # |
| 2 | # JavaScript syntax highlighting |
| 3 | # for MC Editor/CoolEdit |
| 4 | # |
| 5 | # Author: Sergii Pylypenko <x.pelya.x@gmail.com> |
| 6 | # |
| 7 | |
| 8 | context default |
| 9 | |
| 10 | #========================= |
| 11 | # Constants |
| 12 | keyword whole true brightgreen |
| 13 | keyword whole false brightgreen |
| 14 | keyword whole null brightgreen |
| 15 | |
| 16 | #========================= |
| 17 | # Numbers |
| 18 | keyword whole \[-\]\{0123456789\}\[0123456789\] brightgreen |
| 19 | keyword whole \[-\]\{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\] brightgreen |
| 20 | keyword whole \[-\]\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] brightgreen |
| 21 | keyword whole \[-\]\{0123456789\}\[0123456789\]\{eE\}\{\-\+\}\{0123456789\}\[0123456789\] brightgreen |
| 22 | keyword whole \[-\]\{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] brightgreen |
| 23 | keyword whole \[-\]\{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\]\{eE\}\{\-\+\}\{0123456789\}\[0123456789\] brightgreen |
| 24 | |
| 25 | #========================= |
| 26 | # Separators |
| 27 | keyword { brightcyan |
| 28 | keyword } brightcyan |
| 29 | keyword [ brightcyan |
| 30 | keyword ] brightcyan |
| 31 | keyword , brightcyan |
| 32 | keyword : brightcyan |
| 33 | |
| 34 | #============================= |
| 35 | # Strings |
| 36 | context " " green |
| 37 | spellcheck |
| 38 | keyword \\\{"\\/bfnrt\} brightgreen |
| 39 | keyword \\u\{0123456789ABCDEFabcdef\}\{0123456789ABCDEFabcdef\}\{0123456789ABCDEFabcdef\}\{0123456789ABCDEFabcdef\} brightgreen |