NAC_Blockchain/cnnl-vscode-extension/syntaxes/cnnl.tmLanguage.json

84 lines
1.8 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "CNNL",
"scopeName": "source.cnnl",
"patterns": [
{
"include": "#comments"
},
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#constants"
},
{
"include": "#functions"
}
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.double-slash.cnnl",
"match": "//.*$"
},
{
"name": "comment.block.cnnl",
"begin": "/\\*",
"end": "\\*/"
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.control.cnnl",
"match": "\\b(clause|level|title|predicate|parameter|obligation|depends_on|if|else|return|true|false)\\b"
},
{
"name": "keyword.other.cnnl",
"match": "\\b(eternal|strategic|operational|continuous|periodic|manual|ai_enforcer)\\b"
}
]
},
"strings": {
"name": "string.quoted.double.cnnl",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.cnnl",
"match": "\\\\."
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.float.cnnl",
"match": "\\b[0-9]+\\.[0-9]+\\b"
},
{
"name": "constant.numeric.integer.cnnl",
"match": "\\b[0-9]+\\b"
}
]
},
"constants": {
"name": "variable.other.constant.cnnl",
"match": "\\b[A-Z][A-Z0-9_]*\\b"
},
"functions": {
"name": "entity.name.function.cnnl",
"match": "\\b[a-z_][a-z0-9_]*(?=\\s*\\()"
}
}
}