add first working version

This commit is contained in:
2026-08-17 18:22:16 +02:00
parent 160ed5e409
commit f783617393
12 changed files with 1927 additions and 2 deletions
+364
View File
@@ -0,0 +1,364 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "EFTL",
"scopeName": "source.eftl",
"patterns": [
{ "include": "#comments" },
{ "include": "#eftl-block" },
{ "include": "#expressions" },
{ "include": "#tags" },
{ "include": "#control-structures" },
{ "include": "#variables" },
{ "include": "#functions" },
{ "include": "#strings" }
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.block.eftl",
"begin": "\\[!--",
"end": "--\\]",
"captures": {
"0": { "name": "punctuation.definition.comment.eftl" }
}
}
]
},
"eftl-block": {
"patterns": [
{
"name": "meta.block.eftl",
"begin": "(\\[EFTL\\])",
"end": "(\\[/EFTL\\])",
"beginCaptures": {
"1": { "name": "keyword.control.eftl.begin" }
},
"endCaptures": {
"1": { "name": "keyword.control.eftl.end" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#expressions" },
{ "include": "#tags" },
{ "include": "#control-structures" },
{ "include": "#variables" },
{ "include": "#functions" },
{ "include": "#header" },
{ "include": "#strings" }
]
}
]
},
"expressions": {
"patterns": [
{
"name": "meta.expression.output.eftl",
"begin": "\\[%=",
"end": "%\\]",
"beginCaptures": {
"0": { "name": "punctuation.section.expression.begin.eftl" }
},
"endCaptures": {
"0": { "name": "punctuation.section.expression.end.eftl" }
},
"patterns": [
{ "include": "#expression-content" }
]
},
{
"name": "meta.expression.eftl",
"begin": "\\[%",
"end": "%\\]",
"beginCaptures": {
"0": { "name": "punctuation.section.expression.begin.eftl" }
},
"endCaptures": {
"0": { "name": "punctuation.section.expression.end.eftl" }
},
"patterns": [
{ "include": "#expression-content" }
]
}
]
},
"expression-content": {
"patterns": [
{
"name": "constant.numeric.eftl",
"match": "\\b[0-9]+\\.?[0-9]*\\b"
},
{
"name": "keyword.operator.assignment.eftl",
"match": "="
},
{
"name": "keyword.operator.arithmetic.eftl",
"match": "[+\\-*/%]"
},
{
"name": "keyword.operator.comparison.eftl",
"match": "(!=|==|<=|>=|<|>)"
},
{
"name": "keyword.operator.logical.eftl",
"match": "(&&|\\|\\|)"
},
{
"name": "constant.language.boolean.eftl",
"match": "\\b(true|false)\\b"
},
{
"name": "variable.other.eftl",
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
},
{
"name": "string.quoted.double.eftl",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.eftl",
"match": "\\\\."
}
]
},
{
"name": "punctuation.terminator.statement.eftl",
"match": ";"
}
]
},
"tags": {
"patterns": [
{
"name": "meta.tag.data.eftl",
"begin": "(\\[TAG\\])",
"end": "(\\[/TAG\\])",
"beginCaptures": {
"1": { "name": "entity.name.tag.eftl" }
},
"endCaptures": {
"1": { "name": "entity.name.tag.eftl" }
},
"patterns": [
{ "include": "#tag-content" }
]
}
]
},
"tag-content": {
"patterns": [
{
"name": "support.function.builtin.eftl",
"match": "\\b(GETVALUEBYTAG|SCHEMAID|PLUGIN_DOM_PARAM)\\b"
},
{
"name": "variable.parameter.eftl",
"match": "\\b(REQUEST|MODULE|IUQOID)\\b"
},
{
"name": "constant.numeric.eftl",
"match": "\\b[0-9]+\\b"
},
{
"name": "variable.other.eftl",
"match": "\\b(COL[0-9]+)\\b"
},
{
"name": "punctuation.separator.eftl",
"match": ","
}
]
},
"header": {
"patterns": [
{
"name": "meta.header.eftl",
"match": "(\\[HEADER)\\s+(name=\"[^\"]*\")\\s+(value=\"[^\"]*\")\\s+(type=\"[^\"]*\")\\s*(/\\])",
"captures": {
"1": { "name": "keyword.other.header.eftl" },
"2": { "name": "entity.other.attribute-name.eftl" },
"3": { "name": "string.quoted.double.eftl" },
"4": { "name": "entity.other.attribute-name.eftl" },
"5": { "name": "punctuation.definition.tag.end.eftl" }
}
}
]
},
"control-structures": {
"patterns": [
{
"name": "keyword.control.conditional.eftl",
"match": "\\[(IF|ELSE IF|ELSE|/IF|CONDITION|/CONDITION|THEN|/THEN|/ELSE IF|/ELSE)\\]"
},
{
"name": "keyword.control.loop.eftl",
"match": "\\[(WHILE|/WHILE|DO|/DO)\\]"
}
]
},
"variables": {
"patterns": [
{
"name": "meta.variable.declaration.eftl",
"begin": "(\\[VAR)",
"end": "(\\[/VAR\\])",
"beginCaptures": {
"1": { "name": "storage.type.variable.eftl" }
},
"endCaptures": {
"1": { "name": "storage.type.variable.eftl" }
},
"patterns": [
{ "include": "#var-attributes" },
{ "include": "#expressions" },
{ "include": "#functions" },
{ "include": "#tags" }
]
}
]
},
"var-attributes": {
"patterns": [
{
"comment": "name attribute - variable name gets special color",
"match": "(name)(=)(\"([^\"]*)\")",
"captures": {
"1": { "name": "entity.other.attribute-name.name.eftl" },
"2": { "name": "punctuation.separator.key-value.eftl" },
"3": { "name": "string.quoted.double.eftl" },
"4": { "name": "variable.other.declaration.eftl" }
}
},
{
"comment": "type attribute with valid type values",
"match": "(type)(=)(\"(string|boolean|number|date|object|iterable)\")",
"captures": {
"1": { "name": "entity.other.attribute-name.type.eftl" },
"2": { "name": "punctuation.separator.key-value.eftl" },
"3": { "name": "string.quoted.double.eftl" },
"4": { "name": "support.type.primitive.eftl" }
}
},
{
"comment": "unique attribute - boolean value",
"match": "(unique)(=)(\"(true|false)\")",
"captures": {
"1": { "name": "entity.other.attribute-name.unique.eftl" },
"2": { "name": "punctuation.separator.key-value.eftl" },
"3": { "name": "string.quoted.double.eftl" },
"4": { "name": "constant.language.boolean.eftl" }
}
},
{
"comment": "closing bracket of VAR open tag",
"match": "\\]",
"name": "punctuation.definition.tag.end.eftl"
}
]
},
"functions": {
"patterns": [
{
"name": "meta.function.split.eftl",
"begin": "(\\[SPLIT)\\s+(regex=\"[^\"]*\")(\\])?",
"end": "(\\[/SPLIT\\])",
"beginCaptures": {
"1": { "name": "support.function.eftl" },
"2": { "name": "string.regexp.eftl" }
},
"endCaptures": {
"1": { "name": "support.function.eftl" }
},
"patterns": [
{ "include": "#expressions" },
{ "include": "#tags" },
{ "include": "#functions" }
]
},
{
"name": "meta.function.trim.eftl",
"begin": "(\\[TRIM\\])",
"end": "(\\[/TRIM\\])",
"beginCaptures": {
"1": { "name": "support.function.eftl" }
},
"endCaptures": {
"1": { "name": "support.function.eftl" }
},
"patterns": [
{ "include": "#expressions" },
{ "include": "#tags" },
{ "include": "#functions" }
]
},
{
"name": "meta.function.contains.eftl",
"begin": "(\\[CONTAINS)\\s+(varname=\"[^\"]*\")(\\])?",
"end": "(\\[/CONTAINS\\])",
"beginCaptures": {
"1": { "name": "support.function.eftl" },
"2": { "name": "entity.other.attribute-name.eftl" }
},
"endCaptures": {
"1": { "name": "support.function.eftl" }
},
"patterns": [
{ "include": "#functions" }
]
},
{
"name": "meta.function.value-of.eftl",
"match": "(\\[VALUE_OF)\\s+(varname=\"[^\"]*\")\\s*(index=\"?[^\"]*\"?)?\\s*(/\\])",
"captures": {
"1": { "name": "support.function.eftl" },
"2": { "name": "entity.other.attribute-name.eftl" },
"3": { "name": "entity.other.attribute-name.eftl" },
"4": { "name": "punctuation.definition.tag.end.eftl" }
}
},
{
"name": "meta.function.size-of.eftl",
"match": "(\\[SIZE_OF)\\s+(varname=\"[^\"]*\")\\s*(/\\])",
"captures": {
"1": { "name": "support.function.eftl" },
"2": { "name": "entity.other.attribute-name.eftl" },
"3": { "name": "punctuation.definition.tag.end.eftl" }
}
},
{
"name": "meta.function.format.eftl",
"begin": "(\\[FORMAT)\\s+(type=\"[^\"]*\")\\s*(pattern=\"[^\"]*\")?(\\])?",
"end": "(\\[/FORMAT\\])",
"beginCaptures": {
"1": { "name": "support.function.eftl" },
"2": { "name": "entity.other.attribute-name.eftl" },
"3": { "name": "string.other.pattern.eftl" }
},
"endCaptures": {
"1": { "name": "support.function.eftl" }
},
"patterns": [
{ "include": "#expressions" }
]
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.eftl",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.eftl",
"match": "\\\\."
}
]
}
]
}
}
}