tm-grammars
Version:
Collecton of TextMate grammars in JSON
569 lines (568 loc) • 14.6 kB
JSON
{
"displayName": "Pkl",
"fileTypes": [
"pkl",
"pcf"
],
"foldingStartMarker": "\\{",
"foldingStopMarker": "}",
"name": "pkl",
"patterns": [
{
"captures": {
"1": {
"name": "variable.language.pkl"
},
"2": {
"name": "variable.other.module.pkl"
}
},
"match": "\\b(module)\\s+([$_\\p{L}][$0-9_\\p{L}]*(?:\\.[$_\\p{L}][$0-9_\\p{L}]*)*)"
},
{
"captures": {
"1": {
"name": "keyword.class.pkl"
},
"2": {
"name": "entity.name.type.pkl"
},
"3": {
"name": "punctuation.pkl"
},
"4": {
"name": "entity.name.type.pkl"
}
},
"match": "(typealias)\\s+([$_\\p{L}][$0-9_\\p{L}]*)\\s*(=)\\s*([$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??\\s*(\\|\\s*[$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??)*)"
},
{
"captures": {
"1": {
"name": "keyword.class.pkl"
}
},
"match": "\\b(class)\\s+[$_\\p{L}][$0-9_\\p{L}]*",
"name": "entity.name.type.pkl"
},
{
"captures": {
"1": {
"name": "keyword.control.pkl"
},
"2": {
"name": "variable.other.property.pkl"
},
"3": {
"name": "variable.other.property.pkl"
},
"4": {
"name": "storage.modifier.pkl"
}
},
"match": "\\b(for)\\s*\\(([$_\\p{L}][$0-9_\\p{L}]*)(?:\\s*,\\s*([$_\\p{L}][$0-9_\\p{L}]*))*\\s+(in)"
},
{
"captures": {
"1": {
"name": "keyword.control.pkl"
},
"2": {
"name": "entity.name.type.pkl"
}
},
"match": "\\b(new)\\s+([$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??\\s*(\\|\\s*[$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??)*)"
},
{
"captures": {
"1": {
"name": "keyword.pkl"
},
"2": {
"name": "variable.other.property.pkl"
}
},
"match": "\\b(function)\\s+([$_\\p{L}][$0-9_\\p{L}]*)"
},
{
"captures": {
"1": {
"name": "keyword.pkl"
},
"2": {
"name": "entity.name.type.pkl"
}
},
"match": "\\b(as)\\s+([$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??\\s*(\\|\\s*[$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??)*)"
},
{
"match": "\\b(true|false|null)\\b",
"name": "constant.character.language.pkl"
},
{
"match": "//.*",
"name": "comment.line.pkl"
},
{
"begin": "/\\*",
"end": "\\*/",
"name": "comment.block.pkl"
},
{
"begin": "((?:\\b|\\s*)[$_\\p{L}][$0-9_\\p{L}]*|`[^`]+`)\\s*(:)\\s*([$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??\\s*(\\|\\s*[$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??)*)",
"captures": {
"1": {
"name": "variable.other.property.pkl"
},
"2": {
"name": "punctuation.pkl"
},
"3": {
"name": "entity.name.type.pkl"
}
},
"end": "\\s*=|[),]|^[\\t ]*$"
},
{
"captures": {
"1": {
"name": "variable.other.property.pkl"
},
"2": {
"name": "punctuation.pkl"
}
},
"match": "(\\b[$_\\p{L}][$0-9_\\p{L}]*|`[^`]+`)\\s*(=)(?!=)"
},
{
"captures": {
"1": {
"name": "punctuation.pkl"
},
"2": {
"name": "entity.name.type.pkl"
}
},
"match": "(:)\\s*([$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??\\s*(\\|\\s*[$_\\p{L}][$0-9_\\p{L}]*\\s*(?:<[^>]*>)?\\s*(?:\\([^)]*\\))?\\s*\\??)*)"
},
{
"captures": {
"1": {
"name": "variable.other.property.pkl"
}
},
"match": "^\\s*([$_\\p{L}][$0-9_\\p{L}]*)\\s*\\{"
},
{
"match": "\\b(hidden|local|abstract|external|open|in|out|amends|extends|fixed|const)\\b",
"name": "storage.modifier.pkl"
},
{
"match": "\\b(amends|as|extends|function|is|let|read\\???|import|throw|trace)\\b",
"name": "keyword.pkl"
},
{
"match": "\\b(if|else|when|for|import|new)\\b",
"name": "keyword.control.pkl"
},
{
"match": "\\b0x(?:[A-Fa-f\\d][A-F_a-f\\d]*[A-Fa-f\\d]|[A-F_a-f\\d])\\b",
"name": "constant.numeric.hex.pkl"
},
{
"match": "\\b0b(?:[01][01_]*[01]|[01])\\b",
"name": "constant.numeric.binary.pkl"
},
{
"match": "\\b0o(?:[0-7][0-7_]*[0-7]|[0-7])\\b",
"name": "constant.numeric.octal.pkl"
},
{
"match": "\\b\\d(?:[0-9_]*\\d|)\\b",
"name": "constant.numeric.decimal.pkl"
},
{
"match": "\\b(?:(?:\\d(?:[0-9_]*\\d|))?\\.\\d(?:[0-9_]*\\d|)(?:[Ee][-+]?\\d(?:[0-9_]*\\d|))?|\\d(?:[0-9_]*\\d|)[Ee][-+]?\\d(?:[0-9_]*\\d|))\\b",
"name": "constant.numeric.pkl"
},
{
"match": "[-*+/]|~/|%|\\*\\*|>=??|<=??|==|!=?|&&|\\|\\||\\|>|\\?\\?|!!|=|->|\\|",
"name": "keyword.operator.pkl"
},
{
"match": "\\b(this|module|outer|super)\\b",
"name": "variable.language.pkl"
},
{
"match": "\\b(unknown|never)\\b",
"name": "support.type.pkl"
},
{
"match": "[]()\\[{}]",
"name": "meta.brace.pkl"
},
{
"match": "\\b(class|typealias)\\b",
"name": "keyword.class.pkl"
},
{
"match": "\\.\\?|[.:;]",
"name": "punctuation.pkl"
},
{
"match": "@[$_\\p{L}][$0-9_\\p{L}]*",
"name": "entity.name.type.pkl"
},
{
"begin": "(\"\"\")",
"captures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"\"\")",
"name": "string.quoted.triple.0.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\.)",
"name": "constant.character.escape.0.pkl"
}
]
},
{
"begin": "(\")",
"beginCaptures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\")|(.?)$",
"endCaptures": {
"1": {
"name": "punctuation.delimimter.pkl"
},
"2": {
"name": "invalid.illegal.newline.pkl"
}
},
"name": "string.quoted.double.0.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\.)",
"name": "constant.character.escape.0.pkl"
}
]
},
{
"begin": "(#\"\"\")",
"captures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"\"\"#)",
"name": "string.quoted.triple.1.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\#(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\#.)",
"name": "constant.character.escape.1.pkl"
}
]
},
{
"begin": "(#\")",
"beginCaptures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"#)|(.?)$",
"endCaptures": {
"1": {
"name": "punctuation.delimimter.pkl"
},
"2": {
"name": "invalid.illegal.newline.pkl"
}
},
"name": "string.quoted.double.1.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\#(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\#.)",
"name": "constant.character.escape.1.pkl"
}
]
},
{
"begin": "(##\"\"\")",
"captures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"\"\"##)",
"name": "string.quoted.triple.2.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\##(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\##.)",
"name": "constant.character.escape.2.pkl"
}
]
},
{
"begin": "(##\")",
"beginCaptures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"##)|(.?)$",
"endCaptures": {
"1": {
"name": "punctuation.delimimter.pkl"
},
"2": {
"name": "invalid.illegal.newline.pkl"
}
},
"name": "string.quoted.double.2.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\##(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\##.)",
"name": "constant.character.escape.2.pkl"
}
]
},
{
"begin": "(###\"\"\")",
"captures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"\"\"###)",
"name": "string.quoted.triple.3.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\###(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\###.)",
"name": "constant.character.escape.3.pkl"
}
]
},
{
"begin": "(###\")",
"beginCaptures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"###)|(.?)$",
"endCaptures": {
"1": {
"name": "punctuation.delimimter.pkl"
},
"2": {
"name": "invalid.illegal.newline.pkl"
}
},
"name": "string.quoted.double.3.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\###(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\###.)",
"name": "constant.character.escape.3.pkl"
}
]
},
{
"begin": "(####\"\"\")",
"captures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"\"\"####)",
"name": "string.quoted.triple.4.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\####(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\####.)",
"name": "constant.character.escape.4.pkl"
}
]
},
{
"begin": "(####\")",
"beginCaptures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"####)|(.?)$",
"endCaptures": {
"1": {
"name": "punctuation.delimimter.pkl"
},
"2": {
"name": "invalid.illegal.newline.pkl"
}
},
"name": "string.quoted.double.4.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\####(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\####.)",
"name": "constant.character.escape.4.pkl"
}
]
},
{
"begin": "(#####\"\"\")",
"captures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"\"\"#####)",
"name": "string.quoted.triple.5.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\#####(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\#####.)",
"name": "constant.character.escape.5.pkl"
}
]
},
{
"begin": "(#####\")",
"beginCaptures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"#####)|(.?)$",
"endCaptures": {
"1": {
"name": "punctuation.delimimter.pkl"
},
"2": {
"name": "invalid.illegal.newline.pkl"
}
},
"name": "string.quoted.double.5.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\#####(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\#####.)",
"name": "constant.character.escape.5.pkl"
}
]
},
{
"begin": "(######\"\"\")",
"captures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"\"\"######)",
"name": "string.quoted.triple.6.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\######(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\######.)",
"name": "constant.character.escape.6.pkl"
}
]
},
{
"begin": "(######\")",
"beginCaptures": {
"1": {
"name": "punctuation.delimiter.pkl"
}
},
"end": "(\"######)|(.?)$",
"endCaptures": {
"1": {
"name": "punctuation.delimimter.pkl"
},
"2": {
"name": "invalid.illegal.newline.pkl"
}
},
"name": "string.quoted.double.6.pkl",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.unrecognized-string-escape.pkl"
}
},
"match": "\\\\######(?:[\"\\\\nrt]|u\\{[A-Fa-f\\d]+}|\\(.+?\\))|(\\\\######.)",
"name": "constant.character.escape.6.pkl"
}
]
}
],
"scopeName": "source.pkl"
}