summaryrefslogtreecommitdiff
path: root/server/src/parser/ast.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/parser/ast.lua')
-rw-r--r--server/src/parser/ast.lua40
1 files changed, 29 insertions, 11 deletions
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua
index fac276b8..130f497c 100644
--- a/server/src/parser/ast.lua
+++ b/server/src/parser/ast.lua
@@ -836,21 +836,39 @@ local Defs = {
keys, values,
}
end,
- Local = function (tag, keys, values)
- if tag and State.Version ~= 'Lua 5.4' then
- pushError {
- type = 'UNSUPPORT_SYMBOL',
- start = tag.start,
- finish = tag.finish,
- version = 'Lua 5.4',
- info = {
- version = State.Version,
+ LocalTag = function (...)
+ if not ... or ... == '' then
+ return nil
+ end
+ local tags = {...}
+ for _, tag in ipairs(tags) do
+ if State.Version ~= 'Lua 5.4' then
+ pushError {
+ type = 'UNSUPPORT_SYMBOL',
+ start = tag.start,
+ finish = tag.finish,
+ version = 'Lua 5.4',
+ info = {
+ version = State.Version,
+ }
}
- }
+ elseif tag[1] ~= 'const' and tag[1] ~= 'toclose' then
+ pushError {
+ type = 'UNKNOWN_TAG',
+ start = tag.start,
+ finish = tag.finish,
+ info = {
+ tag = tag[1],
+ }
+ }
+ end
end
+ return tags
+ end,
+ Local = function (tags, keys, values)
return {
type = 'local',
- keys, values, tag
+ keys, values, tags
}
end,
DoBody = function (...)