From d21ec6287be4882d14332c14bb302b50f1296c22 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Mon, 6 May 2019 23:45:25 -0500 Subject: [PATCH] Fix enum identifier or'd, add configure support --- nimterop/ast.nim | 4 ++-- nimterop/git.nim | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/nimterop/ast.nim b/nimterop/ast.nim index 0d96dfd..c66d504 100644 --- a/nimterop/ast.nim +++ b/nimterop/ast.nim @@ -13,7 +13,7 @@ proc saveNodeData(node: TSNode, nimState: NimState): bool = if name == "primitive_type" and node.tsNodeParent.tsNodeType() == "sized_type_specifier": return true - if name == "number_literal" and $node.tsNodeParent.tsNodeType() in gExpressions: + if name in ["number_literal", "identifier"] and $node.tsNodeParent.tsNodeType() in gExpressions: return true if name in ["primitive_type", "sized_type_specifier"]: @@ -174,4 +174,4 @@ proc printNim*(fullpath: string, root: TSNode, astTable: AstTable) = echo &"{nimState.procStr}\n" if nimState.debugStr.nBl: - echo nimState.debugStr \ No newline at end of file + echo nimState.debugStr diff --git a/nimterop/git.nim b/nimterop/git.nim index b0380c2..c652d16 100644 --- a/nimterop/git.nim +++ b/nimterop/git.nim @@ -118,3 +118,21 @@ proc gitPull*(url: string, outdir = "", plist = "", checkout = "") = else: echo "Pulling repository" discard execAction(&"cd {outdirQ} && git pull --depth=1 origin master") + +proc configure*(path, check: string) = + if (path / check).fileExists(): + return + + echo "Configuring " & path + + if not fileExists(path / "configure"): + if fileExists(path / "autogen.sh"): + echo " Running autogen.sh" + + discard execAction(&"cd {path.quoteShell} && bash autogen.sh") + + if fileExists(path / "configure"): + echo " Running configure" + + discard execAction(&"cd {path.quoteShell} && bash configure") +