1
Fork 0
treehouse/static/syntax/toml.json
liquidev 1170829d2d add bare bones TOML syntax
just for the following post so it's pretty shitty
2025-01-14 00:10:12 +01:00

38 lines
1.2 KiB
JSON

{
"comment": "NOTE: very incomplete. barely enough to highlight treehouse.toml",
"patterns": [
{ "regex": "#.*", "is": "comment" },
{
"regex": "(\"(?:\\\\\"|[^\"])*\"|[a-zA-Z0-9_\\-\\.]+)\\s*(=)",
"is": {
"default": "default",
"captures": ["ident", "operator"]
}
},
{
"regex": "(\\[)([a-zA-Z0-9_\\-\\.]+)(\\])",
"is": {
"default": "default",
"captures": ["punct", "keyword2", "punct"]
}
},
{
"regex": "(\\[\\[)([a-zA-Z0-9_\\-\\.]+)(\\]\\])",
"is": {
"default": "default",
"captures": ["punct", "keyword2", "punct"]
}
},
{ "regex": "\"\"\".*?\"\"\"", "is": "string", "flags": ["dotMatchesNewline"], "comment": "TODO: escaping" },
{ "regex": "'''.*?'''", "is": "string", "flags": ["dotMatchesNewline"], "comment": "TODO: escaping" },
{ "regex": "\"(\\\\\"|[^\"])*\"", "is": "string" },
{ "regex": "'.*?'", "is": "string" },
{ "regex": "[,\\(\\)\\[\\]\\{\\}]", "is": "punct" }
],
"keywords": {}
}