update Lua-grammar (#167692)

This commit is contained in:
最萌小汐 2022-12-02 23:12:07 +08:00 committed by GitHub
parent 041f4cd3bc
commit 930fd0e469
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 105 additions and 8 deletions

View file

@ -6,7 +6,7 @@
"git": { "git": {
"name": "sumneko/lua.tmbundle", "name": "sumneko/lua.tmbundle",
"repositoryUrl": "https://github.com/sumneko/lua.tmbundle", "repositoryUrl": "https://github.com/sumneko/lua.tmbundle",
"commitHash": "bc74f9230c3f07c0ecc1bc1727ad98d9e70aff5b" "commitHash": "57be7c5cf8fa173f5f39806822725e503932ab45"
} }
}, },
"licenseDetail": [ "licenseDetail": [

View file

@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.", "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." "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", "name": "Lua",
"scopeName": "source.lua", "scopeName": "source.lua",
"patterns": [ "patterns": [
@ -187,13 +187,17 @@
"name": "entity.name.class.lua" "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" "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" "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}(?!\\.)", "match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|!=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)",
"name": "keyword.operator.lua" "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", "begin": "(?<=---\\s*)@type",
"beginCaptures": { "beginCaptures": {
@ -464,10 +488,56 @@
"name": "variable.lua" "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)", "end": "(?=\\n)",
"patterns": [ "patterns": [
{ {
"include": "#luadoc.type" "include": "#luadoc.type"
},
{
"match": "([+-|])",
"name": "keyword.operator.lua"
} }
] ]
} }
@ -492,7 +562,7 @@
"name": "keyword.operator.lua" "name": "keyword.operator.lua"
} }
}, },
"end": "(?=\\n)", "end": "(?=[\\n#])",
"patterns": [ "patterns": [
{ {
"include": "#luadoc.type" "include": "#luadoc.type"
@ -538,7 +608,7 @@
"name": "keyword.operator.lua" "name": "keyword.operator.lua"
} }
}, },
"end": "(?=\\n)", "end": "(?=[\\n#])",
"patterns": [ "patterns": [
{ {
"include": "#string" "include": "#string"
@ -634,6 +704,33 @@
}, },
"end": "(?=[\\n@#])" "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", "begin": "(?<=---\\s*)@version",
"beginCaptures": { "beginCaptures": {
@ -748,7 +845,7 @@
"name": "keyword.control.lua" "name": "keyword.control.lua"
} }
}, },
"end": "(?=\\s)", "end": "(?=[\\s#])",
"patterns": [ "patterns": [
{ {
"match": "[\\(\\),:\\?][ \\t]*", "match": "[\\(\\),:\\?][ \\t]*",
@ -780,7 +877,7 @@
}, },
{ {
"begin": "(?=[a-zA-Z_\\.\\*\"'\\[])", "begin": "(?=[a-zA-Z_\\.\\*\"'\\[])",
"end": "(?=[\\s\\)\\,\\?\\:\\}\\|])", "end": "(?=[\\s\\)\\,\\?\\:\\}\\|#])",
"patterns": [ "patterns": [
{ {
"match": "([a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]+)(?<!,)[ \\t]*", "match": "([a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]+)(?<!,)[ \\t]*",