diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2025-12-05 15:32:28 +0100 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-12-06 11:16:30 +0100 |
| commit | e0eec76dad852814e5972aa66ec2dc98d03525a8 (patch) | |
| tree | 156216442bb1930c5c5190d17eeeff378489d660 /scripts/update-parsers.lua | |
| parent | feat(angular): add style_unit highlighting(#8312) (diff) | |
| download | nvim-treesitter-e0eec76dad852814e5972aa66ec2dc98d03525a8.tar nvim-treesitter-e0eec76dad852814e5972aa66ec2dc98d03525a8.tar.gz nvim-treesitter-e0eec76dad852814e5972aa66ec2dc98d03525a8.tar.bz2 nvim-treesitter-e0eec76dad852814e5972aa66ec2dc98d03525a8.tar.lz nvim-treesitter-e0eec76dad852814e5972aa66ec2dc98d03525a8.tar.xz nvim-treesitter-e0eec76dad852814e5972aa66ec2dc98d03525a8.tar.zst nvim-treesitter-e0eec76dad852814e5972aa66ec2dc98d03525a8.zip | |
fix(lua): fix some emmyluals warnings
Diffstat (limited to 'scripts/update-parsers.lua')
| -rwxr-xr-x | scripts/update-parsers.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/update-parsers.lua b/scripts/update-parsers.lua index 83f724970..bab572c27 100755 --- a/scripts/update-parsers.lua +++ b/scripts/update-parsers.lua @@ -6,7 +6,7 @@ -- nvim -l update-parsers.lua --tier=1 # update stable parsers to latest version -- nvim -l update-parsers.lua --tier=2 # update unstable parsers to latest commit -local tier = nil ---@type integer? +local tier = nil ---@type number? for i = 1, #_G.arg do if _G.arg[i]:find('^%-%-tier=') then tier = tonumber(_G.arg[i]:match('=(%d+)')) @@ -41,15 +41,15 @@ for k, p in pairs(parsers) do if #vim.tbl_keys(jobs) % 100 == 0 or next(parsers, k) == nil then for name, job in pairs(jobs) do - local stdout = vim.split(job:wait().stdout, '\n') + local stdout = vim.split(job:wait().stdout or '', '\n') jobs[name] = nil - local info = parsers[name].install_info - assert(info) + assert(parsers[name]) + local info = assert(parsers[name].install_info) - local sha ---@type string + local sha ---@type string? if parsers[name].tier == 1 then - sha = stdout[#stdout - 1]:match('v[%d%.]+$') + sha = stdout[#stdout - 1] and stdout[#stdout - 1]:match('v[%d%.]+$') else local branch = info.branch local line = 1 @@ -61,10 +61,10 @@ for k, p in pairs(parsers) do end end end - sha = vim.split(stdout[line], '\t')[1] + sha = stdout[line] and vim.split(stdout[line], '\t')[1] end - if info.revision ~= sha then + if sha and info.revision ~= sha then info.revision = sha updates[#updates + 1] = name end |
