fix(gen_vimdoc): unnecessary assert for non-source files

Problem:  The presence of non-source files breaks `make doc`.
Solution: Replace assert with if statement to skip non-matching files.
This commit is contained in:
Luuk van Baal
2025-04-20 11:10:54 +02:00
committed by luukvbaal
parent d3cded796c
commit 4b02d1f6f6

View File

@@ -983,11 +983,13 @@ local function gen_target(cfg)
--- First pass so we can collect all classes
for _, f in vim.spairs(cfg.files) do
local ext = assert(f:match('%.([^.]+)$')) --[[@as 'h'|'c'|'lua']]
local parser = assert(parsers[ext])
local classes, funs, briefs = parser(f)
file_results[f] = { classes, funs, briefs }
all_classes = vim.tbl_extend('error', all_classes, classes)
local ext = f:match('%.([^.]+)$')
local parser = parsers[ext]
if parser then
local classes, funs, briefs = parser(f)
file_results[f] = { classes, funs, briefs }
all_classes = vim.tbl_extend('error', all_classes, classes)
end
end
for f, r in vim.spairs(file_results) do