summaryrefslogtreecommitdiff
path: root/server/src/parser/ast.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-06-26 20:52:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-06-26 20:52:59 +0800
commiteb4cc1e5915a2ac0fceaa4f6b08f7f0f762d3fb6 (patch)
tree82ef5a990f3b43b51d03785558398a97ba3aa46f /server/src/parser/ast.lua
parentf92a71db462b2769eea194143f15ab090b665862 (diff)
downloadlua-language-server-eb4cc1e5915a2ac0fceaa4f6b08f7f0f762d3fb6.zip
用option来实现一些私有功能
Diffstat (limited to 'server/src/parser/ast.lua')
-rw-r--r--server/src/parser/ast.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua
index 9903dca2..0e408c73 100644
--- a/server/src/parser/ast.lua
+++ b/server/src/parser/ast.lua
@@ -1233,9 +1233,23 @@ local Defs = {
...
}
end,
- EmmyParam = function (argName, emmyName, ...)
+ EmmyParam = function (argName, emmyName, options, ...)
+ local option
+ if options then
+ option = {}
+ for _, pair in ipairs(options) do
+ if pair.type == 'pair' then
+ local key = pair[1]
+ local value = pair[2]
+ if key.type == 'name' then
+ option[key[1]] = value[1]
+ end
+ end
+ end
+ end
local emmy = {
type = 'emmyParam',
+ option = option,
argName,
emmyName,
...