mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-18 01:39:00 +00:00
Set CXX standard per parser and fix Norg
This commit is contained in:
@@ -213,7 +213,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||
- [ ] [markdown](https://github.com/MDeiml/tree-sitter-markdown)
|
||||
- [x] [ninja](https://github.com/alemuller/tree-sitter-ninja) (maintained by @alemuller)
|
||||
- [x] [nix](https://github.com/cstrahan/tree-sitter-nix) (maintained by @leo60228)
|
||||
- [x] [norg](https://github.com/vhyrro/tree-sitter-norg) (maintained by @JoeyGrajciar, @vhyrro)
|
||||
- [x] [norg](https://github.com/nvim-neorg/tree-sitter-norg) (maintained by @JoeyGrajciar, @vhyrro, @mrossinek)
|
||||
- [x] [ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) (maintained by @undu)
|
||||
- [x] [ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) (maintained by @undu)
|
||||
- [x] [ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) (maintained by @undu)
|
||||
|
||||
@@ -893,12 +893,13 @@ list.hack = {
|
||||
|
||||
list.norg = {
|
||||
install_info = {
|
||||
url = "https://github.com/vhyrro/tree-sitter-norg",
|
||||
url = "https://github.com/nvim-neorg/tree-sitter-norg",
|
||||
branch = "main",
|
||||
files = { "src/parser.c", "src/scanner.cc" },
|
||||
use_makefile = true,
|
||||
cxx_standard = "c++14",
|
||||
},
|
||||
maintainers = { "@JoeyGrajciar", "@vhyrro" },
|
||||
maintainers = { "@JoeyGrajciar", "@vhyrro", "@mrossinek" },
|
||||
}
|
||||
|
||||
local M = {
|
||||
|
||||
@@ -94,7 +94,7 @@ function M.select_compiler_args(repo, compiler)
|
||||
end
|
||||
|
||||
function M.select_compile_command(repo, cc, compile_location)
|
||||
if string.match(cc, "cl$") or string.match(cc, "cl.exe$") or not repo.use_makefile then
|
||||
if string.match(cc, "cl$") or string.match(cc, "cl.exe$") or not repo.use_makefile or fn.has "win32" == 1 then
|
||||
return {
|
||||
cmd = cc,
|
||||
info = "Compiling...",
|
||||
@@ -110,7 +110,11 @@ function M.select_compile_command(repo, cc, compile_location)
|
||||
info = "Compiling...",
|
||||
err = "Error during compilation",
|
||||
opts = {
|
||||
args = { "--makefile=" .. utils.join_path(utils.get_package_path(), "scripts", "compile_parsers.makefile"), "CC=" .. cc },
|
||||
args = {
|
||||
"--makefile=" .. utils.join_path(utils.get_package_path(), "scripts", "compile_parsers.makefile"),
|
||||
"CC=" .. cc,
|
||||
"CXX_STANDARD=" .. repo.cxx_standard,
|
||||
},
|
||||
cwd = compile_location,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
# Stephan Seitz, 2021-09-09 21:36
|
||||
#
|
||||
CC?=cc
|
||||
CXX_STANDARD?=c++14
|
||||
C_STANDARD?=c99
|
||||
|
||||
all: parser.so
|
||||
|
||||
parser.o: src/parser.c
|
||||
$(CC) -c src/parser.c -std=c99 -fPIC -I./src
|
||||
$(CC) -c src/parser.c -std=$(C_STANDARD) -fPIC -I./src
|
||||
|
||||
scanner.o: src/scanner.cc
|
||||
$(CC) -c src/scanner.cc -std=c++17 -fPIC -I./src
|
||||
$(CC) -c src/scanner.cc -std=$(CXX_STANDARD) -fPIC -I./src
|
||||
|
||||
parser.so: parser.o scanner.o
|
||||
$(CC) parser.o scanner.o -o parser.so -shared -Os -lstdc++
|
||||
|
||||
Reference in New Issue
Block a user