summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/proto/diagnostic.lua22
1 files changed, 12 insertions, 10 deletions
diff --git a/script/proto/diagnostic.lua b/script/proto/diagnostic.lua
index 9b0303cc..f6645e89 100644
--- a/script/proto/diagnostic.lua
+++ b/script/proto/diagnostic.lua
@@ -244,18 +244,20 @@ function m.getDiagAndErrNameMap()
for name in pairs(m.getDefaultSeverity()) do
names[name] = true
end
- local path = package.searchpath('parser.compile', package.path)
- if path then
- local f = io.open(path)
- if f then
- for line in f:lines() do
- local name = line:match([=[type%s*=%s*['"](%u[%u_]+%u)['"]]=])
- if name then
- local id = name:lower():gsub('_', '-')
- names[id] = true
+ for _, fileName in ipairs {'parser.compile', 'parser.luadoc'} do
+ local path = package.searchpath(fileName, package.path)
+ if path then
+ local f = io.open(path)
+ if f then
+ for line in f:lines() do
+ local name = line:match([=[type%s*=%s*['"](%u[%u_]+%u)['"]]=])
+ if name then
+ local id = name:lower():gsub('_', '-')
+ names[id] = true
+ end
end
+ f:close()
end
- f:close()
end
end
table.sort(names)