add json syntax

This commit is contained in:
りき萌 2024-03-12 20:03:00 +01:00
parent 7fa202ac5f
commit 1265796996
3 changed files with 64 additions and 3 deletions

17
static/syntax/json.json Normal file
View file

@ -0,0 +1,17 @@
{
"patterns": [
{ "regex": "[a-zA-Z_][a-zA-Z0-9_]*", "is": "error" },
{ "regex": "[0-9_]+(\\.[0-9_]*([eE][-+]?[0-9_]+)?)?", "is": "literal" },
{
"regex": "\"(\\\\\"|[^\"])*\"(:)",
"is": { "default": "keyword2", "captures": ["keyword2", "punct"] }
},
{ "regex": "\"(\\\\\"|[^\"])*\"", "is": "string" },
{ "regex": "[,]", "is": "punct" }
],
"keywords": {
"null": { "into": "literal" },
"true": { "into": "literal" },
"false": { "into": "literal" }
}
}