refine blocks detection
This commit is contained in:
+122
-145
@@ -94,7 +94,7 @@
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.arithmetic.eftl",
|
||||
"match": "[+\\-*/%]"
|
||||
"match": "([+\\-*%]|/(?!\\]))"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.comparison.eftl",
|
||||
@@ -129,45 +129,85 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"tags": {
|
||||
"attributes": {
|
||||
"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" }
|
||||
]
|
||||
"comment": "name attribute",
|
||||
"match": "\\b(name)\\b\\s*(=)\\s*(\"(.*?)\")",
|
||||
"captures": {
|
||||
"1": { "name": "entity.other.attribute-name.eftl" },
|
||||
"2": { "name": "punctuation.separator.key-value.eftl" },
|
||||
"3": { "name": "string.quoted.double.eftl" },
|
||||
"4": { "name": "variable.other.eftl" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "type attribute",
|
||||
"match": "\\b(type)\\b\\s*(=)\\s*(\"(string|boolean|number|date|object|iterable)\")",
|
||||
"captures": {
|
||||
"1": { "name": "entity.other.attribute-name.eftl" },
|
||||
"2": { "name": "punctuation.separator.key-value.eftl" },
|
||||
"3": { "name": "string.quoted.double.eftl" },
|
||||
"4": { "name": "support.type.primitive.eftl" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "generic attribute",
|
||||
"match": "\\b([a-zA-Z_][a-zA-Z0-9_-]*)\\b\\s*(=)\\s*(\"(.*?)\")",
|
||||
"captures": {
|
||||
"1": { "name": "entity.other.attribute-name.eftl" },
|
||||
"2": { "name": "punctuation.separator.key-value.eftl" },
|
||||
"3": { "name": "string.quoted.double.eftl" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag-content": {
|
||||
"tag-open-context": {
|
||||
"patterns": [
|
||||
{ "include": "#attributes" },
|
||||
{ "include": "#expressions" },
|
||||
{ "include": "#functions" },
|
||||
{ "include": "#tags" }
|
||||
]
|
||||
},
|
||||
"tags": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.function.builtin.eftl",
|
||||
"match": "\\b(GETVALUEBYTAG|SCHEMAID|PLUGIN_DOM_PARAM)\\b"
|
||||
"name": "meta.tag.block.eftl",
|
||||
"begin": "(\\[)(TAG)(?:\\s+[^\\x00]*?)?(?<!/)(\\])",
|
||||
"end": "(\\[/)(TAG)(\\])",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "entity.name.tag.eftl" },
|
||||
"2": { "name": "entity.name.tag.eftl" },
|
||||
"3": { "name": "entity.name.tag.eftl" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.tag.eftl" },
|
||||
"2": { "name": "entity.name.tag.eftl" },
|
||||
"3": { "name": "entity.name.tag.eftl" }
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#expressions" },
|
||||
{ "include": "#tags" },
|
||||
{ "include": "#functions" },
|
||||
{ "include": "#control-structures" },
|
||||
{ "include": "#variables" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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": ","
|
||||
"name": "meta.tag.eftl",
|
||||
"begin": "(\\[)(TAG)\\b",
|
||||
"end": "(/\\s*\\]|(?<!/)\\])",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "entity.name.tag.eftl" },
|
||||
"2": { "name": "entity.name.tag.eftl" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"0": { "name": "entity.name.tag.eftl" }
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#tag-open-context" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -175,14 +215,18 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.header.eftl",
|
||||
"match": "(\\[HEADER)\\s+(name=\"[^\"]*\")\\s+(value=\"[^\"]*\")\\s+(type=\"[^\"]*\")\\s*(/\\])",
|
||||
"captures": {
|
||||
"begin": "(\\[)(HEADER)\\b",
|
||||
"end": "(/\\s*\\]|(?<!/)\\])",
|
||||
"beginCaptures": {
|
||||
"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" }
|
||||
}
|
||||
"2": { "name": "keyword.other.header.eftl" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"0": { "name": "keyword.other.header.eftl" }
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#tag-open-context" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -201,146 +245,79 @@
|
||||
"variables": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.variable.declaration.eftl",
|
||||
"begin": "(\\[VAR)",
|
||||
"end": "(\\[/VAR\\])",
|
||||
"name": "meta.variable.block.eftl",
|
||||
"begin": "(\\[)(VAR)(?:\\s+[^\\x00]*?)?(?<!/)(\\])",
|
||||
"end": "(\\[/)(VAR)(\\])",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "storage.type.variable.eftl" }
|
||||
"1": { "name": "storage.type.variable.eftl" },
|
||||
"2": { "name": "storage.type.variable.eftl" },
|
||||
"3": { "name": "storage.type.variable.eftl" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "storage.type.variable.eftl" }
|
||||
"1": { "name": "storage.type.variable.eftl" },
|
||||
"2": { "name": "storage.type.variable.eftl" },
|
||||
"3": { "name": "storage.type.variable.eftl" }
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#var-attributes" },
|
||||
{ "include": "#expressions" },
|
||||
{ "include": "#functions" },
|
||||
{ "include": "#tags" }
|
||||
{ "include": "#tags" },
|
||||
{ "include": "#control-structures" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"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"
|
||||
"name": "meta.variable.declaration.eftl",
|
||||
"begin": "(\\[)(VAR)\\b",
|
||||
"end": "(/\\s*\\]|(?<!/)\\])",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "storage.type.variable.eftl" },
|
||||
"2": { "name": "storage.type.variable.eftl" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"0": { "name": "storage.type.variable.eftl" }
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#tag-open-context" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"functions": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.function.split.eftl",
|
||||
"begin": "(\\[SPLIT)\\s+(regex=\"[^\"]*\")(\\])?",
|
||||
"end": "(\\[/SPLIT\\])",
|
||||
"name": "meta.function.block.eftl",
|
||||
"begin": "(\\[)(VALUE_OF|SIZE_OF|SPLIT|FORMAT|CONTAINS|TRIM)(?:\\s+[^\\x00]*?)?(?<!/)(\\])",
|
||||
"end": "(\\[/)(VALUE_OF|SIZE_OF|SPLIT|FORMAT|CONTAINS|TRIM)(\\])",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "support.function.eftl" },
|
||||
"2": { "name": "string.regexp.eftl" }
|
||||
"2": { "name": "support.function.eftl" },
|
||||
"3": { "name": "support.function.eftl" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "support.function.eftl" }
|
||||
"1": { "name": "support.function.eftl" },
|
||||
"2": { "name": "support.function.eftl" },
|
||||
"3": { "name": "support.function.eftl" }
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#expressions" },
|
||||
{ "include": "#functions" },
|
||||
{ "include": "#tags" },
|
||||
{ "include": "#functions" }
|
||||
{ "include": "#control-structures" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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\\])",
|
||||
"name": "meta.function.eftl",
|
||||
"begin": "(\\[)(VALUE_OF|SIZE_OF|SPLIT|FORMAT|CONTAINS|TRIM)\\b",
|
||||
"end": "(/\\s*\\]|(?<!/)\\])",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "support.function.eftl" },
|
||||
"2": { "name": "entity.other.attribute-name.eftl" }
|
||||
"2": { "name": "support.function.eftl" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "support.function.eftl" }
|
||||
"0": { "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" }
|
||||
{ "include": "#tag-open-context" }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user