update Lua-grammar (#167692)

This commit is contained in:
最萌小汐
2022-12-02 23:12:07 +08:00
committed by GitHub
parent 041f4cd3bc
commit 930fd0e469
2 changed files with 105 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/sumneko/lua.tmbundle/commit/bc74f9230c3f07c0ecc1bc1727ad98d9e70aff5b",
"version": "https://github.com/sumneko/lua.tmbundle/commit/57be7c5cf8fa173f5f39806822725e503932ab45",
"name": "Lua",
"scopeName": "source.lua",
"patterns": [
@@ -187,13 +187,17 @@
"name": "entity.name.class.lua"
},
{
"match": "(?<=[^.]\\.|:)\\b([a-zA-Z_][a-zA-Z0-9_]*)",
"match": "(?<=[^.]\\.|:)\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?!\\s*=\\s*\\b(function)\\b)",
"name": "entity.other.attribute.lua"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?!\\s*=\\s*\\b(function)\\b)",
"name": "variable.other.lua"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*=\\s*\\b(function)\\b)",
"name": "entity.name.function.lua"
},
{
"match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|!=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)",
"name": "keyword.operator.lua"
@@ -434,6 +438,26 @@
}
]
},
{
"begin": "(?<=---\\s*)@enum",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.lua"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
"beginCaptures": {
"0": {
"name": "variable.lua"
}
},
"end": "(?=\\n)"
}
]
},
{
"begin": "(?<=---\\s*)@type",
"beginCaptures": {
@@ -464,10 +488,56 @@
"name": "variable.lua"
}
},
"end": "(?=[\\n#])",
"patterns": [
{
"include": "#luadoc.type"
}
]
}
]
},
{
"begin": "(?<=---\\s*)(@operator)\\s*(\\b[a-z]+)?",
"beginCaptures": {
"1": {
"name": "storage.type.annotation.lua"
},
"2": {
"name": "support.function.library.lua"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"include": "#luadoc.type"
}
]
},
{
"begin": "(?<=---\\s*)@cast",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.lua"
}
},
"end": "(?=[\\n@#])",
"patterns": [
{
"begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
"beginCaptures": {
"0": {
"name": "variable.other.lua"
}
},
"end": "(?=\\n)",
"patterns": [
{
"include": "#luadoc.type"
},
{
"match": "([+-|])",
"name": "keyword.operator.lua"
}
]
}
@@ -492,7 +562,7 @@
"name": "keyword.operator.lua"
}
},
"end": "(?=\\n)",
"end": "(?=[\\n#])",
"patterns": [
{
"include": "#luadoc.type"
@@ -538,7 +608,7 @@
"name": "keyword.operator.lua"
}
},
"end": "(?=\\n)",
"end": "(?=[\\n#])",
"patterns": [
{
"include": "#string"
@@ -634,6 +704,33 @@
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---\\s*)@private",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.lua"
}
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---\\s*)@protected",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.lua"
}
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---\\s*)@package",
"beginCaptures": {
"0": {
"name": "storage.type.annotation.lua"
}
},
"end": "(?=[\\n@#])"
},
{
"begin": "(?<=---\\s*)@version",
"beginCaptures": {
@@ -748,7 +845,7 @@
"name": "keyword.control.lua"
}
},
"end": "(?=\\s)",
"end": "(?=[\\s#])",
"patterns": [
{
"match": "[\\(\\),:\\?][ \\t]*",
@@ -780,7 +877,7 @@
},
{
"begin": "(?=[a-zA-Z_\\.\\*\"'\\[])",
"end": "(?=[\\s\\)\\,\\?\\:\\}\\|])",
"end": "(?=[\\s\\)\\,\\?\\:\\}\\|#])",
"patterns": [
{
"match": "([a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]+)(?<!,)[ \\t]*",