mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 19:00:02 -04:00
refactor: pull out predicate function
This commit is contained in:
parent
59f5d64a61
commit
5f2c6c0c83
1 changed files with 9 additions and 11 deletions
|
|
@ -145,18 +145,16 @@ local function get_compile_location(repo, cache_dir, project_name, from_local_pa
|
||||||
return fs.joinpath(cache_dir, repo_location)
|
return fs.joinpath(cache_dir, repo_location)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function istring(c)
|
||||||
|
return type(c) == 'string'
|
||||||
|
end
|
||||||
|
|
||||||
local function cc_err()
|
local function cc_err()
|
||||||
log.error('No C compiler found! "' .. table.concat(
|
log.error(
|
||||||
vim.iter.filter(
|
'No C compiler found! "'
|
||||||
---@param c string
|
.. table.concat(vim.iter.filter(istring, M.compilers), '", "')
|
||||||
---@return boolean
|
.. '" are not executable.'
|
||||||
function(c)
|
)
|
||||||
return type(c) == 'string'
|
|
||||||
end,
|
|
||||||
M.compilers
|
|
||||||
),
|
|
||||||
'", "'
|
|
||||||
) .. '" are not executable.')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param x string
|
--- @param x string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue