Ticket #4250: mcedit: add syntax highlighting for .json files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Sergii Pylypenko 2021-05-27 23:12:16 +03:00 committed by Andrew Borodin
parent 167f437b14
commit 4be98a52ba
3 changed files with 43 additions and 0 deletions

View File

@ -44,6 +44,7 @@ SYNTAXFILES = \
jal.syntax \
java.syntax \
js.syntax \
json.syntax \
kotlin.syntax \
latex.syntax \
lisp.syntax \

View File

@ -136,6 +136,9 @@ include cs.syntax
file ..\*\\.(?i:m?js)$ JavaScript\sProgram ^#!.\*[\s/](node|nodejs)\\b
include js.syntax
file ..\*\\.(?i:json)$ JSON\sFile
include json.syntax
file ..\*\\.(?i:ts)$ TypeScript\sProgram
include ts.syntax

39
misc/syntax/json.syntax Normal file
View File

@ -0,0 +1,39 @@
#
# JSON syntax highlighting
# for MC Editor/CoolEdit
#
# Author: Sergii Pylypenko <x.pelya.x@gmail.com>
#
context default
#=========================
# Constants
keyword whole true brightgreen
keyword whole false brightgreen
keyword whole null brightgreen
#=========================
# Numbers
keyword whole \[-\]\{0123456789\}\[0123456789\] brightgreen
keyword whole \[-\]\{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\] brightgreen
keyword whole \[-\]\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] brightgreen
keyword whole \[-\]\{0123456789\}\[0123456789\]\{eE\}\{\-\+\}\{0123456789\}\[0123456789\] brightgreen
keyword whole \[-\]\{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] brightgreen
keyword whole \[-\]\{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\]\{eE\}\{\-\+\}\{0123456789\}\[0123456789\] brightgreen
#=========================
# Separators
keyword { brightcyan
keyword } brightcyan
keyword [ brightcyan
keyword ] brightcyan
keyword , brightcyan
keyword : brightcyan
#=============================
# Strings
context " " green
spellcheck
keyword \\\{"\\/bfnrt\} brightgreen
keyword \\u\{0123456789ABCDEFabcdef\}\{0123456789ABCDEFabcdef\}\{0123456789ABCDEFabcdef\}\{0123456789ABCDEFabcdef\} brightgreen