mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 13:00:08 -04:00
Add zig as compiler for parser
This commit is contained in:
parent
47a9e6dda9
commit
e3e43c479e
2 changed files with 12 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ local shell = require "nvim-treesitter.shell_command_selectors"
|
|||
local M = {}
|
||||
local lockfile = {}
|
||||
|
||||
M.compilers = { vim.fn.getenv "CC", "cc", "gcc", "clang", "cl" }
|
||||
M.compilers = { vim.fn.getenv "CC", "cc", "gcc", "clang", "cl", "zig" }
|
||||
M.prefer_git = fn.has "win32" == 1
|
||||
M.command_extra_args = {}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,17 @@ function M.select_compiler_args(repo, compiler)
|
|||
"-Os",
|
||||
"/LD",
|
||||
}
|
||||
elseif string.match(compiler, "zig$") or string.match(compiler, "zig.exe$") then
|
||||
return {
|
||||
"c++",
|
||||
"-o",
|
||||
"parser.so",
|
||||
repo.files,
|
||||
"-lc",
|
||||
"-Isrc",
|
||||
"-shared",
|
||||
"-Os",
|
||||
}
|
||||
else
|
||||
local args = {
|
||||
"-o",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue