Fix source paths
This commit is contained in:
parent
d2bd1f7dad
commit
0e3588d258
3 changed files with 17 additions and 7 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
|
import strutils
|
||||||
|
|
||||||
import "."/runtime
|
import "."/runtime
|
||||||
|
|
||||||
{.compile: ("../../inc/treesitter_c/src/parser.c", "parserc.o").}
|
{.compile: ("../../inc/treesitter_c/src/parser.c", "parserc.o").}
|
||||||
|
|
||||||
proc treeSitterC*(): ptr TSLanguage {.importc: "tree_sitter_c", header: "inc/treesitter_c/src/parser.h".}
|
const sourcePath = currentSourcePath().split({'\\', '/'})[0..^4].join("/")
|
||||||
|
proc treeSitterC*(): ptr TSLanguage {.importc: "tree_sitter_c", header: sourcePath & "/inc/treesitter_c/src/parser.h".}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
|
import strutils
|
||||||
|
|
||||||
import "."/runtime
|
import "."/runtime
|
||||||
|
|
||||||
{.compile: ("../../inc/treesitter_cpp/src/parser.c", "parsercpp.o").}
|
{.compile: ("../../inc/treesitter_cpp/src/parser.c", "parsercpp.o").}
|
||||||
{.compile: ("../../inc/treesitter_cpp/src/scanner.cc", "scannercpp.o").}
|
{.compile: ("../../inc/treesitter_cpp/src/scanner.cc", "scannercpp.o").}
|
||||||
|
|
||||||
proc treeSitterCpp*(): ptr TSLanguage {.importc: "tree_sitter_cpp", header: "inc/treesitter_cpp/src/parser.h".}
|
const sourcePath = currentSourcePath().split({'\\', '/'})[0..^4].join("/") & "/inc/treesitter_cpp/src/"
|
||||||
|
proc treeSitterCpp*(): ptr TSLanguage {.importc: "tree_sitter_cpp", header: sourcePath & "parser.h".}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
{.experimental: "codeReordering".}
|
{.experimental: "codeReordering".}
|
||||||
|
|
||||||
|
import strutils
|
||||||
|
|
||||||
|
const sourcePath = currentSourcePath().split({'\\', '/'})[0..^4].join("/") & "/inc/treesitter"
|
||||||
|
|
||||||
{.passC: "-std=c11 -DUTF8PROC_STATIC".}
|
{.passC: "-std=c11 -DUTF8PROC_STATIC".}
|
||||||
{.passC: "-Iinc/treesitter/include".}
|
{.passC: "-I$1/include" % sourcePath.}
|
||||||
{.passC: "-Iinc/treesitter/src".}
|
{.passC: "-I$1/src" % sourcePath.}
|
||||||
{.passC: "-Iinc/utf8proc".}
|
{.passC: "-I$1/../utf8proc" % sourcePath.}
|
||||||
{.compile: "../../inc/treesitter/src/runtime/runtime.c".}
|
{.compile: sourcePath & "/src/runtime/runtime.c".}
|
||||||
|
|
||||||
type TSInputEncoding* = distinct int
|
type TSInputEncoding* = distinct int
|
||||||
converter enumToInt(en: TSInputEncoding): int {.used.} = en.int
|
converter enumToInt(en: TSInputEncoding): int {.used.} = en.int
|
||||||
|
|
@ -16,7 +20,7 @@ type TSLogType* = distinct int
|
||||||
converter enumToInt(en: TSLogType): int {.used.} = en.int
|
converter enumToInt(en: TSLogType): int {.used.} = en.int
|
||||||
|
|
||||||
const
|
const
|
||||||
headerruntime = "inc/treesitter/include/tree_sitter/runtime.h"
|
headerruntime = sourcePath & "/include/tree_sitter/runtime.h"
|
||||||
TREE_SITTER_LANGUAGE_VERSION* = 9
|
TREE_SITTER_LANGUAGE_VERSION* = 9
|
||||||
TSInputEncodingUTF8* = 0.TSInputEncoding
|
TSInputEncodingUTF8* = 0.TSInputEncoding
|
||||||
TSInputEncodingUTF16* = 1.TSInputEncoding
|
TSInputEncodingUTF16* = 1.TSInputEncoding
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue