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 macros, os, strformat, strutils
import "."/globals const CIMPORT = 1
include "."/globals
proc interpPath(dir: string): string= proc interpPath(dir: string): string=
# TODO: more robust: needs a DirSep after "$projpath" # TODO: more robust: needs a DirSep after "$projpath"

View file

@ -2,7 +2,7 @@ import tables
import regex import regex
when defined(NIMTEROP): when not defined(CIMPORT):
import "."/treesitter/runtime import "."/treesitter/runtime
type type
@ -17,7 +17,7 @@ type
name*: string name*: string
kind*: Kind kind*: Kind
children*: seq[ref Ast] children*: seq[ref Ast]
when defined(NIMTEROP): when not defined(CIMPORT):
tonim*: proc (ast: ref Ast, node: TSNode) tonim*: proc (ast: ref Ast, node: TSNode)
regex*: Regex regex*: Regex
@ -33,7 +33,7 @@ type
ast*: Table[string, seq[ref Ast]] ast*: Table[string, seq[ref Ast]]
data*: seq[tuple[name, val: string]] 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.}]] grammar*: seq[tuple[grammar: string, call: proc(ast: ref Ast, node: TSNode) {.nimcall.}]]
var var

View file

@ -2,7 +2,7 @@
import strutils 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: "-std=c11 -DUTF8PROC_STATIC".}
{.passC: "-I$1/include" % sourcePath.} {.passC: "-I$1/include" % sourcePath.}

View file

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