Workaround 0.19.2 crash

This commit is contained in:
Ganesh Viswanathan 2019-01-16 21:49:17 -06:00
commit ab3543cbda
4 changed files with 7 additions and 6 deletions

View file

@ -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"

View file

@ -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

View file

@ -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.}

View file

@ -1 +0,0 @@
switch("d", "NIMTEROP")