Workaround 0.19.2 crash
This commit is contained in:
parent
0e3588d258
commit
ab3543cbda
4 changed files with 7 additions and 6 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import macros, os, strformat, strutils
|
||||
|
||||
import "."/globals
|
||||
const CIMPORT = 1
|
||||
|
||||
include "."/globals
|
||||
|
||||
proc interpPath(dir: string): string=
|
||||
# TODO: more robust: needs a DirSep after "$projpath"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import tables
|
|||
|
||||
import regex
|
||||
|
||||
when defined(NIMTEROP):
|
||||
when not defined(CIMPORT):
|
||||
import "."/treesitter/runtime
|
||||
|
||||
type
|
||||
|
|
@ -17,7 +17,7 @@ type
|
|||
name*: string
|
||||
kind*: Kind
|
||||
children*: seq[ref Ast]
|
||||
when defined(NIMTEROP):
|
||||
when not defined(CIMPORT):
|
||||
tonim*: proc (ast: ref Ast, node: TSNode)
|
||||
regex*: Regex
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ type
|
|||
|
||||
ast*: Table[string, seq[ref Ast]]
|
||||
data*: seq[tuple[name, val: string]]
|
||||
when defined(NIMTEROP):
|
||||
when not defined(CIMPORT):
|
||||
grammar*: seq[tuple[grammar: string, call: proc(ast: ref Ast, node: TSNode) {.nimcall.}]]
|
||||
|
||||
var
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import strutils
|
||||
|
||||
const sourcePath = currentSourcePath().split({'\\', '/'})[0..^4].join("/") & "/inc/treesitter"
|
||||
const sourcePath = currentSourcePath().split({'\\', '/'})[0..^4].join("/") & "/inc/treesitter"
|
||||
|
||||
{.passC: "-std=c11 -DUTF8PROC_STATIC".}
|
||||
{.passC: "-I$1/include" % sourcePath.}
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
switch("d", "NIMTEROP")
|
||||
Loading…
Add table
Add a link
Reference in a new issue