Fix nimble install
This commit is contained in:
parent
4883780f8f
commit
3d9cf10f8a
1 changed files with 6 additions and 4 deletions
|
|
@ -2,6 +2,8 @@ import os, strutils
|
|||
|
||||
import "."/git
|
||||
|
||||
const sourcePath = currentSourcePath().split({'\\', '/'})[0..^3].join("/") & "/inc"
|
||||
|
||||
proc treesitterSetup*() =
|
||||
gitPull("https://github.com/tree-sitter/tree-sitter/", "inc/treesitter", """
|
||||
include/*
|
||||
|
|
@ -14,7 +16,7 @@ src/runtime/*
|
|||
""")
|
||||
|
||||
let
|
||||
stack = "inc/treesitter/src/runtime/stack.c"
|
||||
stack = sourcePath & "/treesitter/src/runtime/stack.c"
|
||||
|
||||
stack.writeFile(stack.readFile().replace("inline Stack", "Stack"))
|
||||
|
||||
|
|
@ -26,7 +28,7 @@ src/*.cc
|
|||
""")
|
||||
|
||||
let
|
||||
headerc = "inc/treesitter_c/src/parser.h"
|
||||
headerc = sourcePath & "/treesitter_c/src/parser.h"
|
||||
|
||||
headerc.writeFile("""
|
||||
typedef struct TSLanguage TSLanguage;
|
||||
|
|
@ -41,9 +43,9 @@ src/*.cc
|
|||
""")
|
||||
|
||||
let
|
||||
headercpp = "inc/treesitter_cpp/src/parser.h"
|
||||
headercpp = sourcePath & "/treesitter_cpp/src/parser.h"
|
||||
|
||||
headercpp.writeFile("""
|
||||
typedef struct TSLanguage TSLanguage;
|
||||
const TSLanguage *tree_sitter_cpp();
|
||||
""")
|
||||
""")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue