summaryrefslogtreecommitdiff
path: root/src/matcher
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-10-11 13:46:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-10-11 13:46:55 +0800
commit16af212c379e9927143b37bedebcf884445bfdbd (patch)
tree14d3081d3c719b63a750d283738a3ec1e5b3085e /src/matcher
parent6ca08827d3e4e509841ffad2a57f179348ef65c6 (diff)
downloadlua-language-server-16af212c379e9927143b37bedebcf884445bfdbd.zip
until
Diffstat (limited to 'src/matcher')
-rw-r--r--src/matcher/definition.lua30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/matcher/definition.lua b/src/matcher/definition.lua
index 91b5090f..8656892a 100644
--- a/src/matcher/definition.lua
+++ b/src/matcher/definition.lua
@@ -49,12 +49,16 @@ function defs.Name(p, str)
return {str, p}
end
-function defs.LocalVar(name)
- scopeSet(name)
+function defs.LocalVar(names)
+ for _, name in ipairs(names) do
+ scopeSet(name)
+ end
end
-function defs.LocalSet(name)
- scopeSet(name)
+function defs.LocalSet(names)
+ for _, name in ipairs(names) do
+ scopeSet(name)
+ end
end
function defs.Function(func)
@@ -110,7 +114,7 @@ function defs.LoopStart(name, exp)
return name
end
-function defs.InList(...)
+function defs.NameList(...)
return {...}
end
@@ -125,6 +129,22 @@ function defs.In()
scopePop()
end
+function defs.WhileDef()
+ scopePush()
+end
+
+function defs.While()
+ scopePop()
+end
+
+function defs.RepeatDef()
+ scopePush()
+end
+
+function defs.Until()
+ scopePop()
+end
+
return function (buf, pos_)
pos = pos_
result = nil