aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authormaxxnino <34153891+maxxnino@users.noreply.github.com>2021-10-21 14:04:36 +0900
committerStephan Seitz <stephan.seitz@fau.de>2021-10-21 22:10:55 +0200
commite3e43c479ec5d8c4c1382e12c03ed88030dbd368 (patch)
treeb99d96beb42392398f14a70f77d57685ccf21e1c /lua
parentHighlight zig add missing AssignOp (diff)
downloadnvim-treesitter-e3e43c479ec5d8c4c1382e12c03ed88030dbd368.tar
nvim-treesitter-e3e43c479ec5d8c4c1382e12c03ed88030dbd368.tar.gz
nvim-treesitter-e3e43c479ec5d8c4c1382e12c03ed88030dbd368.tar.bz2
nvim-treesitter-e3e43c479ec5d8c4c1382e12c03ed88030dbd368.tar.lz
nvim-treesitter-e3e43c479ec5d8c4c1382e12c03ed88030dbd368.tar.xz
nvim-treesitter-e3e43c479ec5d8c4c1382e12c03ed88030dbd368.tar.zst
nvim-treesitter-e3e43c479ec5d8c4c1382e12c03ed88030dbd368.zip
Add zig as compiler for parser
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/install.lua2
-rw-r--r--lua/nvim-treesitter/shell_command_selectors.lua11
2 files changed, 12 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 0015a2de3..936f36530 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -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 = {}
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua
index 7acd91d2f..ee784312c 100644
--- a/lua/nvim-treesitter/shell_command_selectors.lua
+++ b/lua/nvim-treesitter/shell_command_selectors.lua
@@ -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",