mirror of
https://github.com/diodeinc/pcb.git
synced 2026-09-14 20:17:19 +08:00
0dbe20af0c
* Initial VSCode release * Add CI * add deps * fix eslint * refactor workflows
928 lines
22 KiB
JSON
928 lines
22 KiB
JSON
{
|
|
"name": "Zener",
|
|
"scopeName": "source.zener",
|
|
"fileTypes": ["zener"],
|
|
"patterns": [
|
|
{
|
|
"include": "#statement"
|
|
},
|
|
{
|
|
"include": "#expression"
|
|
}
|
|
],
|
|
"repository": {
|
|
"statement": {
|
|
"patterns": [
|
|
{
|
|
"include": "#function-definition"
|
|
},
|
|
{
|
|
"include": "#statement-keyword"
|
|
},
|
|
{
|
|
"include": "#assignment-operator"
|
|
},
|
|
{
|
|
"include": "#docstring-statement"
|
|
},
|
|
{
|
|
"include": "#discouraged-semicolon"
|
|
}
|
|
]
|
|
},
|
|
"docstring-statement": {
|
|
"begin": "^(?=\\s*r?('''|\"\"\"|'|\"))",
|
|
"end": "(?<='''|\"\"\"|'|\")",
|
|
"patterns": [
|
|
{
|
|
"include": "#docstring"
|
|
}
|
|
]
|
|
},
|
|
"docstring": {
|
|
"patterns": [
|
|
{
|
|
"name": "comment.block.documentation.zener",
|
|
"begin": "('''|\"\"\")",
|
|
"end": "(\\1)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#code-tag"
|
|
},
|
|
{
|
|
"include": "#docstring-content"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "comment.block.documentation.zener",
|
|
"begin": "(r)('''|\"\"\")",
|
|
"end": "(\\2)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "storage.type.string.zener"
|
|
},
|
|
"2": {
|
|
"name": "punctuation.definition.string.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#string-consume-escape"
|
|
},
|
|
{
|
|
"include": "#code-tag"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "comment.line.documentation.zener",
|
|
"begin": "('|\")",
|
|
"end": "(\\1)|((?<!\\\\)\\n)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.end.zener"
|
|
},
|
|
"2": {
|
|
"name": "invalid.illegal.newline.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#code-tag"
|
|
},
|
|
{
|
|
"include": "#docstring-content"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "comment.line.documentation.zener",
|
|
"begin": "(r)('|\")",
|
|
"end": "(\\2)|((?<!\\\\)\\n)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "storage.type.string.zener"
|
|
},
|
|
"2": {
|
|
"name": "punctuation.definition.string.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.end.zener"
|
|
},
|
|
"2": {
|
|
"name": "invalid.illegal.newline.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#string-consume-escape"
|
|
},
|
|
{
|
|
"include": "#code-tag"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"docstring-content": {
|
|
"patterns": [
|
|
{
|
|
"include": "#string-escape-sequence"
|
|
},
|
|
{
|
|
"include": "#discouraged-string-line-continuation"
|
|
}
|
|
]
|
|
},
|
|
"statement-keyword": {
|
|
"patterns": [
|
|
{
|
|
"name": "storage.type.function.zener",
|
|
"match": "\\b(\\s*def)\\b"
|
|
},
|
|
{
|
|
"name": "keyword.control.flow.zener",
|
|
"match": "\\b(?<!\\.)(break|continue|elif|else|for|if|pass|return|lambda)\\b"
|
|
},
|
|
{
|
|
"name": "invalid.illegal.keyword.zener",
|
|
"match": "\\b(?<!\\.)(as|class|del|except|finally|from|global|import|is|nonlocal|raise|try|while|with|yield)\\b"
|
|
}
|
|
]
|
|
},
|
|
"expression-base": {
|
|
"patterns": [
|
|
{
|
|
"include": "#line-comment"
|
|
},
|
|
{
|
|
"include": "#literal"
|
|
},
|
|
{
|
|
"include": "#string"
|
|
},
|
|
{
|
|
"include": "#illegal-operator"
|
|
},
|
|
{
|
|
"include": "#operator"
|
|
},
|
|
{
|
|
"include": "#dictionary-literal"
|
|
},
|
|
{
|
|
"include": "#subscript-expression"
|
|
},
|
|
{
|
|
"include": "#list-literal"
|
|
},
|
|
{
|
|
"include": "#parenthesized-expression"
|
|
},
|
|
{
|
|
"include": "#function-call"
|
|
},
|
|
{
|
|
"include": "#builtin-function"
|
|
},
|
|
{
|
|
"include": "#constant-identifier"
|
|
},
|
|
{
|
|
"include": "#type-identifier"
|
|
},
|
|
{
|
|
"include": "#illegal-name"
|
|
},
|
|
{
|
|
"include": "#line-continuation"
|
|
}
|
|
]
|
|
},
|
|
"expression": {
|
|
"patterns": [
|
|
{
|
|
"include": "#expression-base"
|
|
},
|
|
{
|
|
"include": "#member-access"
|
|
},
|
|
{
|
|
"include": "#variable"
|
|
}
|
|
]
|
|
},
|
|
"variable": {
|
|
"match": "\\b([[:alpha:]_]\\w*)\\b",
|
|
"name": "variable.other.zener"
|
|
},
|
|
"member-access": {
|
|
"begin": "(\\.)\\s*(?!\\.)",
|
|
"end": "(?# Stop when we read non-whitespace followed by non-word; i.e. when finished reading an identifier or function call)(?<=\\S)(?=\\W)|(?# Stop when seeing the start of something that's not a word; e.g., a non-identifier)(^|(?<=\\s))(?=[^\\\\\\w\\s])|$",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.accessor.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#function-call"
|
|
},
|
|
{
|
|
"include": "#member-access-base"
|
|
},
|
|
{
|
|
"include": "#member-access-property"
|
|
}
|
|
]
|
|
},
|
|
"member-access-base": {
|
|
"patterns": [
|
|
{
|
|
"include": "#illegal-name"
|
|
},
|
|
{
|
|
"include": "#builtin-constant"
|
|
},
|
|
{
|
|
"include": "#constant-identifier"
|
|
},
|
|
{
|
|
"include": "#type-identifier"
|
|
},
|
|
{
|
|
"include": "#line-continuation"
|
|
},
|
|
{
|
|
"include": "#subscript-expression"
|
|
}
|
|
]
|
|
},
|
|
"member-access-property": {
|
|
"match": "\\b([[:alpha:]_]\\w*)\\b",
|
|
"name": "variable.other.property.zener"
|
|
},
|
|
"constant-identifier": {
|
|
"name": "variable.other.constant.zener",
|
|
"match": "\\b_*[[:upper:]][[:upper:]\\d]*(_\\w*)?\\b"
|
|
},
|
|
"type-identifier": {
|
|
"name": "entity.name.type.zener",
|
|
"match": "\\b_*[[:upper:]][[:alpha:]\\d]*(_\\w*)?\\b"
|
|
},
|
|
"dictionary-literal": {
|
|
"comment": "This also currently covers comprehensions.",
|
|
"begin": "\\{",
|
|
"end": "\\}",
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.dict.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.dict.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#expression"
|
|
}
|
|
]
|
|
},
|
|
"list-literal": {
|
|
"comment": "This also currently covers comprehensions.",
|
|
"begin": "\\[",
|
|
"end": "\\]",
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.list.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.list.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#expression"
|
|
}
|
|
]
|
|
},
|
|
"parenthesized-expression": {
|
|
"comment": "This covers tuples and parenthesized expressions.",
|
|
"begin": "\\(",
|
|
"end": "\\)",
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "punctuation.parenthesis.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "punctuation.parenthesis.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#expression"
|
|
}
|
|
]
|
|
},
|
|
"line-continuation": {
|
|
"patterns": [
|
|
{
|
|
"match": "(\\\\)\\s*(\\S.*$\\n?)",
|
|
"captures": {
|
|
"1": {
|
|
"name": "invalid.deprecated.continuation.line.zener"
|
|
},
|
|
"2": {
|
|
"name": "invalid.illegal.line.continuation.zener"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"begin": "(\\\\)\\s*$\\n?",
|
|
"end": "(?=^\\s*$)|(?!(\\s*[rR]?('''|\"\"\"|'|\"))|(\\G$))",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "invalid.deprecated.continuation.line.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#string"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"assignment-operator": {
|
|
"name": "keyword.operator.assignment.zener",
|
|
"match": "//=|\\+=|-=|/=|\\*=|%=|=(?!=)"
|
|
},
|
|
"operator": {
|
|
"match": "\\b(?<!\\.)(?:(and|or|not|in)(?# 1)|(for|if|else)(?# 2))(?!\\s*:)\\b|(\\*|\\+|-|%|//|/)(?# 3)|(!=|==|>=|<=|<|>)(?# 4)",
|
|
"captures": {
|
|
"1": {
|
|
"name": "keyword.operator.logical.zener"
|
|
},
|
|
"2": {
|
|
"name": "keyword.control.flow.zener"
|
|
},
|
|
"3": {
|
|
"name": "keyword.operator.arithmetic.zener"
|
|
},
|
|
"4": {
|
|
"name": "keyword.operator.comparison.zener"
|
|
}
|
|
}
|
|
},
|
|
"literal": {
|
|
"patterns": [
|
|
{
|
|
"name": "constant.language.zener",
|
|
"match": "\\b(True|False|None)\\b"
|
|
},
|
|
{
|
|
"include": "#number"
|
|
}
|
|
]
|
|
},
|
|
"number": {
|
|
"patterns": [
|
|
{
|
|
"include": "#number-decimal"
|
|
},
|
|
{
|
|
"include": "#number-hexadecimal"
|
|
},
|
|
{
|
|
"include": "#number-octal"
|
|
},
|
|
{
|
|
"name": "invalid.illegal.name.zener",
|
|
"match": "\\b[0-9]+\\w+"
|
|
}
|
|
]
|
|
},
|
|
"number-decimal": {
|
|
"name": "constant.numeric.decimal.zener",
|
|
"match": "(?<![\\w\\.])(?:[1-9][0-9]*|0+)\\b"
|
|
},
|
|
"number-hexadecimal": {
|
|
"name": "constant.numeric.hex.zener",
|
|
"match": "(?<![\\w\\.])0[xX][0-9a-fA-F]+\\b"
|
|
},
|
|
"number-octal": {
|
|
"name": "constant.numeric.octal.zener",
|
|
"match": "(?<![\\w\\.])0[oO][0-7]+\\b"
|
|
},
|
|
"string": {
|
|
"patterns": [
|
|
{
|
|
"include": "#string-raw-quoted-multi-line"
|
|
},
|
|
{
|
|
"include": "#string-raw-quoted-single-line"
|
|
},
|
|
{
|
|
"include": "#string-quoted-multi-line"
|
|
},
|
|
{
|
|
"include": "#string-quoted-single-line"
|
|
}
|
|
]
|
|
},
|
|
"string-raw-quoted-single-line": {
|
|
"name": "string.quoted.raw.single.zener",
|
|
"begin": "\\b(r)(['\"])",
|
|
"end": "(\\2)|((?<!\\\\)\\n)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "storage.type.string.zener"
|
|
},
|
|
"2": {
|
|
"name": "punctuation.definition.string.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.end.zener"
|
|
},
|
|
"2": {
|
|
"name": "invalid.illegal.newline.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#string-raw-content"
|
|
}
|
|
]
|
|
},
|
|
"string-quoted-single-line": {
|
|
"name": "string.quoted.single.zener",
|
|
"begin": "(['\"])",
|
|
"end": "(\\1)|((?<!\\\\)\\n)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.end.zener"
|
|
},
|
|
"2": {
|
|
"name": "invalid.illegal.newline.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#string-content"
|
|
}
|
|
]
|
|
},
|
|
"string-raw-quoted-multi-line": {
|
|
"name": "string.quoted.raw.multi.zener",
|
|
"begin": "\\b(r)('''|\"\"\")",
|
|
"end": "(\\2)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "storage.type.string.zener"
|
|
},
|
|
"2": {
|
|
"name": "punctuation.definition.string.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#string-raw-content"
|
|
}
|
|
]
|
|
},
|
|
"string-quoted-multi-line": {
|
|
"name": "string.quoted.multi.zener",
|
|
"begin": "('''|\"\"\")",
|
|
"end": "(\\1)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.string.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#string-content"
|
|
}
|
|
]
|
|
},
|
|
"string-content": {
|
|
"patterns": [
|
|
{
|
|
"include": "#string-escape-sequence"
|
|
},
|
|
{
|
|
"include": "#string-illegal-escape-sequence"
|
|
},
|
|
{
|
|
"include": "#discouraged-string-line-continuation"
|
|
},
|
|
{
|
|
"include": "#string-format-placeholder-percent"
|
|
},
|
|
{
|
|
"include": "#string-format-placeholder-braces"
|
|
}
|
|
]
|
|
},
|
|
"string-raw-content": {
|
|
"patterns": [
|
|
{
|
|
"include": "#string-consume-escape"
|
|
},
|
|
{
|
|
"include": "#string-format-placeholder-percent"
|
|
},
|
|
{
|
|
"include": "#string-format-placeholder-braces"
|
|
}
|
|
]
|
|
},
|
|
"string-consume-escape": {
|
|
"match": "\\\\['\"\\n\\\\]"
|
|
},
|
|
"string-escape-sequence": {
|
|
"name": "constant.character.escape.zener",
|
|
"match": "\\\\[\\\\\"'nrt]"
|
|
},
|
|
"string-illegal-escape-sequence": {
|
|
"name": "invalid.illegal.character.escape.zener",
|
|
"match": "\\\\[^\\\\\"'nrt]"
|
|
},
|
|
"string-format-placeholder-percent": {
|
|
"name": "constant.character.format.placeholder.other.zener",
|
|
"match": "%[drs%]"
|
|
},
|
|
"string-format-placeholder-braces": {
|
|
"patterns": [
|
|
{
|
|
"name": "constant.character.format.placeholder.other.zener",
|
|
"match": "\\{(?:[0-9]+|[[:alpha:]_][[:alnum:]_]*)?\\}"
|
|
}
|
|
]
|
|
},
|
|
"function-definition": {
|
|
"name": "meta.function.zener",
|
|
"begin": "\\s*\\b(def)\\s+(?=[[:alpha:]_][[:word:]]*\\s*\\()",
|
|
"end": "(:|(?=[#'\"\\n]))",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "storage.type.function.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.section.function.begin.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#function-definition-name"
|
|
},
|
|
{
|
|
"include": "#function-definition-parameters"
|
|
},
|
|
{
|
|
"include": "#line-continuation"
|
|
}
|
|
]
|
|
},
|
|
"function-definition-name": {
|
|
"patterns": [
|
|
{
|
|
"include": "#builtin-constant"
|
|
},
|
|
{
|
|
"include": "#illegal-name"
|
|
},
|
|
{
|
|
"include": "#builtin-function"
|
|
},
|
|
{
|
|
"name": "entity.name.function.zener",
|
|
"match": "\\b([[:alpha:]_]\\w*)\\b"
|
|
}
|
|
]
|
|
},
|
|
"function-definition-parameters": {
|
|
"name": "meta.function.parameters.zener",
|
|
"begin": "(\\()",
|
|
"end": "(\\))",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.parameters.begin.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.parameters.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.operator.unpacking.parameter.zener",
|
|
"match": "(\\*\\*|\\*)"
|
|
},
|
|
{
|
|
"include": "#illegal-name"
|
|
},
|
|
{
|
|
"include": "#builtin-constant"
|
|
},
|
|
{
|
|
"match": "([[:alpha:]_]\\w*)\\s*(?:(,)|(?=[)#\\n=]))",
|
|
"captures": {
|
|
"1": {
|
|
"name": "variable.parameter.zener"
|
|
},
|
|
"2": {
|
|
"name": "punctuation.separator.parameters.zener"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"include": "#line-comment"
|
|
},
|
|
{
|
|
"include": "#function-definition-parameter-default-value"
|
|
}
|
|
]
|
|
},
|
|
"function-definition-parameter-default-value": {
|
|
"begin": "(=)",
|
|
"end": "(,)|(?=\\))",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "keyword.operator.zener"
|
|
}
|
|
},
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.separator.parameters.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#expression"
|
|
}
|
|
]
|
|
},
|
|
"subscript-expression": {
|
|
"patterns": [
|
|
{
|
|
"name": "meta.item-access.zener",
|
|
"begin": "\\b(?=[[:alpha:]_]\\w*\\s*\\[)",
|
|
"end": "(\\])",
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.arguments.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#subscript-receiver"
|
|
},
|
|
{
|
|
"include": "#subscript-index"
|
|
},
|
|
{
|
|
"include": "#expression"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"subscript-receiver": {
|
|
"patterns": [
|
|
{
|
|
"include": "#builtin-function"
|
|
},
|
|
{
|
|
"include": "#constant-identifier"
|
|
},
|
|
{
|
|
"name": "variable.other.zener",
|
|
"match": "\\b([[:alpha:]_]\\w*)\\b"
|
|
}
|
|
]
|
|
},
|
|
"subscript-index": {
|
|
"begin": "(\\[)",
|
|
"end": "(?=\\])",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.arguments.begin.zener"
|
|
}
|
|
},
|
|
"contentName": "meta.item-access.arguments.zener",
|
|
"patterns": [
|
|
{
|
|
"include": "#expression"
|
|
}
|
|
]
|
|
},
|
|
"function-call": {
|
|
"name": "meta.function-call.zener",
|
|
"begin": "\\b(?=([[:alpha:]_]\\w*)\\s*(\\())",
|
|
"end": "(\\))",
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.arguments.end.zener"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#function-call-name"
|
|
},
|
|
{
|
|
"include": "#function-arguments"
|
|
}
|
|
]
|
|
},
|
|
"function-call-name": {
|
|
"patterns": [
|
|
{
|
|
"include": "#type-identifier"
|
|
},
|
|
{
|
|
"include": "#builtin-function"
|
|
},
|
|
{
|
|
"name": "entity.name.function.zener",
|
|
"match": "\\b([[:alpha:]_]\\w*)\\b"
|
|
}
|
|
]
|
|
},
|
|
"function-arguments": {
|
|
"begin": "(?:(\\()(?:\\s*(\\*\\*|\\*))?)",
|
|
"end": "(?=\\))(?!\\)\\s*\\()",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.arguments.begin.zener"
|
|
},
|
|
"2": {
|
|
"name": "keyword.operator.unpacking.arguments.zener"
|
|
}
|
|
},
|
|
"contentName": "meta.function-call.arguments.zener",
|
|
"patterns": [
|
|
{
|
|
"match": "(?:(,)(?:\\s*(\\*\\*|\\*))?)",
|
|
"captures": {
|
|
"1": {
|
|
"name": "punctuation.separator.arguments.zener"
|
|
},
|
|
"2": {
|
|
"name": "keyword.operator.unpacking.arguments.zener"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"include": "#illegal-name"
|
|
},
|
|
{
|
|
"match": "\\b([[:alpha:]_]\\w*)\\s*(=)(?!=)",
|
|
"captures": {
|
|
"1": {
|
|
"name": "meta.parameter.keyword.zener"
|
|
},
|
|
"2": {
|
|
"name": "keyword.operator.assignment.zener"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword.operator.assignment.zener",
|
|
"match": "=(?!=)"
|
|
},
|
|
{
|
|
"include": "#expression"
|
|
},
|
|
{
|
|
"match": "\\s*(\\))\\s*(\\()",
|
|
"captures": {
|
|
"1": {
|
|
"name": "punctuation.definition.arguments.end.zener"
|
|
},
|
|
"2": {
|
|
"name": "punctuation.definition.arguments.begin.zener"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"builtin-function": {
|
|
"patterns": [
|
|
{
|
|
"name": "support.function.zener",
|
|
"match": "(?<!\\.)\\b(all|any|bool|dict|dir|enumerate|getattr|hasattr|hash|int|len|list|load|max|min|print|range|repr|reversed|sorted|str|tuple|type|zip)\\b"
|
|
}
|
|
]
|
|
},
|
|
"builtin-constant": {
|
|
"name": "keyword.illegal.name.zener",
|
|
"match": "\\b(True|False|None)\\b"
|
|
},
|
|
"illegal-name": {
|
|
"name": "keyword.control.flow.zener",
|
|
"match": "\\b(and|as|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|load|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b"
|
|
},
|
|
"illegal-operator": {
|
|
"patterns": [
|
|
{
|
|
"name": "invalid.illegal.operator.zener",
|
|
"match": "&&|\\|\\||--|\\+\\+"
|
|
},
|
|
{
|
|
"name": "invalid.illegal.operator.zener",
|
|
"match": "[?$]"
|
|
},
|
|
{
|
|
"name": "invalid.illegal.operator.zener",
|
|
"match": "!\\b"
|
|
}
|
|
]
|
|
},
|
|
"line-comment": {
|
|
"name": "comment.line.number-sign.zener",
|
|
"begin": "(\\#)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.comment.zener"
|
|
}
|
|
},
|
|
"end": "($)",
|
|
"patterns": [
|
|
{
|
|
"include": "#code-tag"
|
|
}
|
|
]
|
|
},
|
|
"code-tag": {
|
|
"match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)",
|
|
"captures": {
|
|
"1": {
|
|
"name": "keyword.codetag.notation.zener"
|
|
}
|
|
}
|
|
},
|
|
"discouraged-semicolon": {
|
|
"patterns": [
|
|
{
|
|
"name": "invalid.deprecated.semicolon.zener",
|
|
"match": "\\;$"
|
|
}
|
|
]
|
|
},
|
|
"discouraged-string-line-continuation": {
|
|
"name": "invalid.deprecated.language.zener",
|
|
"match": "\\\\$"
|
|
}
|
|
}
|
|
}
|